EOX GitLab Instance

.gitlab-ci.yml 2.33 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

variables:
  DOCKER_TLS_CERTDIR: ""
Bernhard Mallinger's avatar
.    
Bernhard Mallinger committed
8
  SERVICE_NAME: "vs-scheduler"
Nikola Jankovic's avatar
Nikola Jankovic committed
9

Bernhard Mallinger's avatar
.    
Bernhard Mallinger committed
10
11
integration_test:
  image: devth/helm:v3.6.3
Nikola Jankovic's avatar
Nikola Jankovic committed
12
13
  stage: test
  script:
Bernhard Mallinger's avatar
.    
Bernhard Mallinger committed
14
    - wget https://github.com/mikefarah/yq/releases/download/v4.14.2/yq_linux_amd64.tar.gz -O - | tar xvfz - && chmod +x yq_linux_amd64
Bernhard Mallinger's avatar
.    
Bernhard Mallinger committed
15
16
    - export SERVICE_NAME=postgresql  # for testing
    - export CI_COMMIT_TAG=10.12.1  # for testing
Bernhard Mallinger's avatar
.    
Bernhard Mallinger committed
17
    - export BRANCH_NAME="auto-update-${SERVICE_NAME}-${CI_COMMIT_TAG}"
Bernhard Mallinger's avatar
.    
Bernhard Mallinger committed
18
19
20
    - git config --global user.email "gitlab@eox.at"
    - git config --global user.name "gitlab"
    - git clone https://${VS_DEPLOYMENT_GIT_REPOSITORY_CREDENTIALS}@gitlab.eox.at/vs/vs-deployment.git
Bernhard Mallinger's avatar
.    
Bernhard Mallinger committed
21
    - cd vs-deployment
Bernhard Mallinger's avatar
.    
Bernhard Mallinger committed
22
    - git switch -c "${BRANCH_NAME}"
Bernhard Mallinger's avatar
.    
Bernhard Mallinger committed
23
24
25
26
27
    - cat Chart.yaml
    - ../yq_linux_amd64 eval "( .dependencies[] | select(.name == \"${SERVICE_NAME}\") | .version ) = \"${CI_COMMIT_TAG}\"" -i Chart.yaml
    - cat Chart.yaml
    - helm dependency update
    - git commit --all -m "Bump ${SERVICE_NAME} to ${CI_COMMIT_TAG}"
Bernhard Mallinger's avatar
.    
Bernhard Mallinger committed
28
    - git push --set-upstream origin "${BRANCH_NAME}"
Nikola Jankovic's avatar
Nikola Jankovic committed
29

Nikola Jankovic's avatar
Nikola Jankovic committed
30

Bernhard Mallinger's avatar
.    
Bernhard Mallinger committed
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#test:
#  image: python:3.8-slim
#  stage: test
#  script:
#    - python3 setup.py install
#    - pip3 install -r requirements-test.txt
#    - pip3 install -r requirements-dev.txt
#    - pytest --cov scheduler --cov-report term-missing
#    - flake8
#    - mypy .
#
#publish_latest:
#  image: docker:20.10.8
#  services:
#    - docker:20.10.8-dind
#  stage: publish
#  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
#  only:
#    - master
#
#publish:
#  image: docker:20.10.8
#  services:
#    - docker:20.10.8-dind
#  stage: publish
#  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:$CI_COMMIT_TAG .
#    - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
#  only:
#    - 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