.gitlab-ci.yml 877 Bytes
Newer Older
1
2
3
4
5
variables:
  BUILD_TAG: $CI_COMMIT_TAG
  BUILD_COMMIT_SHORT_SHA: $CI_COMMIT_SHORT_SHA
  BUILD_ID: $CI_PIPELINE_IID

Siarhei Khaletski (EPAM)'s avatar
Siarhei Khaletski (EPAM) committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
default:
  image: python:3.6-slim-buster

stages:
  - linters
  - 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}

isort:
  allow_failure: true
  stage: linters
  script:
    - python -m pip install setuptools isort
    - isort -c -v osdu_airflow/*/*.py || EXIT_CODE=$?
    - exit ${EXIT_CODE}

deploy:
  stage: deploy
  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/*
  when: manual