# Copyright 2020 Google LLC # Copyright 2017-2019, Schlumberger # Copyright 2020 EPAM # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Global Protected Variables: # # OSDU_GCP # OSDU_GCP_DEPLOY_FILE # OSDU_GCP_SERVICE_ACCOUNT # OSDU_GCP_INTEGRATION_TESTER # OSDU_GCP_NO_DATA_ACCESS_TESTER .osdu-gcp-variables: variables: # services' urls OSDU_GCP_STORAGE_HOSTNAME: os-storage-attcrcktoa-uc.a.run.app OSDU_GCP_LEGALTAG_API: https://os-legal-attcrcktoa-uc.a.run.app/api/legal/v1 OSDU_GCP_CRS_API: https://crs-converter-attcrcktoa-uc.a.run.app/api/crs/v2 OSDU_GCP_REGISTER_URL: https://os-register-attcrcktoa-uc.a.run.app/ OSDU_GCP_ENTITLEMENTS_URL: https://os-entitlements-gcp-attcrcktoa-uc.a.run.app/entitlements/v1/ OSDU_GCP_AUTHORIZE_API: https://os-entitlements-gcp-attcrcktoa-uc.a.run.app/entitlements/v1/ OSDU_GCP_STORAGE_URL: https://os-storage-attcrcktoa-uc.a.run.app/api/storage/v2/ OSDU_GCP_RECORDS_ROOT_URL: https://os-storage-attcrcktoa-uc.a.run.app/api/storage/v2/ OSDU_GCP_LEGAL_HOST_URL: https://os-legal-attcrcktoa-uc.a.run.app/api/legal/v1/ OSDU_GCP_LEGAL_HOSTNAME: https://os-legal-attcrcktoa-uc.a.run.app/ OSDU_GCP_AIRFLOW_URL: https://c410714dc037b0e02p-tp.appspot.com/ OSDU_GCP_DELIVERY_SERVICE_URL: https://os-delivery-attcrcktoa-uc.a.run.app/api/delivery/v2/ OSDU_GCP_INGEST_HOST: https://os-ingest-attcrcktoa-uc.a.run.app/ OSDU_GCP_WORKFLOW_SERVICE_URL: https://os-workflow-attcrcktoa-uc.a.run.app/ OSDU_GCP_SEARCH_HOST: https://os-search-attcrcktoa-uc.a.run.app/api/search/v2/ OSDU_GCP_SEARCH_QUERY_URL: https://os-search-attcrcktoa-uc.a.run.app/api/search/v2/query/ OSDU_GCP_INDEXER_HOST: https://os-indexer-attcrcktoa-uc.a.run.app/ OSDU_GCP_INDEXER_HOST_SEARCH: https://os-indexer-attcrcktoa-uc.a.run.app/api/indexer/v2/ OSDU_GCP_FILE_URL: https://os-file-attcrcktoa-uc.a.run.app/ OSDU_GCP_NOTIFICATION_URL: https://os-notification-attcrcktoa-uc.a.run.app/ OSDU_GCP_STORAGE_QUERY_RECORD_HOST: https://os-storage-attcrcktoa-uc.a.run.app/api/storage/v2/query/records OSDU_GCP_STORAGE_SCHEMA_HOST: https://os-storage-attcrcktoa-uc.a.run.app/api/storage/v2/schemas OSDU_GCP_STORAGE_QUERY_RECORD_FOR_CONVERSION_HOST: https://os-storage-attcrcktoa-uc.a.run.app/api/storage/v2/query/records:batch OSDU_GCP_INDEXER_QUEUE_HOST: https://indexer-queue-attcrcktoa-uc.a.run.app/api/indexer/v1/_dps/task-handlers/enqueue OSDU_GCP_UNIT_HOSTNAME: os-unit-attcrcktoa-uc.a.run.app OSDU_GCP_CRS_CONVERTER_HOSTNAME: crs-converter-attcrcktoa-uc.a.run.app OSDU_GCP_CRS_CATALOG_HOSTNAME: os-crs-catalog-attcrcktoa-uc.a.run.app OSDU_GCP_SCHEMA_URL: https://os-schema-attcrcktoa-uc.a.run.app REDIS_GROUP_HOST: 10.234.198.27 REDIS_SEARCH_HOST: 10.99.138.107 REDIS_STORAGE_HOST: 10.16.59.203 REDIS_SYNC_HOST: 10.116.62.35 OSDU_GCP_REDIS_SEARCH_PORT: 6379 OSDU_GCP_SPRING_PROFILES_ACTIVE: dev # variables for unit deployment OSDU_GCP_UNIT_CATALOG_BUCKET: nice-etching-277309-unit-catalog-bucket # common variables OSDU_GCP_CLOUDRUN_REGION: us-central1 OSDU_GCP_PROJECT: nice-etching-277309 OSDU_GCP_VPC_CONNECTOR: osdu-connector OSDU_GCP_PORT: 8080 # common variables for tests GOOGLE_AUDIENCE: 689762842995-pv217jo3k8j803kk6gqf52qb5amos3a9.apps.googleusercontent.com DOMAIN: osdu-gcp.go3-nrg.projects.epam.com LEGAL_TAG: osdu-demo-legaltag OTHER_RELEVANT_DATA_COUNTRIES: US DEFAULT_DATA_PARTITION_ID_TENANT1: osdu GCLOUD_PROJECT: nice-etching-277309 # variables for storage tests TENANT_NAME: osdu # variables for workflow tests FINISHED_WORKFLOW_ID: fad778da-fbc4-4261-8b3e-deb48be44969 # variables for ingestion tests TEST_OSDU_FILE_PATH: gs://nice-etching-277309-file/r1/data/provided/well-logs/1013_akm11_1978_comp.las # variables for file tests TARGET_AUDIENCE: 689762842995-pv217jo3k8j803kk6gqf52qb5amos3a9.apps.googleusercontent.com DATA_PARTITION_ID: osdu USER_ID: common-user TIME_ZONE: UTC+0 FILE_BUCKET: nice-etching-277309-file # variables for delivery tests ENTITLEMENTS_DOMAIN: osdu-gcp.go3-nrg.projects.epam.com TENANT: osdu #DEFAULT_DATA_PARTITION_ID_TENANT2: osdu INTEGRATION_TEST_AUDIENCE: 689762842995-pv217jo3k8j803kk6gqf52qb5amos3a9.apps.googleusercontent.com # variables for register tests, and deployment SERVICE_IDENTITY: osdu-gcp-sa RECORDS_CHANGE_PUBSUB_ENDPOINT: https://os-notification-attcrcktoa-uc.a.run.app/push-handlers/records-changed CRON_JOB_EXPECTED_IP: 0:0:0:0:0:0:0:1 SUBSCRIBER_PRIVATE_KEY_ID: $OSDU_GCP_SUBSCRIBER_PRIVATE_KEY_ID SUBSCRIBER_SECRET: $OSDU_GCP_SUBSCRIBER_SECRET SUBSCRIPTION_ID: $OSDU_GCP_REGISTER_SUBSCRIPTION_ID REGISTER_CUSTOM_PUSH_URL: https://os-register-attcrcktoa-uc.a.run.app/api/register/v1/test/challenge/1 CLIENT_TENANT: nonexistenttenant OSDU_TENANT: osdu REGISTER_BASE_URL: https://os-register-attcrcktoa-uc.a.run.app/ ENVIRONMENT: dev # variables for notification tests HMAC_SECRET: $OSDU_GCP_SUBSCRIBER_SECRET REGISTER_CUSTOM_PUSH_URL_HMAC: https://os-register-attcrcktoa-uc.a.run.app/api/register/v1/test/challenge/hmac-integration-test TOPIC_ID: records-changed NOTIFICATION_BASE_URL: $OSDU_GCP_NOTIFICATION_URL # variables for legal tests MY_TENANT_PROJECT: osdu MY_TENANT: osdu ENABLE_FULL_BUCKET_NAME: "true" SKIP_HTTP_TESTS: "true" # variables for search tests DATA_GROUP: osdu ENTITLEMENTS_HOST: $OSDU_GCP_ENTITLEMENTS_URL ELASTIC_PASSWORD: $OSDU_GCP_ELASTIC_PASSWORD ELASTIC_USER_NAME: $OSDU_GCP_ELASTIC_USER ELASTIC_HOST: $OSDU_GCP_ELASTIC_HOST ELASTIC_PORT: $OSDU_GCP_ELASTIC_PORT DATA_PARTITION_ID_TENANT1: osdu # variables for schema tests VENDOR: $OSDU_GCP_VENDOR HOST: $OSDU_GCP_SCHEMA_URL PRIVATE_TENANT1: osdu PRIVATE_TENANT2: osdu SHARED_TENANT: osdu osdu-gcp-containerize: stage: containerize needs: ["compile-and-unit-test"] extends: .osdu-gcp-variables image: gcr.io/google.com/cloudsdktool/cloud-sdk cache: {} script: - gcloud auth activate-service-account --key-file $OSDU_GCP_DEPLOY_FILE - gcloud config set project $OSDU_GCP_PROJECT - touch .gcloudignore - gcloud builds submit --config provider/$OSDU_GCP_SERVICE-$OSDU_GCP_VENDOR/cloudbuild/cloudbuild.yaml --substitutions=_GCP_SERVICE=$OSDU_GCP_SERVICE,_APPLICATION_NAME=$OSDU_GCP_APPLICATION_NAME,_PROVIDER_NAME=$OSDU_GCP_VENDOR,_SHORT_SHA=$CI_COMMIT_SHORT_SHA,_PORT=$OSDU_GCP_PORT only: variables: - $OSDU_GCP == 'true' osdu-gcp-deploy: image: gcr.io/google.com/cloudsdktool/cloud-sdk needs: ["osdu-gcp-containerize"] stage: deploy extends: .osdu-gcp-variables cache: {} script: - gcloud auth activate-service-account --key-file $OSDU_GCP_DEPLOY_FILE - gcloud config set project $OSDU_GCP_PROJECT - > gcloud beta run deploy $OSDU_GCP_APPLICATION_NAME --image gcr.io/$OSDU_GCP_PROJECT/$OSDU_GCP_APPLICATION_NAME/$OSDU_GCP_SERVICE-$OSDU_GCP_VENDOR:$CI_COMMIT_SHORT_SHA --platform managed --region $OSDU_GCP_CLOUDRUN_REGION --allow-unauthenticated --service-account $OSDU_GCP_SERVICE_ACCOUNT --memory 512M $OSDU_GCP_CLOUD_RUN_PARAMETERS --set-env-vars=$OSDU_GCP_ENV_VARS - gcloud run services update-traffic $OSDU_GCP_APPLICATION_NAME --platform managed --region $OSDU_GCP_CLOUDRUN_REGION --to-latest only: variables: - $OSDU_GCP == 'true' osdu-gcp-test: image: maven:3.3.9-jdk-8 extends: - .osdu-gcp-variables - .maven stage: integration needs: ["osdu-gcp-deploy"] allow_failure: false variables: WORKFLOW_HOST: $OSDU_GCP_WORKFLOW_SERVICE_URL INGEST_HOST: $OSDU_GCP_INGEST_HOST TEST_FILE_ID: $OSDU_GCP_TEST_FILE_ID FILE_SERVICE_HOST: $OSDU_GCP_FILE_URL DELIVERY_HOST: $OSDU_GCP_DELIVERY_SERVICE_URL SEARCH_HOST: $OSDU_GCP_SEARCH_HOST STORAGE_HOST: $OSDU_GCP_STORAGE_URL DE_OPS_TESTER: $OSDU_GCP_R3_OPS_TESTER DE_ADMIN_TESTER: $OSDU_GCP_R3_ADMIN_TESTER DE_EDITOR_TESTER: $OSDU_GCP_R3_EDITOR_TESTER DE_NO_ACCESS_TESTER: $OSDU_GCP_R3_NO_ACCESS_TESTER STORAGE_URL: $OSDU_GCP_STORAGE_URL DEPLOY_ENV: empty LEGAL_URL: $OSDU_GCP_LEGAL_HOST_URL PUBSUB_TOKEN: $GCP_PUBSUB_TOKEN INTEGRATION_TESTER: $OSDU_GCP_INTEGRATION_TESTER NO_DATA_ACCESS_TESTER: $OSDU_GCP_NO_DATA_ACCESS_TESTER SEARCH_INTEGRATION_TESTER: $OSDU_GCP_INTEGRATION_TESTER HOST_URL: $OSDU_GCP_LEGAL_HOST_URL INDEXER_HOST: $OSDU_GCP_INDEXER_HOST_SEARCH OSDU_GCP_TESTING_DIR: testing script: - export GCP_DEPLOY_FILE=$(echo $OSDU_GCP_DEPLOY_FILE) - > mvn --batch-mode --settings=$CI_PROJECT_DIR/.mvn/community-maven.settings.xml -f $OSDU_GCP_TESTING_DIR/pom.xml verify --projects $OSDU_GCP_SERVICE-test-core,$OSDU_GCP_SERVICE-test-gcp 2>&1 | tee test-results.log only: variables: - $OSDU_GCP == 'true' && $OSDU_GCP_INT_TEST_TYPE != 'python' artifacts: when: always paths: - test-results.log expire_in: 1 week osdu-gcp-test-python: extends: - .osdu-gcp-variables variables: INTEGRATION_TESTER: $OSDU_GCP_INTEGRATION_TESTER MY_TENANT: osdu GOOGLE_AUDIENCES: $GOOGLE_AUDIENCE stage: integration image: python:3.7 needs: ["osdu-gcp-deploy"] allow_failure: false script: - cd $OSDU_GCP_PYTHON_INT_TEST_SUBDIR - chmod +x ./run-integration-tests.sh - ./run-integration-tests.sh only: variables: - $OSDU_GCP == 'true' && $OSDU_GCP_INT_TEST_TYPE == 'python' osdu-gcp-tagging: image: google/cloud-sdk needs: ["osdu-gcp-deploy"] stage: integration extends: .osdu-gcp-variables cache: {} script: - gcloud auth activate-service-account --key-file $OSDU_GCP_DEPLOY_FILE - gcloud config set project $OSDU_GCP_PROJECT - gcloud container images add-tag gcr.io/$OSDU_GCP_PROJECT/$OSDU_GCP_APPLICATION_NAME/$OSDU_GCP_SERVICE-$OSDU_GCP_VENDOR:$CI_COMMIT_SHORT_SHA gcr.io/$OSDU_GCP_PROJECT/$OSDU_GCP_APPLICATION_NAME/$OSDU_GCP_SERVICE-$OSDU_GCP_VENDOR:$CI_COMMIT_TAG only: - tags