Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
System
Schema
Commits
1d860ade
Commit
1d860ade
authored
Jun 04, 2021
by
Anuj Gupta
Browse files
Merge branch 'ibm_bootscrap_schema' into 'master'
Ibm bootstrap schema See merge request
!114
parents
a504c836
c5ba4519
Pipeline
#45856
passed with stages
in 22 minutes and 43 seconds
Changes
5
Pipelines
5
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
1d860ade
...
...
@@ -11,6 +11,8 @@ variables:
IBM_BUILD_SUBDIR
:
provider/schema-ibm
IBM_INT_TEST_SUBDIR
:
testing/schema-test-core
IBM_TEST_CMD
:
verify
IBM_DEPLOYMENTS_SUBDIR
:
deployments/scripts/ibm
IBM_DEPLOYMENTS_SCRIPTS_SUBDIR
:
deployments/scripts
AZURE_SERVICE
:
schema
AZURE_BUILD_SUBDIR
:
provider/schema-azure
...
...
@@ -65,6 +67,7 @@ include:
-
local
:
"
/devops/azure/gitlab-bootstrap.yml"
-
local
:
"
/devops/aws/bootstrap.yaml"
-
local
:
"
/devops/ibm/bootstrap.yaml"
osdu-gcp-test
:
image
:
maven:3.6.3-jdk-8
...
...
deployments/scripts/ibm/Token.py
0 → 100644
View file @
1d860ade
import
json
import
requests
import
http.client
import
os
;
class
IBMToken
(
object
):
def
get_ibm_id_token
(
self
):
url
=
'https://'
+
os
.
getenv
(
'IBM_KEYCLOAK_URL'
)
+
'/auth/realms/OSDU/protocol/openid-connect/token'
clientId
=
os
.
getenv
(
'IBM_KEYCLOAK_CLIENT_ID'
)
clientSecret
=
os
.
getenv
(
'IBM_KEYCLOAK_CLIENT_SECRET'
)
grantType
=
'password'
userName
=
os
.
getenv
(
'IBM_AUTH_USER_ACCESS'
)
password
=
os
.
getenv
(
'IBM_AUTH_USER_ACCESS_PASSWORD'
)
scope
=
'openid'
if
url
is
None
:
print
(
'Please pass url to generate token'
)
exit
(
1
)
if
clientId
is
None
:
print
(
'Please pass client id to generate token'
)
exit
(
1
)
if
clientSecret
is
None
:
print
(
'Please pass client secret to generate token'
)
exit
(
1
)
if
grantType
is
None
:
print
(
'Please pass client secret to generate token'
)
exit
(
1
)
if
userName
is
None
:
print
(
'Please pass client secret to generate token'
)
exit
(
1
)
if
password
is
None
:
print
(
'Please pass client secret to generate token'
)
exit
(
1
)
if
scope
is
None
:
print
(
'Please pass client secret to generate token'
)
exit
(
1
)
try
:
response
=
requests
.
post
(
url
,
data
=
{
"grant_type"
:
grantType
,
"client_id"
:
clientId
,
"client_secret"
:
clientSecret
,
"username"
:
userName
,
"password"
:
password
,
"scope"
:
scope
})
result
=
response
.
json
()
token
=
'Bearer '
+
result
[
'access_token'
]
print
(
token
)
except
Exception
as
e
:
print
(
e
)
if
__name__
==
'__main__'
:
IBMToken
().
get_ibm_id_token
()
deployments/scripts/ibm/bootstrap.sh
0 → 100644
View file @
1d860ade
export
IBM_SCHEMA_URL
=
$IBM_SCHEMA_HOST
/api/schema-service/v1/schema
BEARER_TOKEN
=
`
python
$IBM_DEPLOYMENTS_SUBDIR
/Token.py
`
export
BEARER_TOKEN
=
$BEARER_TOKEN
echo
$BEARER_TOKEN
python
$IBM_DEPLOYMENTS_SCRIPTS_SUBDIR
/DeploySharedSchemas.py
-u
$IBM_SCHEMA_URL
deployments/scripts/ibm/requirements.txt
0 → 100644
View file @
1d860ade
requests
devops/ibm/bootstrap.yaml
0 → 100644
View file @
1d860ade
ibm_bootstrap
:
stage
:
bootstrap
image
:
python:3.8
needs
:
[
"
ibm-deploy"
]
extends
:
-
.ibm_variables
script
:
-
pip install -r $IBM_DEPLOYMENTS_SUBDIR/requirements.txt
-
chmod +x $IBM_DEPLOYMENTS_SUBDIR/bootstrap.sh
-
$IBM_DEPLOYMENTS_SUBDIR/bootstrap.sh
only
:
variables
:
-
$IBM == 'true'
ibm-test
:
needs
:
[
"
ibm_bootstrap"
]
only
:
variables
:
-
$IBM == 'true'
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment