EOX GitLab Instance

.gitlab-ci.yml 1.34 KB
Newer Older
Nikola Jankovic's avatar
Nikola Jankovic committed
1
2
stages:
  - test
Nikola Jankovic's avatar
Nikola Jankovic committed
3
  - publish
Nikola Jankovic's avatar
Nikola Jankovic committed
4
  - chart
Nikola Jankovic's avatar
Nikola Jankovic committed
5
6
7
8
9
10
11
12
13
14

variables:
  DOCKER_TLS_CERTDIR: ""

test:
  image: python:3.8-slim
  stage: test
  script:
    - python3 setup.py install
    - pip3 install -r requirements-test.txt
Bernhard Mallinger's avatar
Bernhard Mallinger committed
15
    - pip3 install -r requirements-dev.txt
16
    - pytest --cov scheduler --cov-report term-missing
Bernhard Mallinger's avatar
Bernhard Mallinger committed
17
18
    - flake8
    - mypy .
Nikola Jankovic's avatar
Nikola Jankovic committed
19
  coverage: "/TOTAL.+ ([0-9]{1,3}%)/"
Nikola Jankovic's avatar
Nikola Jankovic committed
20

Nikola Jankovic's avatar
Nikola Jankovic committed
21
publish_latest:
Nikola Jankovic's avatar
Nikola Jankovic committed
22
23
24
  image: docker:20.10.8
  services:
    - docker:20.10.8-dind
Nikola Jankovic's avatar
Nikola Jankovic committed
25
  stage: publish
Nikola Jankovic's avatar
Nikola Jankovic committed
26
27
28
29
  script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
    - docker build -t $CI_REGISTRY_IMAGE .
    - docker push $CI_REGISTRY_IMAGE:latest
Nikola Jankovic's avatar
Nikola Jankovic committed
30
31
  only:
    - master
Nikola Jankovic's avatar
Nikola Jankovic committed
32

Nikola Jankovic's avatar
Nikola Jankovic committed
33
publish:
Nikola Jankovic's avatar
Nikola Jankovic committed
34
35
36
  image: docker:20.10.8
  services:
    - docker:20.10.8-dind
Nikola Jankovic's avatar
Nikola Jankovic committed
37
  stage: publish
Nikola Jankovic's avatar
Nikola Jankovic committed
38
39
  script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
Nikola Jankovic's avatar
Nikola Jankovic committed
40
41
    - docker build --cache-from $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG .
    - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
Nikola Jankovic's avatar
Nikola Jankovic committed
42
43
  only:
    - tags
Nikola Jankovic's avatar
Nikola Jankovic committed
44
45
46
47
48
49
50
51
52
53

helm:
  image: devth/helm:v3.6.3
  stage: chart
  script:
    # push Helm chart
    - "upload_filename=$(helm package ./chart | sed 's/^Successfully packaged chart and saved it to: \\(.*\\)/\\1/')"
    - curl -u $HELM_CHART_REPOSITORY_CREDENTIALS -v -X POST https://charts-public.hub.eox.at/api/charts --data-binary "@${upload_filename}"
  only:
    - tags