-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
48 lines (43 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
variables:
REGISTRY: registry.appunite.com
IMAGE_NAME: registry.appunite.com/appunite/absences-bot
before_script:
- export LANG=en_US.UTF-8
stages:
- test
- build
- deploy
tests:
image: norionomura/swift:501
stage: test
before_script:
- apt-get update
- apt-get install -y openssl libssl-dev
script:
- swift test
tags:
- k8s
docker:
image: docker:latest
stage: build
script:
- docker version
- docker build -t "$IMAGE_NAME:${CI_COMMIT_SHA:0:8}" -f Dockerfile .
- docker login -u admin -p $CI_BUILD_TOKEN $REGISTRY
- docker push "$IMAGE_NAME:${CI_COMMIT_SHA:0:8}"
tags:
- privileged
deploy:
stage: deploy
image: lwolf/kubectl_deployer:latest
environment:
name: staging
before_script:
- apk add --no-cache curl
script:
- kubectl config use-context gitlab-deploy
- kubectl set image deployment absences-production absences-production="$IMAGE_NAME:${CI_COMMIT_SHA:0:8}" --record
dependencies: []
tags:
- k8s
when: manual