diff --git a/mixins/deploy/gcp-deploy.yml b/mixins/deploy/gcp-deploy.yml deleted file mode 100644 index ebc670b6e25467ccb2e0b5b37a0bf0a202cea976..0000000000000000000000000000000000000000 --- a/mixins/deploy/gcp-deploy.yml +++ /dev/null @@ -1,11 +0,0 @@ -include: - - local: '/base/gcp-k8s-auth.yml' - -.gcp_deploy: - extends: .gcp_k8s_auth - stage: deploy - script: - - cd k8s/$APP/overlays/$OVERLAY/ - - kustomize edit set image $CI_REGISTRY_IMAGE=$NEW_IMAGE - - kustomize build . | kubectl apply -f - - allow_failure: false diff --git a/mixins/deploy/gcp-k8s-deploy.yml b/mixins/deploy/gcp-k8s-deploy.yml new file mode 100644 index 0000000000000000000000000000000000000000..593867ecacfd5d9d1bc48cadf140d37de37c6335 --- /dev/null +++ b/mixins/deploy/gcp-k8s-deploy.yml @@ -0,0 +1,32 @@ +include: + - local: '/base/gcp-k8s-auth.yml' + + +# ------------------------------ DEPLOY --------------------------------------- +# This CI template consists of two parts: +# - Auth +# - Deploy + +# [[ AUTH ]] - authenticates against a GCP cluster +# - ZONE - GCP cluster zone (e.g. us-east1-b) +# - PROJECT - GCP project ID +# - CLUSTER - name of the cluster to authenticate to +# - SERVICE_ACCOUNT_CREDENTIALS - JSON credentials for the service account + +# [[ DEPLOY ]] - deploys from path `k8s/$APP/overlays/$OVERLAY` +# - APP - app to deploy +# - OLD_IMAGE - specify this only if you want the image changed; default value is $CI_REGISTRY_IMAGE (will change the image each time the job is run) +# - NEW_IMAGE - image:tag you want the OLD_IMAGE replaced with. Defaults to $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA in the template +# - OVERLAY - overlay you want the deploy + +.gcp_k8s_deploy: + extends: .gcp_k8s_auth + stage: deploy + variables: + OLD_IMAGE: $CI_REGISTRY_IMAGE + NEW_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA + script: + - cd k8s/$APP/overlays/$OVERLAY/ + - kustomize edit set image $OLD_IMAGE=$NEW_IMAGE + - kustomize build . | kubectl apply -f - + allow_failure: false diff --git a/mixins/test/gcp-k8s-diff.yml b/mixins/test/gcp-k8s-diff.yml index 2261b46ccef0ab98f6287fc35f85bbd3d895a606..95e5132dcd75db591169b0da8d490c44e0c392b8 100644 --- a/mixins/test/gcp-k8s-diff.yml +++ b/mixins/test/gcp-k8s-diff.yml @@ -2,6 +2,20 @@ include: - local: '/base/gcp-k8s-auth.yml' +# This CI template consists of two parts: +# - Auth +# - Diff test + +# [[ AUTH ]] - authenticates against a GCP cluster +# - ZONE - GCP cluster zone (e.g. us-east1-b) +# - PROJECT - GCP project ID +# - CLUSTER - name of the cluster to authenticate to +# - SERVICE_ACCOUNT_CREDENTIALS - JSON credentials for the service account + +# [[ K8S TEST ]] - tests k8s coniguration in path `k8s/$APP/overlays/$OVERLAY` +# - APP - app which should have its k8s config tested +# - OVERLAY - overlay you want the deploy + .gcp_k8s_diff: extends: .gcp_k8s_auth script: