osdu-gcp.yml 3.36 KB
Newer Older
1
.OSDU_GCP_variables:
2
  variables:
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
    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_STORAGE_URL: https://os-storage-dot-nice-etching-277309.uc.r.appspot.com/api/storage/v2/
    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_AUTHORIZE_API: https://os-entitlements-gcp-attcrcktoa-uc.a.run.app/entitlements/v1
    OSDU_GCP_MY_TENANT_PROJECT: osdu
    OSDU_GCP_LEGAL_HOST_URL: https://os-legal-dot-nice-etching-277309.uc.r.appspot.com/api/legal/v1/
    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_ENTITLEMENT_URL: https://os-entitlements-gcp-attcrcktoa-uc.a.run.app/entitlements/v1
    OSDU_GCP_VENDOR: gcp
    OSDU_GCP_PROJECT: nice-etching-277309
20

21
.osdu-gcp:
22
  tags: ["osdu-medium"]
23
24
25
26
  image: google/cloud-sdk

  only:
    variables:
27
      - $OSDU_GCP_BUILD_SUBDIR && $OSDU_GCP_INT_TEST_SUBDIR && $OSDU_GCP_APPLICATION_NAME && $OSDU_GCP_ENVIRONMENT && $OSDU_GCP_PROJECT && $OSDU_GCP_DEPLOY_FILE
28
29

  variables:
30
    OSDU_GCP_DEPLOY_DIR: OSDU_GCP_deploy_dir
31
32

  before_script:
33
34
    - mkdir -p "$OSDU_GCP_DEPLOY_DIR"
    - gcloud auth activate-service-account --key-file="$OSDU_GCP_DEPLOY_FILE"
35

36
37
osdu-gcp-deploy:
  extends: .osdu-gcp
38
  stage: deploy
39
  needs: ["compile-and-unit-test"]
40
  script:
41
    - cat $OSDU_GCP_APP_YAML > $OSDU_GCP_DEPLOY_DIR/app.yaml
42
43
44
    - 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
45
    - gcloud auth list
46
    - gcloud app deploy --quiet --version="$CI_COMMIT_SHORT_SHA" --project="$OSDU_GCP_PROJECT" app.yaml
47
48
49
  only:
    variables:
      - $OSDU_GCP == 'true'
50

Aliaksandr Ramanovich (EPAM)'s avatar
Aliaksandr Ramanovich (EPAM) committed
51
osdu-gcp-test:
52
  extends:
53
    - .osdu-gcp
54
    - .maven
55
    - .OSDU_GCP_variables
56
  stage: integration
57
  needs: ["osdu-gcp-deploy"]
58
  script:
59
60
    - cd $OSDU_GCP_INT_TEST_SUBDIR
    - echo $OSDU_GCP_DEPLOY_ENV $DEPLOY_ENV
61
62
    - |
      $MAVEN test \
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
      -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} \
81
82
83
      -DLEGAL_URL=${OSDU_GCP_LEGAL_HOST_URL}
  only:
    variables:
84
      - $OSDU_GCP == 'true'