ibm-seismic-store-service.yml 2.13 KB
Newer Older
Anuj Gupta's avatar
Anuj Gupta committed
1
2
.ibm:
  tags: ['osdu-medium']
Daniel Perez's avatar
Daniel Perez committed
3
  image: openshift/origin-cli
Anuj Gupta's avatar
Anuj Gupta committed
4
5
6
7
8
9
  environment:
    name: IBM

  variables:
    IBM_OPENSHIFT_PROJECT: og-cicd

Daniel Perez's avatar
Daniel Perez committed
10
  before_script:
Anuj Gupta's avatar
Anuj Gupta committed
11
12
13
14
15
16
17
#    - mkdir -p "$IBM_DEPLOY_DIR"
    - oc login --token=$IBM_OPENSHIFT_TOKEN --server=$IBM_OPENSHIFT_URL

ibm-deploy:
  extends: .ibm
  stage: deploy
  needs: ['compile-and-unit-test']
Daniel Perez's avatar
Daniel Perez committed
18
  script:
Anuj Gupta's avatar
Anuj Gupta committed
19
    - echo "In IBM deploy"
Daniel Perez's avatar
Daniel Perez committed
20
    - oc project $IBM_OPENSHIFT_PROJECT
21
    - oc get bc/$CI_PROJECT_NAME 2> /dev/null || oc new-build --name $CI_PROJECT_NAME --binary --strategy source --image-stream openshift/nodejs:10-ubi8
Anuj Gupta's avatar
Anuj Gupta committed
22
23
    - oc start-build $CI_PROJECT_NAME --from-dir=. --follow
    - oc get service $CI_PROJECT_NAME 2> /dev/null || oc new-app $CI_PROJECT_NAME
Daniel Perez's avatar
Daniel Perez committed
24
25
26
  only:
    variables:
      - $IBM == 'true'
Anuj Gupta's avatar
Anuj Gupta committed
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
.ibm_variables:

  variables:
    # Services
    SEISMIC_HOST: $IBM_SEISMIC_HOST

    # common security
    KEYCLOAK_URL: $IBM_KEYCLOAK_URL
    KEYCLOAK_REALM: OSDU
    KEYCLOAK_CLIENT_ID: $IBM_KEYCLOAK_CLIENT_ID
    KEYCLOAK_CLIENT_SECRET: $IBM_KEYCLOAK_CLIENT_SECRET

    AUTH_USER_ACCESS: $IBM_AUTH_USER_ACCESS
    AUTH_USER_ACCESS_PASSWORD: $IBM_AUTH_USER_ACCESS_PASSWORD
ibm-test:
  tags: ["osdu-medium"]
Daniel Perez's avatar
Daniel Perez committed
43
44
  image: node
  stage: integration
Anuj Gupta's avatar
Anuj Gupta committed
45
46
  extends:
    - .ibm_variables
47
  allow_failure: false
Anuj Gupta's avatar
Anuj Gupta committed
48
  needs: ["ibm-deploy"]
Daniel Perez's avatar
Daniel Perez committed
49
  script:
Anuj Gupta's avatar
Anuj Gupta committed
50
51
52
53
54
55
56
57
    - apt-get update
    - apt-get install -y python
    - apt-get install -y python-pip
    - pip install requests
    - svctoken=$(python devops/scripts/ibm_jwt_client.py)
    - echo $svctoken
    - npm install -g newman
    - chmod +x ./tests/e2e/run_e2e_tests.sh
Walter D's avatar
Walter D committed
58
    - ./tests/e2e/run_e2e_tests.sh --seistore-svc-url="https://${SEISMIC_HOST}/api/v3" --seistore-svc-api-key="NA" --user-idtoken="$svctoken" --user1-idtoken="$svctoken" --tenant="${IBM_SEISMIC_E2E_TENANT}" --subproject="${IBM_SEISMIC_E2E_SUBPROJECT}" --admin-email="${IBM_SEISMIC_E2E_ADMIN_EMAIL}" --datapartition="${IBM_SEISMIC_E2E_DATA_PARTITION}" --legaltag01="${IBM_SEISMIC_E2E_LEGALTAG01}" --legaltag02="${IBM_SEISMIC_E2E_LEGALTAG02}" --subproject-long-name="${IBM_SEISMIC_E2E_SUBPROJECT_LONG_NAME}" --newuser="${IBM_SEISMIC_E2E_NEWUSER}" --VCS-Provider="gitlab"
Daniel Perez's avatar
Daniel Perez committed
59
60
  only:
    variables:
Anuj Gupta's avatar
Anuj Gupta committed
61
62
      - $IBM == 'true'