EOX GitLab Instance

.gitlab-ci.yml 1.34 KB
Newer Older
1
2
stages:
  - test
3
  - publish
Nikola Jankovic's avatar
Nikola Jankovic committed
4
  - chart
5

Fabian Schindler's avatar
Fabian Schindler committed
6
7
8
variables:
  DOCKER_TLS_CERTDIR: ""

9
10
11
12
test:
  image: python:3.8-slim
  stage: test
  script:
Nikola Jankovic's avatar
Nikola Jankovic committed
13
    - python3 setup.py install
Nikola Jankovic's avatar
Nikola Jankovic committed
14
    - pip3 install -r requirements.txt
15
    - pip3 install -r requirements-test.txt
16
    - pip3 install -r requirements-dev.txt
Nikola Jankovic's avatar
Nikola Jankovic committed
17
18
    - flake8
    - mypy .
19
    - pytest --cov harvester --cov-report term-missing
20

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

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

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