.gitlab-ci.yml 1.34 KB
Newer Older
Luc Yriarte's avatar
Luc Yriarte committed
1
2
3
default:
  image: python:3.7-slim-buster

Luc Yriarte's avatar
Luc Yriarte committed
4
5
6
7
8

include:
  - project: "osdu/platform/domain-data-mgmt-services/wellbore/lib/lib-registry"
    file: "registry-setup.yml"

Luc Yriarte's avatar
Luc Yriarte committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
stages:
  - test
  - deploy

build:
  stage: test
  script:
    - echo ---- ---- ---- SYSTEM DEPENDENCIES ---- ---- ----
    - apt update
    - apt install -y --no-install-recommends git
    - echo ---- ---- ---- BUILD IMAGE ---- ---- ----
    - pip3 install -r requirements.txt
    - pip3 install -r requirements_opengroup.txt
    - pip3 install -r requirements_dev.txt
Luc Yriarte's avatar
Luc Yriarte committed
23
    - echo ---- ---- ---- UNIT TESTS ---- ---- ----
Luc Yriarte's avatar
Luc Yriarte committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
    - pytest tests --junitxml=report.xml
  artifacts:
    when: always
    reports:
      junit: report.xml

# This job only runs on master, and it creates the lib and push it to the feed
deploylib:
  stage: deploy
  script:
    - echo ---- ---- ---- SYSTEM DEPENDENCIES ---- ---- ----
    - apt update
    - apt install -y --no-install-recommends git
    - echo ---- ---- ---- BUILD IMAGE ---- ---- ----
    - pip3 install -r requirements.txt
    - pip3 install -r requirements_opengroup.txt
    - pip3 install twine
    - python3 setup.py sdist bdist_wheel
Luc Yriarte's avatar
Luc Yriarte committed
42
    - TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=${CI_REGISTRY_USER} python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${WDMS_LIB_REGISTRY}/packages/pypi dist/*
Luc Yriarte's avatar
Luc Yriarte committed
43
44
  rules:
    - if: $CI_COMMIT_BRANCH == 'master'