bootstrap.yml 1.67 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
osdu_gcp_bootstrap:
  stage: bootstrap
  image: gcr.io/google.com/cloudsdktool/cloud-sdk
  needs: ["osdu-gcp-deploy"]
  extends:
    - .osdu-gcp-variables
  variables:
    WKS_KIND: $OSDU_GCP_WKS_MAPPING
    WKS_NAMESPACE: $OSDU_TENANT
    WKS_TENANT: $OSDU_TENANT
    WKS_BUCKET: $OSDU_GCP_WKS_BUCKET
  script:
Rustam Lotsmanenko (EPAM)'s avatar
Rustam Lotsmanenko (EPAM) committed
13
    - apt install python3-dev
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
    - gcloud auth activate-service-account --key-file $OSDU_GCP_DEPLOY_FILE
    - gcloud config set project $OSDU_GCP_PROJECT
    - export GOOGLE_APPLICATION_CREDENTIALS=$OSDU_GCP_DEPLOY_FILE
    - pip install -r $OSDU_GCP_DEPLOYMENTS_SUBDIR/requirements.txt
    - python3 $OSDU_GCP_DEPLOYMENTS_SUBDIR/deploy_mappings.py
    - python3 $OSDU_GCP_DEPLOYMENTS_SUBDIR/deploy_mapping_info_records.py
  only:
    variables:
      - $OSDU_GCP == 'true'

osdu-gcp-test:
  needs: ["osdu_gcp_bootstrap"]
  only:
    variables:
      - $OSDU_GCP == 'true'
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

osdu-gcp-containerize-bootstrap-gitlab:
  stage: containerize
  image: docker:19.03.15
  tags: ["osdu-medium"]
  services:
    - docker:20.10.7-dind
  script:
    - export EXTRA_DOCKER_TAG=""; if [ "$CI_COMMIT_TAG" != "" ] ; then EXTRA_DOCKER_TAG="-t $CI_REGISTRY_IMAGE/osdu-gcp-bootstrap:$CI_COMMIT_TAG" ; elif [ "$CI_COMMIT_REF_NAME" = "master" ] ; then EXTRA_DOCKER_TAG="-t $CI_REGISTRY_IMAGE/osdu-gcp-bootstrap:latest" ; fi
    - docker build -t $CI_REGISTRY_IMAGE/osdu-gcp-bootstrap:$CI_COMMIT_SHORT_SHA $EXTRA_DOCKER_TAG --file devops/$OSDU_GCP_VENDOR/Dockerfile .
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - docker push $CI_REGISTRY_IMAGE/osdu-gcp-bootstrap
  only:
    refs:
      - master
      - /.*bootstrap.*/
      - tags
    variables:
      - $OSDU_GCP == 'true'