-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
48 lines (41 loc) · 1.13 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:
GIT_SUBMODULE_STRATEGY: recursive
DOCKER_IMAGE: registry.git.rwth-aachen.de/acs/public/villas/documentation
DOCKER_TAG: ${CI_COMMIT_REF_NAME}
stages:
- prepare
- build
- deploy
# Stage: prepare
prepare:image-dev:
stage: prepare
before_script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
script:
- docker build --target dev --tag ${DOCKER_IMAGE}:dev --tag ${DOCKER_IMAGE}:${DOCKER_TAG}-dev .
tags:
- docker-image-builder
# Stage: build
build:image:
stage: build
before_script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
script:
- docker build --tag ${DOCKER_IMAGE}:${DOCKER_TAG} --tag ${DOCKER_IMAGE}:latest .
tags:
- docker-image-builder
# Stage: deploy
deploy:kubernetes:
stage: deploy
variables:
KUBECONFIG: /root/.kube/config
image: registry.git.rwth-aachen.de/acs/internal/cloud/kubernetes/deployment
before_script:
- mkdir -p $(dirname ${KUBECONFIG})
- echo "${KUBECONFIG_ENCODED}" | base64 -d > ${KUBECONFIG}
- kubectl version
script:
- make deploy
only:
refs:
- master