Skip to content

Commit

Permalink
ci: add crds checker (#110)
Browse files Browse the repository at this point in the history
* ci: add crds checker

* ci: test checker crds

* ci: test checker crds
  • Loading branch information
daviderli614 authored Feb 20, 2024
1 parent 0316721 commit 86d7380
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .github/scripts/update-crds.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

function get_operator_app_version() {
operator_app_version=$(awk '/appVersion:/{print $2}' "charts/greptimedb-operator/Chart.yaml")
}

function main() {
get_operator_app_version

curl -sL "https://github.com/GreptimeTeam/greptimedb-operator/releases/download/v$operator_app_version/greptimedbclusters.yaml" -o charts/greptimedb-operator/crds/greptimedbclusters.yaml
curl -sL "https://github.com/GreptimeTeam/greptimedb-operator/releases/download/v$operator_app_version/greptimedbstandalones.yaml" -o charts/greptimedb-operator/crds/greptimedbstandalones.yaml
}

main
6 changes: 5 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ jobs:

- name: Check docs
run: |
make check-docs
make check-docs
- name: Check crds
run: |
make check-crds
- name: Install Helm
uses: azure/setup-helm@v3
Expand Down
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ check-docs: docs ## Check docs
exit 1)

.PHONY: e2e
e2e: ## Run e2e tests.
e2e: ## Run e2e tests
.github/scripts/deploy-greptimedb-cluster.sh
.github/scripts/deploy-greptimedb-standalone.sh

.PHONY: crds
crds: ## Run update crd
.github/scripts/update-crds.sh

.PHONY: check-crds
check-crds: crds ## Check crd
@git diff --quiet || \
(echo "Need to update crds, please run 'make crds'"; \
exit 1)

0 comments on commit 86d7380

Please sign in to comment.