Commit 6e796e97 authored by Daniel Perez's avatar Daniel Perez
Browse files

ci: removing ibm tests

parent dbbf66cd
Pipeline #86202 passed with stages
in 10 minutes and 35 seconds
.ibm:
tags: ['osdu-medium']
image: openshift/origin-cli
environment:
name: IBM
variables:
IBM_OPENSHIFT_PROJECT: og-cicd
IBM_OPENSHIFT_DEVPRI_PROJECT: og-cicd
before_script:
# - mkdir -p "$IBM_DEPLOY_DIR"
- oc login --token=$IBM_OPENSHIFT_TOKEN --server=$IBM_OPENSHIFT_URL
.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_TENANT_NAME: opendes
IBM_LEGAL_TAG: opendes-public-usa-dataset-1
IBM_TENANT_PROJECT: OpenDES_Project
IBM_COS_REGION: $IBM_COS_REGION
compile-and-unit-test-ibm:
tags: ["osdu-medium"]
stage: build
......@@ -46,23 +11,4 @@ compile-and-unit-test-ibm:
artifacts:
name: $(basename sdapi-*)-linux64
paths:
- sdapi-*/
ibm-gen-token-test:
extends:
- .ibm_variables
image: node
stage: build
script:
- apt-get update
- apt-get install -y python
- apt-get install -y python3-pip
- pip install requests
- svctoken=$(python3 devops/scripts/ibm_jwt_client.py)
- echo $svctoken > .token
artifacts:
paths:
- .token
only:
variables:
- $IBM == 'true'
\ No newline at end of file
- sdapi-*/
\ No newline at end of file
import os
import requests
import json
url = os.getenv('KEYCLOAK_URL')
client_id = os.getenv('KEYCLOAK_CLIENT_ID')
client_secret = os.getenv('KEYCLOAK_CLIENT_SECRET')
user = os.getenv('IBM_SEISMIC_AUTH_USER_ACCESS')
password = os.getenv('IBM_SEISMIC_AUTH_USER_ACCESS_PASSWORD')
payload = "grant_type=password&client_id="+client_id+"&client_secret="+client_secret+"&username="+user+"&password="+password+"&scope=openid"
headers = {
'Content-Type': "application/x-www-form-urlencoded"
}
full_url="https://"+url+"/auth/realms/OSDU/protocol/openid-connect/token"
response = requests.request("POST", full_url, data=payload, headers=headers)
result = response.json()
token = result['access_token']
print(token)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment