osdu-gcp.yml 3.92 KB
Newer Older
1
.OSDU_GCP_variables:
2
  variables:
3
4
5
6
7
8
9
10
11
12
13
14
15
    # service's URLs
    OSDU_GCP_ENTITLEMENTS_URL: https://os-entitlements-gcp-attcrcktoa-uc.a.run.app/entitlements/v1/
    OSDU_GCP_AUTHORIZE_API: $OSDU_GCP_ENTITLEMENTS_URL
    OSDU_GCP_STORAGE_URL: https://os-storage-dot-nice-etching-277309.uc.r.appspot.com/api/storage/v2/
    OSDU_GCP_RECORDS_ROOT_URL: $OSDU_GCP_STORAGE_URL
    OSDU_GCP_LEGAL_HOST_URL: https://os-legal-dot-nice-etching-277309.uc.r.appspot.com/api/legal/v1/
    OSDU_GCP_AIRFLOW_URL: https://c410714dc037b0e02p-tp.appspot.com
    OSDU_GCP_DELIVERY_SERVICE_URL: https://os-file-attcrcktoa-uc.a.run.app
    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-dot-nice-etching-277309.uc.r.appspot.com/api/search/v2/
    OSDU_GCP_SEARCH_QUERY_URL: https://os-search-dot-nice-etching-277309.uc.r.appspot.com//api/search/v2/query
    # variables for integration tests
16
17
18
19
20
21
22
23
24
25
26
27
28
    OSDU_GCP_INTEGRATION_TESTER: $OSDU_GCP_INTEGRATION_TESTER
    OSDU_GCP_NO_DATA_ACCESS_TESTER: $OSDU_GCP_NO_DATA_ACCESS_TESTER
    OSDU_GCP_PUBSUB_TOKEN: $OSDU_GCP_PUBSUB_TOKEN
    OSDU_GCP_DEPLOY_ENV: empty
    OSDU_GCP_DOMAIN: osdu-gcp.go3-nrg.projects.epam.com
    OSDU_GCP_TENANT_NAME: osdu
    #Old OSDU_GCP_AUTHORIZE_API: https://entitlements-dot-nice-etching-277309.uc.r.appspot.com/entitlements/v1/
    OSDU_GCP_MY_TENANT_PROJECT: osdu
    OSDU_GCP_INTEGRATION_TEST_AUDIENCE: 689762842995-pv217jo3k8j803kk6gqf52qb5amos3a9.apps.googleusercontent.com
    OSDU_GCP_MY_TENANT: osdu
    #Old OSDU_GCP_ENTITLEMENT_URL: https://entitlements-dot-nice-etching-277309.uc.r.appspot.com/entitlements/v1/
    OSDU_GCP_VENDOR: gcp
    OSDU_GCP_PROJECT: nice-etching-277309
29

30
.osdu-gcp:
31
  tags: ["osdu-medium"]
32
33
34
35
  image: google/cloud-sdk

  only:
    variables:
36
      - $OSDU_GCP_BUILD_SUBDIR && $OSDU_GCP_INT_TEST_SUBDIR && $OSDU_GCP_APPLICATION_NAME && $OSDU_GCP_ENVIRONMENT && $OSDU_GCP_PROJECT && $OSDU_GCP_DEPLOY_FILE
37
38

  variables:
39
    OSDU_GCP_DEPLOY_DIR: OSDU_GCP_deploy_dir
40
41

  before_script:
42
43
    - mkdir -p "$OSDU_GCP_DEPLOY_DIR"
    - gcloud auth activate-service-account --key-file="$OSDU_GCP_DEPLOY_FILE"
44

45
46
osdu-gcp-deploy:
  extends: .osdu-gcp
47
  stage: deploy
48
  needs: ["compile-and-unit-test"]
49
  script:
50
    - cat $OSDU_GCP_APP_YAML > $OSDU_GCP_DEPLOY_DIR/app.yaml
51
52
53
    - 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
54
    - gcloud auth list
55
    - gcloud app deploy --quiet --version="$CI_COMMIT_SHORT_SHA" --project="$OSDU_GCP_PROJECT" app.yaml
56
57
58
  only:
    variables:
      - $OSDU_GCP == 'true'
59

Aliaksandr Ramanovich (EPAM)'s avatar
Aliaksandr Ramanovich (EPAM) committed
60
osdu-gcp-test:
61
  extends:
62
    - .osdu-gcp
63
    - .maven
64
    - .OSDU_GCP_variables
65
  stage: integration
66
  needs: ["osdu-gcp-deploy"]
67
  script:
68
69
    - cd $OSDU_GCP_INT_TEST_SUBDIR
    - echo $OSDU_GCP_DEPLOY_ENV $DEPLOY_ENV
70
71
    - |
      $MAVEN test \
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
      -DINTEGRATION_TESTER=${OSDU_GCP_INTEGRATION_TESTER} \
      -DNO_DATA_ACCESS_TESTER=${OSDU_GCP_NO_DATA_ACCESS_TESTER} \
      -DPUBSUB_TOKEN=${OSDU_GCP_PUBSUB_TOKEN} \
      -DSTORAGE_URL=${OSDU_GCP_STORAGE_URL} \
      -DDEPLOY_ENV=${OSDU_GCP_DEPLOY_ENV} \
      -DDOMAIN=${OSDU_GCP_DOMAIN} \
      -DTENANT_NAME=${OSDU_GCP_TENANT_NAME} \
      -DAUTHORIZE_API=${OSDU_GCP_AUTHORIZE_API} \
      -DMY_TENANT_PROJECT=${OSDU_GCP_MY_TENANT_PROJECT} \
      -DHOST_URL=${OSDU_GCP_LEGAL_HOST_URL} \
      -DINTEGRATION_TEST_AUDIENCE=${OSDU_GCP_INTEGRATION_TEST_AUDIENCE} \
      -DMY_TENANT=${OSDU_GCP_MY_TENANT} \
      -DENTITLEMENT_URL=${OSDU_GCP_ENTITLEMENT_URL} \
      -DGCLOUD_PROJECT=${OSDU_GCP_MY_TENANT_PROJECT} \
      -DENVIRONMENT=${OSDU_GCP_DEPLOY_ENV} \
      -DSTORAGE_URL=${OSDU_GCP_STORAGE_URL} \
      -DINT_TEST_VENDOR=${OSDU_GCP_VENDOR} \
      -DTENANT_GCP=${OSDU_GCP_MY_TENANT_PROJECT} \
90
91
92
      -DLEGAL_URL=${OSDU_GCP_LEGAL_HOST_URL}
  only:
    variables:
93
      - $OSDU_GCP == 'true'