EOX GitLab Instance

.gitlab-ci.yml 1.2 KB
Newer Older
Nikola Jankovic's avatar
Nikola Jankovic committed
1
2
3
stages:
  - test
  - deploy
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
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

variables:
  DOCKER_TLS_CERTDIR: ""

test:
  image: python:3.8-slim
  stage: test
  script:
    - python3 setup.py install
    - pip3 install -r requirements-test.txt
    - pytest

deploy_latest:
  image: docker:20.10.8
  services:
    - docker:20.10.8-dind
  stage: deploy
  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
  except:
    - tags

deploy:
  image: docker:20.10.8
  services:
    - docker:20.10.8-dind
  stage: deploy
  script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
    - docker build --cache-from $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE .
    - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
  only:
    - tags
Nikola Jankovic's avatar
Nikola Jankovic committed
40
41
42
43
44
45
46
47
48
49
50

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
    - master