override-stages.yml 4.17 KB
Newer Older
1
2
3
4
5
6
variables:
  OSDU_GCP_ENABLE_BOOTSTRAP: "true"
  OSDU_GCP_SERVICE: schema
  OSDU_GCP_VENDOR: gcp
  OSDU_GCP_HELM_CONFIG_SERVICE: schema-config
  OSDU_GCP_HELM_DEPLOYMENT_SERVICE: schema-deploy
7
  OSDU_GCP_HELM_TIMEOUT: "--timeout 20m"
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
  OSDU_GCP_HELM_CONFIG_SERVICE_VARS: >
    --set data.log_level=INFO
    --set data.google_audiences=$GOOGLE_AUDIENCE
    --set data.shared_tenant_name=$OSDU_GCP_TENANT
    --set data.data_partition_id=$DATA_PARTITION_ID
  OSDU_GCP_HELM_CONFIG_SERVICE_VARS_DEV2: >
    --set data.log_level=INFO
    --set data.google_audiences=$GOOGLE_AUDIENCE
    --set data.shared_tenant_name=$OSDU_GCP_TENANT
    --set data.data_partition_id=$DATA_PARTITION_ID
  OSDU_GCP_HELM_DEPLOYMENT_SERVICE_VARS: >
    --set data.image=$CI_REGISTRY_IMAGE/osdu-gcp-$OSDU_GCP_SERVICE:$CI_COMMIT_SHORT_SHA
    --set data.serviceAccountName=$OSDU_GCP_SERVICE-k8s
    --set data.bootstrap_image=$CI_REGISTRY_IMAGE/osdu-gcp-bootstrap-$OSDU_GCP_SERVICE:$CI_COMMIT_SHORT_SHA
    --set data.bootstrapServiceAccountName=datafier-workload-identity-gke
    $OSDU_GCP_HELM_TIMEOUT
  # FIXME add value below for DEV2 pipeline
  # OSDU_GCP_HELM_DEPLOYMENT_SERVICE_VARS_DEV2: >

# REFACTOR to common pipeline
osdu-gcp-deploy-deployment:
  needs:
    - osdu-gcp-containerize-gitlab
    - osdu-gcp-deploy-configmap
    - osdu-gcp-containerize-bootstrap-gitlab
  after_script:
    - echo ----- Verify Bootstrap -----
    - kubectl rollout status deployment.v1.apps/$OSDU_GCP_SERVICE-bootstrap -n $OSDU_GCP_HELM_NAMESPACE --timeout=900s
    - POD=$(kubectl get pod --sort-by=.metadata.creationTimestamp -n $OSDU_GCP_HELM_NAMESPACE | grep $OSDU_GCP_SERVICE-bootstrap | 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

# REFACTOR to common pipeline for DEV2
# osdu-gcp-dev2-deploy-deployment:
#   variables:
#     OSDU_GCP_BOOTSTRAP_NAMESPACE: config
#     OSDU_GCP_BOOTSTRAP_SERVICE_ACCOUNT: workload-gke-bootstrap-sa
#   needs:
#     - osdu-gcp-containerize-gitlab
#     - osdu-gcp-deploy-configmap
#     - osdu-gcp-containerize-bootstrap-schema
#   after_script:
#      - echo ----- Verify Bootstrap -----
#      - kubectl rollout status deployment.v1.apps/$OSDU_GCP_SERVICE-bootstrap -n $OSDU_GCP_HELM_NAMESPACE --timeout=900s
#      - POD=$(kubectl get pod --sort-by=.metadata.creationTimestamp -n $OSDU_GCP_HELM_NAMESPACE | grep $OSDU_GCP_SERVICE-bootstrap | 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

58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
osdu-gcp-test:
  script:
    - $MAVEN_BUILD . test-results.log verify -q -f testing/schema-test-core/pom.xml
  artifacts:
    when: always
    paths:
      - test-results.log
      - testing/schema-test-core/target/*/TEST-*.xml
    reports:
      junit:
        - testing/schema-test-core/target/*/TEST-*.xml

# FIXME for DEV2
osdu-gcp-dev2-test:
  script:
    - $MAVEN_BUILD . test-results.log verify -q -f testing/schema-test-core/pom.xml
  artifacts:
    when: always
    paths:
      - test-results.log
      - testing/schema-test-core/target/*/TEST-*.xml
    reports:
      junit:
        - testing/schema-test-core/target/*/TEST-*.xml

osdu-gcp-anthos-test:
  script:
    - $MAVEN_BUILD . test-results.log verify -q -f testing/schema-test-core/pom.xml
  artifacts:
    when: always
    paths:
      - test-results.log
      - testing/schema-test-core/target/*/TEST-*.xml
    reports:
      junit:
        - testing/schema-test-core/target/*/TEST-*.xml

95
96
97
98
99
100
101
102
103
104
105
106
107
osdu-gcp-containerize-bootstrap-gitlab:
  variables:
    BUILD_PATH: devops/$OSDU_GCP_VENDOR/bootstrap-osdu-module/Dockerfile

osdu-gcp-containerize-bootstrap-gcr:
  variables:
    BUILD_PATH: devops/$OSDU_GCP_VENDOR/bootstrap-osdu-module/Dockerfile

osdu-gcp-anthos-deploy-deployment:
  needs:
    - osdu-gcp-containerize-gitlab
    - osdu-gcp-containerize-bootstrap-gitlab
    - osdu-gcp-anthos-deploy-configmap