-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
34 lines (31 loc) · 1.08 KB
/
.gitlab-ci.yml
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
stages:
- start
- deploy
- post
variables:
DOCKER_COMPOSE_PROJECT: ${CI_COMMIT_REF_SLUG}-${CI_JOB_ID}
before_script:
- rm /home/gitlab-runner/.docker/config.json || true
- docker-compose -p ${CI_COMMIT_REF_SLUG}-${CI_JOB_ID} down -v
k3s_helm3:
stage: start
variables:
DK: docker-compose -p ${CI_COMMIT_REF_SLUG}-${CI_JOB_ID}
DR: docker-compose -p ${CI_COMMIT_REF_SLUG}-${CI_JOB_ID} run client
script:
- ${DK} pull
- ${DK} up -d server
- sleep 10
- ${DR} kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml
- ${DR} kubectl label nodes --all pool=default
- ${DR} helm3 repo add stable https://kubernetes-charts.storage.googleapis.com
- ${DR} helm3 dependencies build noc/
- ${DR} helm3 upgrade --wait --timeout 1200s --install --debug --atomic noc noc --set image.tag=master-dev --set image.pullPolicy=Always
tags:
- shell
artifacts:
paths:
- kubeconfig.yaml
expire_in: 1 hours
after_script:
- docker-compose -p ${CI_COMMIT_REF_SLUG}-${CI_JOB_ID} down -v