Commit 261e9099 authored by Yan Sushchynski (EPAM)'s avatar Yan Sushchynski (EPAM)
Browse files

GONRG-3783: Common pipeline for osdu-*

parent 3d23030e
Pipeline #82383 passed with stages
in 1 minute and 55 seconds
variables:
BUILD_TAG: $CI_COMMIT_TAG
BUILD_COMMIT_SHORT_SHA: $CI_COMMIT_SHORT_SHA
BUILD_ID: $CI_PIPELINE_IID
include:
- project: "osdu/platform/ci-cd-pipelines"
ref: "master"
file: "build/python-linters.yml"
default:
image: python:3.6-slim-buster
- project: "osdu/platform/ci-cd-pipelines"
ref: "master"
file: "build/python-package.yml"
stages:
- linters
......@@ -13,19 +14,17 @@ stages:
- deploy
pylint:
stage: linters
allow_failure: true
script:
- python -m pip install setuptools pylint pylint_quotes pylint-exit
- pylint --rcfile=.pylintrc osdu_airflow/*/*.py || EXIT_CODE=$?
- exit ${EXIT_CODE}
variables:
SRC_FILES: "osdu_airflow/*/*.py"
isort:
allow_failure: true
stage: linters
variables:
SRC_FILES: "osdu_airflow/*/*.py"
.unit_tests_airflow:
script:
- python -m pip install setuptools isort
- isort -c -v osdu_airflow/*/*.py || EXIT_CODE=$?
- pip install -r requirements-dev.txt
- sh -c "./osdu_airflow/tests/./unit_tests.sh" || EXIT_CODE=$?
- exit ${EXIT_CODE}
unit_tests_airflow_v1:
......@@ -33,40 +32,25 @@ unit_tests_airflow_v1:
image:
name: apache/airflow:1.10.14-python3.6
entrypoint: [""]
script:
- pip install -r requirements-dev.txt
- sh -c "./osdu_airflow/tests/./unit_tests.sh" || EXIT_CODE=$?
- exit ${EXIT_CODE}
extends: .unit_tests_airflow
unit_tests_airflow_v2:
stage: unit_tests
image:
name: apache/airflow:2.1.2-python3.8
entrypoint: [""]
script:
- pip install -r requirements-dev.txt
- sh -c "./osdu_airflow/tests/./unit_tests.sh" || EXIT_CODE=$?
- exit ${EXIT_CODE}
extends: .unit_tests_airflow
publish:
publish-package:
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/* > 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
variables:
LIB_NAME: osdu_airflow
.gcp-deploy-composer-env:
image: gcr.io/google.com/cloudsdktool/cloud-sdk
stage: deploy
dependencies:
- publish
- publish-package
script:
- cat published_version.txt
- export LIB_VERSION=$(cat published_version.txt)
......
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