diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fb65b2474b110fd38a64a02e49022711634beef1..d667ca81999c2ccc547c77e5f1be60138b17d2d9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,6 +16,8 @@ variables: build ci: stage: .pre image: docker:19.03.1 + tags: + - docker services: - docker:19.03.1-dind before_script: @@ -61,6 +63,12 @@ build ci: sed -i "s/^appVersion: .*\$/appVersion: ${docker_tag}/g" ${SUBCOMP_CHART_DIR}/Chart.yaml # debug: - helm template ${SUBCOMP_CHART_DIR} . + artifacts: + paths: + - chart/${SUBCOMP_CHART_DIR} + variables: + - docker_tag + expire_in: 6 hours # XXX: Do we always want to clone the subcomponent # rules: # - if: '$GEOSPHERE_SUBCOMP == ""' @@ -73,4 +81,31 @@ get_chart_grb: extends: .get_chart_tmpl variables: SUBCOMP_REPOS: "geosphere-grb" - SUBCOMP_CHART_DIR: "cspp-geo-grb" \ No newline at end of file + SUBCOMP_CHART_DIR: "cspp-geo-grb" + +# TODO: Use "environment: " to define a job for production and one for development +# https://docs.gitlab.com/ee/ci/yaml/#environment +deploy_grb: + stage: deploy_grb + tags: + - docker + script: + - if [ -n "$CI_COMMIT_TAG" ]; then + ns="geosphere"; + else + ns="geosphere-test"; + fi + - echo $ns + - cd chart + # copy secret kubeconfig to the mounted (pwd) directory + - cp $kubekorner_k3s_config . + - kubeconfig=$(basename $kubekorner_k3s_config) + # namespace names are the same as domain names +# - helm upgrade -v 2 --install --kubeconfig $kubeconfig --namespace $ns --set grbNotifier.image.dockerTag=$docker_tag --set grbProcessor.env[0].name=APID_FILTER --set grbProcessor.env[0].value="GOES-16-ABI-Only.xml" cspp-geo-grb cspp-geo-grb/ + needs: + - job: get_chart_grb + artifacts: true + rules: + - if: '$kubekorner_k3s_config == ""' + when: never + - when: on_success