Commit fc11479e authored by Oleksandr Kosse (EPAM)'s avatar Oleksandr Kosse (EPAM)
Browse files

Merge branch 'GONRG-2066_release_common_pipe_k8s' into 'master'

Resolve: Gonrg 2066 release common pipe k8s

See merge request osdu/platform/ci-cd-pipelines!206
parents ac99470e c0b0a10d
Pipeline #35716 passed with stages
in 40 seconds
# Copyright 2020 Google LLC
# Copyright 2021 Google LLC
# Copyright 2017-2019, Schlumberger
# Copyright 2020 EPAM
# Copyright 2021 EPAM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -22,37 +22,34 @@
# OSDU_GCP_INTEGRATION_TESTER
# OSDU_GCP_NO_DATA_ACCESS_TESTER
.osdu-gcp-variables:
variables:
# common variables
OSDU_GCP_PROJECT: nice-etching-277309
OSDU_GCP_ZONE: us-central1-c
OSDU_GCP_VENDOR: gcp
OSDU_GCP_TENANT: osdu
OSDU_GCP_CLUSTER: wb
OSDU_GCP_WELLBORE_DDMS_URL: https://wddms.osdu-gcp.go3-nrg.projects.epam.com/api/os-wellbore-ddms
variables:
# common variables
DOMAIN: osdu-gcp.go3-nrg.projects.epam.com
OSDU_GCP_VENDOR: gcp
osdu-gcp-deploy:
extends: .osdu-gcp-variables
image: gcr.io/google.com/cloudsdktool/cloud-sdk
stage: deploy
script:
- gcloud auth activate-service-account --key-file $OSDU_GCP_DEPLOY_FILE
- gcloud config set project $OSDU_GCP_PROJECT
- echo $OSDU_GCP_ZONE
- gcloud container clusters get-credentials $OSDU_GCP_CLUSTER --zone=$OSDU_GCP_ZONE
- gcloud config set project $OSDU_GCP_PROJECT_NAME
- gcloud container clusters get-credentials $OSDU_GCP_CLUSTER --zone $OSDU_GCP_ZONE --project $OSDU_GCP_PROJECT_NAME
- curl https://get.helm.sh/helm-v3.5.2-linux-amd64.tar.gz -s -o helm.tgz; tar -zxf helm.tgz; mv linux-amd64/helm /usr/local/bin/
- OSDU_GCP_HELM_DEPLOYMENT_DIR=`kubectl get configmap $SERVICE_NAME -n $SERVICE_NAME -o jsonpath='{.data.'DEPLOYMENT_DIR'}'`
- >
helm upgrade $OSDU_GCP_HELM_CHART $OSDU_GCP_HELM_DEPLOYMENT_DIR
helm upgrade $SERVICE_NAME $OSDU_GCP_HELM_DEPLOYMENT_DIR
--install
--create-namespace
--namespace=$OSDU_GCP_APPLICATION_NAMESPACE
--namespace=$SERVICE_NAME
--wait
$OSDU_GCP_ENV_HELM_EXTRA_VARS
--set image.repository=$OSDU_GCP_APPLICATION_IMAGE_REPOSITORY
--set image.tag=$OSDU_GCP_APPLICATION_IMAGE_TAG
--set secret.gcpSA=$OSDU_GCP_DATA_PROJECT_CREDENTIALS
- status_code=$(curl -X GET --write-out '%{http_code}' --silent --output /dev/null $OSDU_GCP_APPLICATION_HEALTH_URL)
--set namespace=$SERVICE_NAME
--set image.repository=`kubectl get configmap $SERVICE_NAME -n $SERVICE_NAME -o jsonpath='{.data.'IMAGE_NAME'}'`
--set image.tag=`kubectl get configmap $SERVICE_NAME -n $SERVICE_NAME -o jsonpath='{.data.'IMAGE_TAG'}'`
- kubectl rollout status deployment.v1.apps/`kubectl get deployments -n $SERVICE_NAME -o jsonpath='{..metadata.name}'` -n $SERVICE_NAME --timeout=900s
- pod=$(kubectl get pod -n $SERVICE_NAME -o jsonpath='{..metadata.name}')
- status=$(kubectl wait -n $SERVICE_NAME --for=condition=Ready pod/$pod --timeout=300s)
- if [[ "$status" != *"met"* ]]; then echo "POD didn't start correctly" ; exit 1 ; fi
- status_code=$( curl -X GET --write-out '%{http_code}' --silent --output /dev/null http://`kubectl get ingress -n $SERVICE_NAME -o jsonpath='{..ingress[*].'ip'}'``kubectl get configmap $SERVICE_NAME -n $SERVICE_NAME -o jsonpath='{.data.'HEALTH_URL'}'`)
- if [[ "$status_code" -ne 200 ]] ; then echo exit 1 ; else echo health check OK! ; fi
only:
variables:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment