diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8bf70c0c712a5b76676b1d10d8663ff1f02a4923..f9ca1b4940572faa62ec65c1be182d4143aa91a6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -50,6 +50,7 @@ lint-docker-compose: - 'wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -O /usr/bin/yq && chmod +x /usr/bin/yq' - 'ls -la .scripts' script: + - "bash .scripts/check-compose.sh" - "yq compare -P docker-compose.yml .docker/docker-compose.yml 'volumes.*'" - "IGNORE_IMAGE=1 IGNORE_PORTS=1 bash .scripts/check-service.sh 'dbrepo-analyse-service'" - "bash .scripts/check-service.sh 'dbrepo-auth-db'" @@ -75,12 +76,22 @@ lint-helm-chart: image: docker.io/alpine:${ALPINE_VERSION} stage: lint before_script: - - apk add helm + - apk --no-cache add helm + - helm plugin install https://github.com/losisin/helm-values-schema-json.git - helm dependency update ./helm/seaweedfs - helm package ./helm/seaweedfs --destination ./build - helm dependency update ./helm/dbrepo + - ./.scripts/check-helm.sh script: - helm lint ./helm/dbrepo + - diff ./values.schema.json ./helm/dbrepo/values.schema.json + - diff ./README.md ./helm/dbrepo/README.md + +lint-metadata-schema: + image: docker.io/alpine:${ALPINE_VERSION} + stage: lint + script: + - diff dbrepo-metadata-db/1_setup-schema.sql helm/dbrepo/files/01-setup-schema.sql build-metadata-service: image: maven:3-openjdk-${JAVA_VERSION} diff --git a/.scripts/check-compose.sh b/.scripts/check-compose.sh new file mode 100644 index 0000000000000000000000000000000000000000..82f1a5170701886910ca6a36453aeab1ce1be625 --- /dev/null +++ b/.scripts/check-compose.sh @@ -0,0 +1,6 @@ +#!/bin/bash +OUTPUT=$(cat .docker/docker-compose.yml | grep "registry.datalab.tuwien.ac.at/.*" | grep -v "$APP_VERSION") +if [ $? -ne 1 ]; then + echo "[ERROR] Some image version(s) differ from APP_VERSION=${APP_VERSION}: ${OUTPUT}" + exit 1 +fi \ No newline at end of file diff --git a/.scripts/check-helm.sh b/.scripts/check-helm.sh index 2233434029da0f89a672b9796317ac261bfa476a..2461d7fd4747b65559e52d672eafba671c9a9805 100755 --- a/.scripts/check-helm.sh +++ b/.scripts/check-helm.sh @@ -4,3 +4,8 @@ if [ $? -ne 0 ]; then echo "!!! Please install the Helm values schema plugin first\n" echo " https://github.com/losisin/helm-values-schema-json" fi +OUTPUT=$(cat helm/dbrepo/values.yaml | grep "registry.datalab.tuwien.ac.at/.*" | grep -v "$APP_VERSION") +if [ $? -ne 1 ]; then + echo "[ERROR] Some image version(s) differ from APP_VERSION=${APP_VERSION} in Helm Char: ${OUTPUT}" + exit 1 +fi \ No newline at end of file