-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
32 lines (28 loc) · 1 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
image: "docker:latest"
services:
- "docker:dind"
stages:
- build
- deploy
variables:
DOCKER_DRIVER: overlay
build:
only:
- master
script:
- "docker login -u gitlab-ci-token -p \"$CI_BUILD_TOKEN\" \"$CI_REGISTRY\""
- "docker build -t \"$CI_REGISTRY_IMAGE:latest\" ."
- "docker push \"$CI_REGISTRY_IMAGE:latest\""
stage: build
deploy:
image: alpine
only:
- master
script:
- "apk add --no-cache curl wget"
- "curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
- "chmod +x ./kubectl"
- "mv ./kubectl /usr/local/bin/kubectl"
- "wget --header \"Content-Type: application/json\" --header \"Authorization: Bearer $DIGITALOCEAN_TOKEN\" \"https://api.digitalocean.com/v2/kubernetes/clusters/e7e5e2f5-971e-4d09-8ed8-ac5c4c02be0d/kubeconfig\""
- "kubectl --kubeconfig=./kubeconfig rollout restart statefulset/magiccap-api"
stage: deploy