osdu-gcp.yml 4.01 KB
Newer Older
1
.OSDU_GCP_variables:
2
  variables:
3
4
5
    # service's URLs
    OSDU_GCP_ENTITLEMENTS_URL: https://os-entitlements-gcp-attcrcktoa-uc.a.run.app/entitlements/v1/
    OSDU_GCP_STORAGE_URL: https://os-storage-dot-nice-etching-277309.uc.r.appspot.com/api/storage/v2/
6
    OSDU_GCP_RECORDS_ROOT_URL: https://os-storage-dot-nice-etching-277309.uc.r.appspot.com/api/storage/v2/
7
    OSDU_GCP_LEGAL_HOST_URL: https://os-legal-dot-nice-etching-277309.uc.r.appspot.com/api/legal/v1/
8
    OSDU_GCP_AIRFLOW_URL: https://c410714dc037b0e02p-tp.appspot.com/
9
    OSDU_GCP_DELIVERY_SERVICE_URL: https://os-delivery-attcrcktoa-uc.a.run.app/api/delivery/v2/
10
11
    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/
12
    OSDU_GCP_SEARCH_HOST: https://os-search-dot-nice-etching-277309.uc.r.appspot.com/api/search/v2/
13
    OSDU_GCP_SEARCH_QUERY_URL: https://os-search-dot-nice-etching-277309.uc.r.appspot.com//api/search/v2/query/
14
    OSDU_GCP_INDEXER_HOST: https://os-indexer-dot-nice-etching-277309.uc.r.appspot.com/
15
    OSDU_GCP_FILE_URL: https://os-file-attcrcktoa-uc.a.run.app/
16
    # variables for integration tests
17
18
    DEPLOY_ENV: empty
    DOMAIN: osdu-gcp.go3-nrg.projects.epam.com
19
    ENTITLEMENTS_DOMAIN: osdu-gcp.go3-nrg.projects.epam.com
20
21
22
23
24
25
26
27
28
29
    TENANT_NAME: osdu
    MY_TENANT_PROJECT: osdu
    MY_TENANT: osdu
    DATA_GROUP: osdu
    DEFAULT_DATA_PARTITION_ID_TENANT1: osdu
    DEFAULT_DATA_PARTITION_ID_TENANT2: osdu
    INTEGRATION_TEST_AUDIENCE: 689762842995-pv217jo3k8j803kk6gqf52qb5amos3a9.apps.googleusercontent.com
    INT_TEST_VENDOR: gcp
    PROJECT: nice-etching-277309
    GCLOUD_PROJECT: nice-etching-277309
30
31
    LEGAL_TAG: osdu-demo-legaltag
    OTHER_RELEVANT_DATA_COUNTRIES: US
32
    STORAGE_HOST: os-storage-dot-nice-etching-277309.uc.r.appspot.com
33
34


35

36
.osdu-gcp:
37
  tags: ["osdu-medium"]
38
39
40
41
  image: google/cloud-sdk

  only:
    variables:
42
      - $OSDU_GCP_BUILD_SUBDIR && $OSDU_GCP_INT_TEST_SUBDIR && $OSDU_GCP_APPLICATION_NAME && $OSDU_GCP_ENVIRONMENT && $OSDU_GCP_PROJECT && $OSDU_GCP_DEPLOY_FILE
43
44

  variables:
45
    OSDU_GCP_DEPLOY_DIR: OSDU_GCP_deploy_dir
46
47

  before_script:
48
49
    - mkdir -p "$OSDU_GCP_DEPLOY_DIR"
    - gcloud auth activate-service-account --key-file="$OSDU_GCP_DEPLOY_FILE"
50

51
52
osdu-gcp-deploy:
  extends: .osdu-gcp
53
  stage: deploy
54
  needs: ["compile-and-unit-test"]
55
  script:
56
    - cat $OSDU_GCP_APP_YAML > $OSDU_GCP_DEPLOY_DIR/app.yaml
57
58
59
    - cp -v "${OSDU_GCP_BUILD_SUBDIR}"/target/*-spring-boot.jar "$OSDU_GCP_DEPLOY_DIR"
    - cd "$OSDU_GCP_DEPLOY_DIR"
    - echo --version="$CI_COMMIT_SHORT_SHA" --project="$OSDU_GCP_PROJECT" app.yaml
60
    - gcloud auth list
61
    - gcloud app deploy --quiet --version="$CI_COMMIT_SHORT_SHA" --project="$OSDU_GCP_PROJECT" app.yaml
62
63
64
  only:
    variables:
      - $OSDU_GCP == 'true'
65

Aliaksandr Ramanovich (EPAM)'s avatar
Aliaksandr Ramanovich (EPAM) committed
66
osdu-gcp-test:
67
  extends:
68
    - .osdu-gcp
69
    - .maven
70
    - .OSDU_GCP_variables
71
  stage: integration
72
  needs: ["osdu-gcp-deploy"]
73
  variables:
74
    # integration test variables for search service
75
76
77
78
79
80
81
82
    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
    SEARCH_ON_BEHALF_INTEGRATION_TESTER: $OSDU_GCP_INTEGRATION_TESTER
    INDEXER_HOST: $OSDU_GCP_INDEXER_HOST
    SEARCH_HOST: $OSDU_GCP_SEARCH_HOST
83
    # integration test vars for storage service
84
85
86
87
88
89
    PUBSUB_TOKEN: $OSDU_GCP_PUBSUB_TOKEN
    STORAGE_URL: $OSDU_GCP_STORAGE_URL
    AUTHORIZE_API: $OSDU_GCP_ENTITLEMENTS_URL
    HOST_URL: $OSDU_GCP_LEGAL_HOST_URL
    LEGAL_URL: $OSDU_GCP_LEGAL_HOST_URL
    ENTITLEMENT_URL: $OSDU_GCP_ENTITLEMENT_URL
90
91
  script:
    - cd $OSDU_GCP_INT_TEST_SUBDIR
Aliaksandr Ramanovich (EPAM)'s avatar
Aliaksandr Ramanovich (EPAM) committed
92
93
94
    - export INTEGRATION_TESTER=$(echo $OSDU_GCP_R3_INTEGRATION_TESTER)
    - export NO_DATA_ACCESS_TESTER=$(echo $OSDU_GCP_R3_NO_DATA_ACCESS_TESTER)
    - export GCP_DEPLOY_FILE=$(echo $OSDU_GCP_DEPLOY_FILE)
Aliaksandr Ramanovich (EPAM)'s avatar
Aliaksandr Ramanovich (EPAM) committed
95
    - export SEARCH_INTEGRATION_TESTER=$(echo $OSDU_GCP_INTEGRATION_TESTER)
96
97
    # start tests
    - $MAVEN test
98
99
  only:
    variables:
100
      - $OSDU_GCP == 'true'