.gitlab-ci.yml 993 Bytes
Newer Older
vladislav's avatar
vladislav committed
1
2
3
4
5
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
36
default:
  image: python:3.6-slim-buster

variables:
  OSDU_API_LIBS_DIR: $CI_BUILDS_DIR
  CLOUD_PROVIDER: provider_test

stages:
  - test
  - deploy

test-libs:
  stage: test
  script:
    - pip install -r requirements.txt
    - pip install -r requirements-dev.txt
    - python -m pytest ./osdu_api/test/libs-unit-tests

test-providers-gcp:
  stage: test
  script:
    - pip install -r requirements.txt
    - pip install -r requirements-dev.txt
    - pip install -r ./osdu_api/test/providers-unit-tests/gcp/requirements.txt
    - python -m pytest ./osdu_api/test/providers-unit-tests/gcp

# This job only runs on master, and it creates the lib and push it to the feed
deploy:
  stage: deploy
  script:
    - pip install -r requirements.txt
    - 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