Commit 81bd794e authored by Oleksii Tsyganov (EPAM)'s avatar Oleksii Tsyganov (EPAM)
Browse files

Configured GKE pipeline

parent 3acf2ee9
Pipeline #67381 failed
......@@ -43,6 +43,16 @@ variables:
OSDU_GCP_DES_SERVICE_HOST_STORAGE: https://os-storage-attcrcktoa-uc.a.run.app/api
OSDU_GCP_ENV_VARS: CLOUDPROVIDER=${OSDU_GCP_CLOUD_PROVIDER},DES_SERVICE_HOST_PARTITION=${OSDU_GCP_PARTITION_API},ENTITLEMENT_BASE_URL_PATH=${OSDU_GCP_ENTITLEMENT_BASE_URL_PATH},DATA_PARTITION_REST_HEADER_KEY=${OSDU_GCP_DATA_PARTITION_REST_HEADER_KEY},DES_SERVICE_HOST_STORAGE=${OSDU_GCP_DES_SERVICE_HOST_STORAGE},DES_SERVICE_HOST_COMPLIANCE=${OSDU_GCP_DES_SERVICE_HOST_COMPLIANCE},SEISTORE_DES_TARGET_AUDIENCE=${GOOGLE_AUDIENCE},SERVICE_CLOUD_PROJECT=${OSDU_GCP_PROJECT},APP_ENVIRONMENT_IDENTIFIER=${TENANT},IMP_SERVICE_ACCOUNT_SIGNER=${OSDU_GCP_IMP_SERVICE_ACCOUNT_SIGNER},DES_SERVICE_HOST_ENTITLEMENT=${OSDU_GCP_ENTITLEMENTS_V2_BASE_URL},SEISTORE_DES_APPKEY=${OSDU_GCP_SEISTORE_DES_APPKEY},DES_REDIS_INSTANCE_ADDRESS=${OSDU_GCP_DES_REDIS_INSTANCE_ADDRESS},DES_REDIS_INSTANCE_PORT=${OSDU_GCP_DES_REDIS_INSTANCE_PORT},LOCKSMAP_REDIS_INSTANCE_ADDRESS=${OSDU_GCP_LOCKSMAP_REDIS_INSTANCE_ADDRESS},LOCKSMAP_REDIS_INSTANCE_PORT=${OSDU_GCP_LOCKSMAP_REDIS_INSTANCE_PORT} --vpc-connector=$OSDU_GCP_VPC_CONNECTOR
OSDU_GCP_HELM_PACKAGE_CHARTS: "app/sdms/devops/gcp/deploy app/sdms/devops/gcp/configmap"
OSDU_GCP_HELM_CONFIG_SERVICE: seismic-store-config
OSDU_GCP_HELM_DEPLOYMENT_SERVICE: seismic-store-deploy
OSDU_GCP_HELM_CONFIG_SERVICE_VARS: "--set data.app_environment_identifier=${OSDU_GCP_TENANT} --set data.data_partition_rest_header_key=${OSDU_GCP_DATA_PARTITION_REST_HEADER_KEY} --set data. seistore_des_target_audience=${GOOGLE_AUDIENCE} --set data.service_cloud_project=${OSDU_GCP_PROJECT} --set data.imp_service_account_signer=${OSDU_GCP_IMP_SERVICE_ACCOUNT_SIGNER} --set data. seistore_des_appkey=${OSDU_GCP_SEISTORE_DES_APPKEY} --set data.des_redis_instance_address=${OSDU_GCP_DES_REDIS_INSTANCE_ADDRESS} --set data. locksmap_redis_instance_address=${OSDU_GCP_DES_REDIS_INSTANCE_ADDRESS}"
OSDU_GCP_HELM_DEPLOYMENT_SERVICE_VARS: "--set data.image=$CI_REGISTRY_IMAGE/osdu-gcp:$CI_COMMIT_SHORT_SHA --set data.serviceAccountName=workload-identity-sdms"
.common: &common
- gcloud auth activate-service-account --key-file $OSDU_GCP_DEPLOY_FILE
- gcloud config set project $OSDU_GCP_PROJECT
- gcloud container clusters get-credentials $OSDU_GCP_CLUSTER --zone $OSDU_GCP_ZONE --project $OSDU_GCP_PROJECT
- curl https://get.helm.sh/helm-v3.5.4-linux-amd64.tar.gz -s -o helm.tgz; tar -zxf helm.tgz; mv linux-amd64/helm /usr/local/bin/
sdms_osdu-gcp-helm-charts:
stage: build
......@@ -175,6 +185,78 @@ sdms_osdu-gcp-deploy:
- main
- merge_requests
sdms-gcp-deploy-configmap:
extends: .osdu-gcp-variables
image: gcr.io/google.com/cloudsdktool/cloud-sdk
stage: deploy
needs: ["sdms_compile-and-unit-test"]
script:
- *common
- >
helm upgrade $OSDU_GCP_HELM_CONFIG_SERVICE $OSDU_GCP_HELM_CONFIG_DIR
--install
--create-namespace
--namespace=$OSDU_GCP_HELM_NAMESPACE
--wait
--history-max=3
$OSDU_GCP_HELM_CONFIG_SERVICE_VARS
only:
variables:
- $OSDU_GCP == 'true'
sdms-gcp-deploy-deployment:
extends: .osdu-gcp-variables
image: gcr.io/google.com/cloudsdktool/cloud-sdk
stage: deploy
needs: ["sdms-gcp-deploy-configmap"]
script:
- *common
- >
helm upgrade $OSDU_GCP_HELM_DEPLOYMENT_SERVICE $OSDU_GCP_HELM_DEPLOYMENT_DIR
--install
--create-namespace
--namespace=$OSDU_GCP_HELM_NAMESPACE
--wait
--history-max=3
$OSDU_GCP_HELM_DEPLOYMENT_SERVICE_VARS
- echo ----- Verify Deployment -----
- kubectl rollout status deployment.v1.apps/$OSDU_GCP_SERVICE -n $OSDU_GCP_HELM_NAMESPACE --timeout=900s
- POD=$(kubectl get pod --sort-by=.metadata.creationTimestamp -n $OSDU_GCP_HELM_NAMESPACE | grep $OSDU_GCP_SERVICE | tail -1 | awk '{print $1}')
- STATUS=$(kubectl wait -n $OSDU_GCP_HELM_NAMESPACE --for=condition=Ready pod/$POD --timeout=300s)
- echo $STATUS
- if [[ "$STATUS" != *"met"* ]]; then echo "POD didn't start correctly" ; exit 1 ; fi
only:
variables:
- $OSDU_GCP == 'true'
sdms-gcp-test:
extends:
- .osdu-gcp-variables
image: node
stage: integration
needs: ["osdu-gcp-deploy-deployment"]
allow_failure: true
script:
- cd app/sdms
- echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && apt-get update -y && apt-get install google-cloud-sdk -y
- apt-get install -y python
- apt-get install -y python-pip
- npm install -g newman
- chmod +x ./tests/e2e/run_e2e_tests.sh
- echo $OSDU_GCP_INTEGRATION_TESTER | base64 -d > sa.json
- gcloud auth activate-service-account --key-file sa.json
- svctoken=$( gcloud auth print-access-token )
- ./tests/e2e/run_e2e_tests.sh --seistore-svc-url="$OSDU_GCP_SEISTORE_SVC_URL" --seistore-svc-api-key="NA" --user-idtoken="$svctoken" --tenant="${TENANT}" --admin-email="${OSDU_GCP_SEISTORE_ADMIN_EMAIL}" --datapartition="${DATA_PARTITION_ID}" --legaltag01="SeisDMS-Legal-Tag-Test" --legaltag02="SeisDMS2-Legal-Tag-Test" --VCS-Provider="${ISGITLAB}"
only:
variables:
- $OSDU_GCP == 'true' && $OSDU_GCP_INT_TEST_TYPE != 'python'
changes:
- app/sdms/**/*
refs:
- branches
- main
- merge_requests
sdms_osdu-gcp-tagging:
image: google/cloud-sdk
needs: ["sdms_osdu-gcp-deploy"]
......
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