bootstrap.yaml 3.11 KB
Newer Older
1
osdu-gcp-bootstrap:
2
3
  stage: bootstrap
  image: python:3.8
4
  needs: ["osdu-gcp-deploy-deployment"]
5
6
7
8
9
  extends:
    - .osdu-gcp-variables
  variables:
    JSON_KEY: $OSDU_GCP_INTEGRATION_TESTER
    AUDIENCE: $GOOGLE_AUDIENCE
10
    DATA_PARTITION: $OSDU_GCP_TENANT
11
12
  script:
    - pip install -r $OSDU_GCP_DEPLOYMENTS_SUBDIR/requirements.txt
13
    - pip install -r $OSDU_GCP_DEPLOYMENTS_SCRIPTS_SUBDIR/gcp-deployment-requirements.txt
14
    - export BEARER_TOKEN=$(python $OSDU_GCP_DEPLOYMENTS_SUBDIR/Token.py)
15
    - python $OSDU_GCP_DEPLOYMENTS_SCRIPTS_SUBDIR/DeploySharedSchemas.py -u $OSDU_GCP_SCHEMA_URL/schema
16
  rules:
17
18
19
20
    - if: '$OSDU_GCP == "true" && $CI_COMMIT_BRANCH =~ /^release/'
      when: never
    - if: '$OSDU_GCP == "true" && $CI_COMMIT_TAG'
      when: never
21
    - if: '$OSDU_GCP == "true"'
22
      when: on_success
23

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
osdu-gcp-bootstrap-dev2:
  stage: bootstrap
  image: python:3.8
  needs: ["osdu-gcp-dev2-deploy-deployment"]
  extends: .osdu-gcp-dev2-variables
  variables:
    JSON_KEY: $OSDU_GCP_INTEGRATION_TESTER
    AUDIENCE: $GOOGLE_AUDIENCE
    DATA_PARTITION: $OSDU_GCP_TENANT
  script:
    - pip install -r $OSDU_GCP_DEPLOYMENTS_SUBDIR/requirements.txt
    - pip install -r $OSDU_GCP_DEPLOYMENTS_SCRIPTS_SUBDIR/gcp-deployment-requirements.txt
    - export BEARER_TOKEN=$(python $OSDU_GCP_DEPLOYMENTS_SUBDIR/Token.py)
    - python $OSDU_GCP_DEPLOYMENTS_SCRIPTS_SUBDIR/DeploySharedSchemas.py -u $OSDU_GCP_SCHEMA_URL/schema
  rules:
39
    - if: '$OSDU_GCP == "true" && $CI_COMMIT_BRANCH =~ /^release/'
40
      when: on_success
Siarhei Symanovich (EPAM)'s avatar
Siarhei Symanovich (EPAM) committed
41
    - if: '$OSDU_GCP == "true" && $CI_COMMIT_TAG'
42
      when: on_success
43
44

osdu-gcp-test:
45
  needs: ["osdu-gcp-bootstrap"]
46
47
48
49
50
51
52
  # Rules should be deleted here after common pipeline is updated with this rules
  rules:
    - if: '$OSDU_GCP == "true" && $OSDU_GCP_INT_TEST_TYPE != "python" && $CI_COMMIT_BRANCH =~ /^release/'
      when: never
    - if: '$OSDU_GCP == "true" && $OSDU_GCP_INT_TEST_TYPE != "python" && $CI_COMMIT_TAG'
      when: never
    - if: '$OSDU_GCP == "true" && $OSDU_GCP_INT_TEST_TYPE != "python"'
53
      when: on_success
54
55
56

osdu-gcp-dev2-test:
  needs: ["osdu-gcp-bootstrap-dev2"]
57

58
osdu-gcp-containerize-bootstrap-schema:
59
60
61
  stage: containerize
  image: docker:19.03.15
  tags: ["osdu-medium"]
62
  needs: ["compile-and-unit-test"]
63
64
  services:
    - docker:20.10.7-dind
65
66
  variables:
    IMAGE_NAME: osdu-gcp-bootstrap-schema
67
  script:
68
69
    - export EXTRA_DOCKER_TAG=""; if [ "$CI_COMMIT_TAG" != "" ] ; then EXTRA_DOCKER_TAG="-t $CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_TAG" ; elif [ "$CI_COMMIT_REF_NAME" = "master" ] ; then EXTRA_DOCKER_TAG="-t $CI_REGISTRY_IMAGE/$IMAGE_NAME:latest" ; fi
    - docker build -t $CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA $EXTRA_DOCKER_TAG --file devops/$OSDU_GCP_VENDOR/bootstrap-osdu-module/Dockerfile .
70
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
71
    - docker push $CI_REGISTRY_IMAGE/$IMAGE_NAME
72
73
  rules:
    - if: '$OSDU_GCP == "true" && $CI_COMMIT_BRANCH =~ /^master$/'
74
      when: on_success
75
    - if: '$OSDU_GCP == "true" && $CI_COMMIT_BRANCH =~ /.*bootstrap.*/'
76
      when: on_success
77
    - if: '$OSDU_GCP == "true" && $CI_COMMIT_TAG'
78
      when: on_success