-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
37 lines (35 loc) · 937 Bytes
/
.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
35
36
37
stages:
- deploy
- renew
deploy:
stage: deploy
rules:
- if: '$RUN_DEPLOY == "true"'
tags:
- docker
image:
name: bitnami/kubectl:1.21
entrypoint: [""]
environment:
name: development
url: https://ray2021.k8s.pdis.dev
script:
- DOMAIN=$(echo "$CI_ENVIRONMENT_URL" | awk -F/ '{print $3}')
- sed -i "s,<DOMAIN>,$DOMAIN,g" .kubernetes.yml
- sed -i "s,<REPO_URL>,$REPO_URL,g" .kubernetes.yml
- kubectl create secret docker-registry gitlab
--docker-server=$CI_REGISTRY --docker-username=$REGISTRY_USER --docker-password=$REGISTRY_PASSWORD
--dry-run -o yaml | kubectl apply -f -
- kubectl apply -f .kubernetes.yml
renew:
stage: renew
tags:
- docker
image:
name: bitnami/kubectl:1.21
entrypoint: [""]
environment:
name: development
url: https://ray2021.k8s.pdis.dev
script:
- kubectl rollout restart deployment/ray2021 -n $KUBE_NAMESPACE