Commit ef6cfca4 authored by Aleksandr Spivakov (EPAM)'s avatar Aleksandr Spivakov (EPAM)
Browse files

GONRG-3682 add deploy to composer step

parent a4f05895
Pipeline #77570 passed with stages
in 14 minutes and 56 seconds
......@@ -9,6 +9,7 @@ default:
stages:
- linters
- unit_tests
- publish
- deploy
pylint:
......@@ -47,10 +48,53 @@ unit_tests_airflow_v2:
- sh -c "./osdu_airflow/tests/./unit_tests.sh" || EXIT_CODE=$?
- exit ${EXIT_CODE}
deploy:
stage: deploy
publish:
stage: publish
script:
- pip install twine
- python setup.py sdist bdist_wheel
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/* > output.txt && cat output.txt
after_script:
- cat output.txt | grep 'Uploading ' | grep -Po '(?<=osdu_airflow-)[0-9.a-z_+\-]*(?=.tar.gz)' > published_version.txt
artifacts:
paths:
- published_version.txt
expire_in: 1 day
when: manual
.gcp-deploy-composer-env:
image: gcr.io/google.com/cloudsdktool/cloud-sdk
stage: deploy
dependencies:
- publish
script:
- cat published_version.txt
- export LIB_VERSION=$(cat published_version.txt)
- gcloud composer environments update $OSDU_GCP_ENV_VAR --location=us-central1 --update-pypi-package=osdu-airflow~=${LIB_VERSION%+*}
when: manual
.gcp-activate-sa-comm: &gcp-activate-sa-comm
- gcloud auth activate-service-account --key-file $OSDU_GCP_DEPLOY_FILE
.gcp-activate-sa-prod: &gcp-activate-sa-prod
- gcloud auth activate-service-account --key-file $OSDU_GCP_PROD_DEPLOY_FILE
gcp-deploy-composer-env-comm:
extends: .gcp-deploy-composer-env
variables:
OSDU_GCP_ENV_VAR: osdu-airflow
before_script:
- *gcp-activate-sa-comm
- gcloud config set project nice-etching-277309
except:
- /^release\/*/
gcp-deploy-composer-env-prod:
extends: .gcp-deploy-composer-env
variables:
OSDU_GCP_ENV_VAR: airflow-v2
before_script:
- *gcp-activate-sa-prod
- gcloud config set project osdu-service-prod
only:
- /^release\/*/
Markdown is supported
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