Newer
Older
# This file is included as part of the main repository .gitlab-ci.yml file
test gcp connection:
environment:
name: gcp
stage: test
# don't need any artifacts for this to run
dependencies: []
- gcloud auth activate-service-account "${GEOSPHERE_DEPLOY_GCP_SA_EMAIL}" --key-file="${GEOSPHERE_DEPLOY_GCP_SA_KEY}"
# If this produces a warning about not having permission make sure the SA
# has the project "Viewer" role. If it still produces a warning then try
# enabling this Cloud Resource Manager API. See admin/GCP_README.md
# for more information.
- gcloud config set project "${GEOSPHERE_DEPLOY_GCP_PROJECT_NAME}"
- if [ "${GEOSPHERE_DEPLOY_GCP_CLUSTER_NAME}" != "" ]; then
gcloud container clusters get-credentials "${GEOSPHERE_DEPLOY_GCP_CLUSTER_NAME}" --zone "${GEOSPHERE_DEPLOY_GCP_ZONE_NAME}";
kubectl get all;
fi
gstest deploy client:
environment:
name: gcp
extends: .helm_based_job
image: google/cloud-sdk:latest
variables:
KUBECONFIG: "/root/.kube/config"
before_script:
- source ./helpers/shell_aliases.sh
- gcloud auth activate-service-account "${GEOSPHERE_DEPLOY_GCP_SA_EMAIL}" --key-file="${GEOSPHERE_DEPLOY_GCP_SA_KEY}"
# If this produces a warning about not having permission make sure the SA
# has the project "Viewer" role. If it still produces a warning then try
# enabling this Cloud Resource Manager API. See admin/GCP_README.md
# for more information.
- gcloud config set project "${GEOSPHERE_DEPLOY_GCP_PROJECT_NAME}"
- gcloud container clusters get-credentials "${GEOSPHERE_DEPLOY_GCP_CLUSTER_NAME}" --zone "${GEOSPHERE_DEPLOY_GCP_ZONE_NAME}";
- helm registry login -u ${CI_REGISTRY_USER} -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- helm repo add stable https://kubernetes-charts.storage.googleapis.com
- helm repo update
script:
- ns="default"
- cd geosphere-client/chart
- source geosphere-client/cibuild.env
- echo "Deploying version $docker_tag to cluster namespace $ns"
# copy extra values files to the local directory (where helm has access via docker mount)
- cp ../../ci_gcp/values-client.yaml .
- ls ~/.kube || echo "Nope"
- ls ~/.config || echo "Nope"
- helm_debug ls -a /root/.cache
- helm_debug ls -a /root/.config
- helm_debug ls -a /root/.helm
- helm_for_gcp list --kubeconfig /root/.kube/config
# namespace names are the same as domain names
- helm_for_gcp upgrade -v 2 --kubeconfig /root/.kube/config --install --namespace $ns -f /apps/values-client.yaml geosphere-client /apps/geosphere-client/
dependencies:
- get_chart_client_test
rules:
- if: '$CI_COMMIT_BRANCH != "gcp"'
when: never
- when: on_success