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
Domain Data Mgmt Services
Wellbore
Wellbore Domain Services
Commits
e5ab3d3b
Commit
e5ab3d3b
authored
Mar 30, 2021
by
Yunhua Koglin
Browse files
test aws cicd
parent
d02eb4ab
Pipeline
#34011
failed with stages
in 7 minutes
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
e5ab3d3b
...
...
@@ -15,15 +15,15 @@
variables
:
PIP_REQUIREMENTS
:
"
requirements.txt
requirements_dev.txt"
OSDU_GCP_APPLICATION_NAME
:
wellbore-ddms
OSDU_GCP_VENDOR
:
gcp
#
OSDU_GCP_APPLICATION_NAME: wellbore-ddms
#
OSDU_GCP_VENDOR: gcp
AZURE_SERVICE
:
wellbore-ddms
AZURE_DOCKER_SUBDIR
:
build/Dockerfile
AZURE_TEST_SUBDIR
:
tests/integration
AZURE_TEST_TYPE
:
python
#
AZURE_SERVICE: wellbore-ddms
#
AZURE_DOCKER_SUBDIR: build/Dockerfile
#
AZURE_TEST_SUBDIR: tests/integration
#
AZURE_TEST_TYPE: python
AWS_SERVICE
:
wellbore-d
omain-service
s
AWS_SERVICE
:
wellbore-d
dm
s
AWS_ENVIRONMENT
:
dev
AWS_BUILD_SUBDIR
:
provider/os-wellbore-ddms-aws/build-aws
AWS_TEST_SUBDIR
:
tests/aws-test
...
...
@@ -41,13 +41,13 @@ include:
-
project
:
"
osdu/platform/ci-cd-pipelines"
file
:
"
scanners/gitlab-ultimate.yml"
-
project
:
'
osdu/platform/ci-cd-pipelines'
file
:
'
cloud-providers/osdu-gcp-cloudrun.yml'
#
- project: 'osdu/platform/ci-cd-pipelines'
#
file: 'cloud-providers/osdu-gcp-cloudrun.yml'
-
project
:
'
osdu/platform/ci-cd-pipelines'
file
:
'
cloud-providers/ibm-wellbore.yml'
#
- project: 'osdu/platform/ci-cd-pipelines'
#
file: 'cloud-providers/ibm-wellbore.yml'
-
local
:
"
/devops/azure/azure-wellbore.yml"
#
- local: "/devops/azure/azure-wellbore.yml"
-
project
:
'
osdu/platform/ci-cd-pipelines'
file
:
'
cloud-providers/aws.yml'
...
...
@@ -86,58 +86,58 @@ containerize:
-
docker push $IMAGE_TAG
-
docker push $CI_REGISTRY_IMAGE:latest
osdu-gcp-containerize
:
script
:
-
gcloud auth activate-service-account --key-file $OSDU_GCP_DEPLOY_FILE
-
gcloud config set project $OSDU_GCP_PROJECT
-
touch .gcloudignore
-
docker build -t gcr.io/$OSDU_GCP_PROJECT/$OSDU_GCP_APPLICATION_NAME/$OSDU_GCP_APPLICATION_NAME-$OSDU_GCP_VENDOR:$CI_COMMIT_SHORT_SHA --rm . -f ./build/Dockerfile
-
gcloud docker -- push gcr.io/$OSDU_GCP_PROJECT/$OSDU_GCP_APPLICATION_NAME/$OSDU_GCP_APPLICATION_NAME-$OSDU_GCP_VENDOR:$CI_COMMIT_SHORT_SHA
cache
:
{
}
tags
:
[
'
osdu-medium'
]
osdu-gcp-deploy
:
image
:
gcr.io/google.com/cloudsdktool/cloud-sdk
needs
:
[
"
osdu-gcp-containerize"
]
stage
:
deploy
variables
:
OSDU_GCP_PROJECT
:
nice-etching-277309
script
:
-
gcloud auth activate-service-account --key-file $OSDU_GCP_DEPLOY_FILE
-
gcloud config set project $OSDU_GCP_PROJECT
-
gcloud container clusters get-credentials wb --zone us-central1-c --project $OSDU_GCP_PROJECT
-
curl https://get.helm.sh/helm-v3.5.2-linux-amd64.tar.gz -s -o helm.tgz; tar -zxf helm.tgz; mv linux-amd64/helm /usr/local/bin/
-
>
helm upgrade wellbore devops/gcp
--install
--create-namespace
--namespace=wellbore
--wait
--set image.repository=gcr.io/$OSDU_GCP_PROJECT/$OSDU_GCP_APPLICATION_NAME/$OSDU_GCP_APPLICATION_NAME-$OSDU_GCP_VENDOR
--set image.tag=$CI_COMMIT_SHORT_SHA
--set secret.gcpSA=$OS_WELLBORE_DDMS_DATA_PROJECT_CREDENTIALS
-
status_code=$(curl -X GET --write-out '%{http_code}' --silent --output /dev/null https://wddms.osdu-gcp.go3-nrg.projects.epam.com/api/os-wellbore-ddms/healthz)
-
if [[ "$status_code" -ne 200 ]] ; then echo exit 1 ; else echo health check OK! ; fi
osdu-gcp-test-python
:
image
:
gcr.io/google.com/cloudsdktool/cloud-sdk
variables
:
OSDU_GCP_WELLBORE_DDMS_URL
:
https://wddms.osdu-gcp.go3-nrg.projects.epam.com/api/os-wellbore-ddms
script
:
-
apt-get install -y python3-venv
-
python3 -m venv env
-
source env/bin/activate
-
pip install --upgrade pip
-
pip install wheel pytest pytest-cov
-
pip install -r requirements.txt
-
pip install -r requirements_dev.txt
-
cd tests/integration
-
echo $OSDU_GCP_INTEGRATION_TESTER | base64 -d > file.json
-
gcloud auth activate-service-account --key-file file.json
-
gcloud config set project $OSDU_GCP_PROJECT
-
python gen_postman_env.py --token $(gcloud auth print-identity-token) --base_url $OSDU_GCP_WELLBORE_DDMS_URL --cloud_provider $OSDU_GCP_VENDOR --data_partition $OSDU_TENANT --acl_domain $DOMAIN --legal_tag $LEGAL_TAG
-
pytest ./functional --environment="./generated/postman_environment.json" --filter-tag=basic
allow_failure
:
true
osdu-gcp-test
:
extends
:
[]
#
osdu-gcp-containerize:
#
script:
#
- gcloud auth activate-service-account --key-file $OSDU_GCP_DEPLOY_FILE
#
- gcloud config set project $OSDU_GCP_PROJECT
#
- touch .gcloudignore
#
- docker build -t gcr.io/$OSDU_GCP_PROJECT/$OSDU_GCP_APPLICATION_NAME/$OSDU_GCP_APPLICATION_NAME-$OSDU_GCP_VENDOR:$CI_COMMIT_SHORT_SHA --rm . -f ./build/Dockerfile
#
- gcloud docker -- push gcr.io/$OSDU_GCP_PROJECT/$OSDU_GCP_APPLICATION_NAME/$OSDU_GCP_APPLICATION_NAME-$OSDU_GCP_VENDOR:$CI_COMMIT_SHORT_SHA
#
cache: { }
#
tags: [ 'osdu-medium' ]
#
osdu-gcp-deploy:
#
image: gcr.io/google.com/cloudsdktool/cloud-sdk
#
needs: ["osdu-gcp-containerize"]
#
stage: deploy
#
variables:
#
OSDU_GCP_PROJECT: nice-etching-277309
#
script:
#
- gcloud auth activate-service-account --key-file $OSDU_GCP_DEPLOY_FILE
#
- gcloud config set project $OSDU_GCP_PROJECT
#
- gcloud container clusters get-credentials wb --zone us-central1-c --project $OSDU_GCP_PROJECT
#
- curl https://get.helm.sh/helm-v3.5.2-linux-amd64.tar.gz -s -o helm.tgz; tar -zxf helm.tgz; mv linux-amd64/helm /usr/local/bin/
#
- >
#
helm upgrade wellbore devops/gcp
#
--install
#
--create-namespace
#
--namespace=wellbore
#
--wait
#
--set image.repository=gcr.io/$OSDU_GCP_PROJECT/$OSDU_GCP_APPLICATION_NAME/$OSDU_GCP_APPLICATION_NAME-$OSDU_GCP_VENDOR
#
--set image.tag=$CI_COMMIT_SHORT_SHA
#
--set secret.gcpSA=$OS_WELLBORE_DDMS_DATA_PROJECT_CREDENTIALS
#
- status_code=$(curl -X GET --write-out '%{http_code}' --silent --output /dev/null https://wddms.osdu-gcp.go3-nrg.projects.epam.com/api/os-wellbore-ddms/healthz)
#
- if [[ "$status_code" -ne 200 ]] ; then echo exit 1 ; else echo health check OK! ; fi
#
osdu-gcp-test-python:
#
image: gcr.io/google.com/cloudsdktool/cloud-sdk
#
variables:
#
OSDU_GCP_WELLBORE_DDMS_URL: https://wddms.osdu-gcp.go3-nrg.projects.epam.com/api/os-wellbore-ddms
#
script:
#
- apt-get install -y python3-venv
#
- python3 -m venv env
#
- source env/bin/activate
#
- pip install --upgrade pip
#
- pip install wheel pytest pytest-cov
#
- pip install -r requirements.txt
#
- pip install -r requirements_dev.txt
#
- cd tests/integration
#
- echo $OSDU_GCP_INTEGRATION_TESTER | base64 -d > file.json
#
- gcloud auth activate-service-account --key-file file.json
#
- gcloud config set project $OSDU_GCP_PROJECT
#
- python gen_postman_env.py --token $(gcloud auth print-identity-token) --base_url $OSDU_GCP_WELLBORE_DDMS_URL --cloud_provider $OSDU_GCP_VENDOR --data_partition $OSDU_TENANT --acl_domain $DOMAIN --legal_tag $LEGAL_TAG
#
- pytest ./functional --environment="./generated/postman_environment.json" --filter-tag=basic
#
allow_failure: true
#
osdu-gcp-test:
#
extends: []
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