Skip to content
GitLab
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
5217a3d9
Commit
5217a3d9
authored
Oct 22, 2020
by
Aman Verma
Committed by
Hema Vishnu Pola [Microsoft]
Oct 22, 2020
Browse files
adding yaml file for bootstrapping step for schema service
parent
2a8cc604
Changes
5
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
5217a3d9
...
...
@@ -17,6 +17,9 @@ variables:
AZURE_TEST_SUBDIR
:
testing/schema-test-core
AZURE_SKIP_TEST
:
'
true'
AZURE_DEPLOYMENTS_SUBDIR
:
deployments/scripts/azure
INTEGRATION_TESTER
:
$AZURE_PRINCIPAL_ID
AZURE_TESTER_SERVICEPRINCIPAL_SECRET
:
$AZURE_PRINCIPAL_SECRET
DATA_PARTITION
:
opendes
AZURE_STORAGE_CONNECTION_STRING
:
DefaultEndpointsProtocol=https;AccountName=${AZURE_BASE}data;AccountKey=${AZURE_STORAGE_KEY};EndpointSuffix=core.windows.net
...
...
@@ -60,6 +63,8 @@ include:
-
project
:
"
osdu/platform/ci-cd-pipelines"
ref
:
'
master'
file
:
'
cloud-providers/osdu-gcp-cloudrun.yml'
-
local
:
"
/devops/azure/bootstrap.yaml"
osdu-gcp-test
:
image
:
maven:3.3.9-jdk-8
...
...
deployments/scripts/azure/Token.py
View file @
5217a3d9
...
...
@@ -4,14 +4,10 @@ import msal
class
AzureToken
(
object
):
def
get_azure_id_token
(
self
):
tenant_id
=
os
.
getenv
(
'AZURE_
AD_
TENANT_ID'
)
resource_id
=
os
.
getenv
(
'AZURE_A
D_APP_RESOURCE
_ID'
)
tenant_id
=
os
.
getenv
(
'AZURE_TENANT_ID'
)
resource_id
=
os
.
getenv
(
'AZURE_A
PP
_ID'
)
client_id
=
os
.
getenv
(
'INTEGRATION_TESTER'
)
client_secret
=
os
.
getenv
(
'TESTER_SERVICEPRINCIPAL_SECRET'
)
authority_host_uri
=
'https://login.microsoftonline.com'
authority_uri
=
authority_host_uri
+
'/'
+
tenant_id
scopes
=
[
resource_id
+
'/.default'
]
client_secret
=
os
.
getenv
(
'AZURE_TESTER_SERVICEPRINCIPAL_SECRET'
)
if
tenant_id
is
None
:
print
(
'Please pass tenant Id to generate token'
)
...
...
@@ -27,6 +23,9 @@ class AzureToken(object):
exit
(
1
)
try
:
authority_host_uri
=
'https://login.microsoftonline.com'
authority_uri
=
authority_host_uri
+
'/'
+
tenant_id
scopes
=
[
resource_id
+
'/.default'
]
app
=
msal
.
ConfidentialClientApplication
(
client_id
=
client_id
,
authority
=
authority_uri
,
client_credential
=
client_secret
)
result
=
app
.
acquire_token_for_client
(
scopes
=
scopes
)
token
=
'Bearer '
+
result
.
get
(
'access_token'
)
...
...
deployments/scripts/azure/bootstrap.sh
0 → 100644
View file @
5217a3d9
export
AZURE_SCHEMA_URL
=
https://
$AZURE_DNS_NAME
/api/schema-service/v1/schema
BEARER_TOKEN
=
`
python
$AZURE_DEPLOYMENTS_SUBDIR
/Token.py
`
export
BEARER_TOKEN
=
$BEARER_TOKEN
python deployments/scripts/DeploySharedSchemas.py
-u
$AZURE_SCHEMA_URL
deployments/scripts/azure/requirements.txt
View file @
5217a3d9
os
msal
\ No newline at end of file
devops/azure/bootstrap.yaml
0 → 100644
View file @
5217a3d9
azure_bootstrap
:
stage
:
bootstrap
image
:
python:3.8
needs
:
[
"
azure_deploy"
]
script
:
-
pip install -r $AZURE_DEPLOYMENTS_SUBDIR/requirements.txt
-
chmod +x $AZURE_DEPLOYMENTS_SUBDIR/bootstrap.sh
-
$AZURE_DEPLOYMENTS_SUBDIR/bootstrap.sh
only
:
variables
:
-
$AZURE == 'true'
azure_test
:
needs
:
[
"
azure_bootstrap"
]
only
:
variables
:
-
$AZURE == 'true'
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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