-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
29 lines (28 loc) · 1013 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
build-docker:
image: docker:stable
services:
- docker:dind
only:
- master
stage: build-docker
script:
- docker login -u $CI_DEPLOY_USER -p $CI_DEPLOY_PASSWORD $CI_REGISTRY
- docker build . -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
deploy:
stage: deploy
image:
name: dtzar/helm-kubectl:latest
script:
- kubectl config get-contexts
- kubectl config use-context ivaoth/kube-agent:primary-agent
- kubectl config set-context --current --namespace=ivaoth-discord-bot-production
- kubectl create secret docker-registry gitlab-registry --docker-server="$CI_REGISTRY" --docker-username="$CI_DEPLOY_USER" --docker-password="$CI_DEPLOY_PASSWORD" --docker-email="$GITLAB_USER_EMAIL" -o yaml --dry-run=client | kubectl apply -f -
- helm upgrade --install ivaoth-discord-bot ./helm/ -f $VALUES_YAML --set image.tag=$CI_COMMIT_SHA
environment:
name: production
only:
- master
stages:
- build-docker
- deploy