ibm-policy.yml 1.91 KB
Newer Older
1
2
3
4
5
6
7
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
58
59
60
61
62
63
.ibm:
  tags: ['osdu-medium']
  image: openshift/origin-cli
  environment:
    name: IBM

  variables:
    IBM_OPENSHIFT_PROJECT: og-cicd
    IBM_OPENSHIFT_PRESHIP_PROJECT: og-devops

  before_script:
    - oc login --token=$IBM_OPENSHIFT_TOKEN --server=$IBM_OPENSHIFT_URL

.ibm_variables:

  variables:
    # IBM Services
    ENTITLEMENTS_BASE_URL: $IBM_ENTITLEMENTS_BASE_URL
    ENTITLEMENTS_BASE_PATH: $IBM_ENTITLEMENTS_BASE_PATH
    LEGAL_BASE_URL: $IBM_LEGAL_BASE_URL
    OPA_URL: $IBM_OPA_URL

ibm-deploy:
  extends:
    - .ibm
    - .ibm_variables
  stage: deploy
  needs: ['compile-and-unit-test']
  script:
    - echo "In IBM deploy"
    - oc project $IBM_OPENSHIFT_PROJECT
    - oc get bc/$CI_PROJECT_NAME 2> /dev/null || oc new-build --name $CI_PROJECT_NAME --binary --strategy source --image-stream openshift/python:3.8
    - oc start-build $CI_PROJECT_NAME --from-dir=. --follow
    - oc get service $CI_PROJECT_NAME 2> /dev/null || oc new-app $CI_PROJECT_NAME
  only:
    variables:
      - $IBM == 'true'

#ibm-test:
#  stage: integration
#  image: python:3.8
#  needs: ["ibm-deploy"]
#  allow_failure: true
#  extends:
#    - .ibm_variables
#  script:
#    - pip install virtualenv
#    - virtualenv venv
#    - source venv/bin/activate
#    - pip install --upgrade pip
#    - pip install wheel pytest pytest-cov
#    - pip install -r requirements.txt
#    - pip install -r requirements_dev.txt
#    - svctoken=$(python devops/scripts/ibm_jwt_client.py)
#    - cd tests/integration
#    - python ./gen_postman_env.py --token ${svctoken} --base_url ${SERVICE_HOST_WELLBORE} --cloud_provider ${CLOUD_PROVIDER} --acl_domain ${ACL_DOMAIN} --legal_tag ${LEGAL_TAG} --data_partition ${DATA_PARTITION_ID}
#    - pytest ./functional --environment="./generated/postman_environment.json" --insecure --timeout-request=15000 --filter-tag=basic
#  only:
#    variables:
#      - $IBM == 'true'
#  except:
#    variables:
#      - $IBM_SKIP_TEST == 'true'