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

Merge branch 'gcp-wellbore' into 'master'

Gcp wellbore

See merge request !219
parents 5cd2b052 bc85b7bd
Pipeline #37242 passed with stages
in 20 seconds
......@@ -26,32 +26,38 @@ variables:
# common variables
DOMAIN: osdu-gcp.go3-nrg.projects.epam.com
OSDU_GCP_VENDOR: gcp
OSDU_NAMESPACE: osdu
# FIXME: Switch to use a single ingres + istio
OSDU_GCP_URL: http://34.117.1.106
OSDU_GCP_TENANT: osdu
OSDU_GCP_LEGAL_TAG: osdu-demo-legaltag
osdu-gcp-deploy:
image: gcr.io/google.com/cloudsdktool/cloud-sdk
stage: deploy
needs: ["osdu-gcp-containerize"]
script:
- gcloud auth activate-service-account --key-file $OSDU_GCP_DEPLOY_FILE
- 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 $SERVICE_NAME $OSDU_GCP_HELM_DEPLOYMENT_DIR
helm upgrade $OSDU_GCP_SERVICE $OSDU_GCP_HELM_DEPLOYMENT_DIR
--install
--create-namespace
--namespace=$SERVICE_NAME
--namespace=$OSDU_NAMESPACE
--wait
--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
--set namespace=$OSDU_NAMESPACE
--set image.repository=$CI_REGISTRY_IMAGE/osdu-gcp-$OSDU_GCP_SERVICE
--set image.tag=gcp-community
- echo ----- Verify Deployment -----
- kubectl rollout status deployment.v1.apps/${OSDU_GCP_SERVICE}-gcp -n $OSDU_NAMESPACE --timeout=900s
- POD=$(kubectl get pod -n $OSDU_NAMESPACE | grep wellbore | awk '{print $1}')
- STATUS=$(kubectl wait -n $OSDU_NAMESPACE --for=condition=Ready pod/${POD} --timeout=300s)
- echo $STATUS
- 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 ${OSDU_GCP_URL}${OSDU_GCP_HEALTH_PATH})
- if [[ "$STATUS_CODE" -ne 200 ]] ; then exit 1 ; else echo health check OK! ; fi
only:
variables:
- $OSDU_GCP == 'true'
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