forked from terafin/mqtt-venstar-bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
43 lines (38 loc) · 2.31 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
# This file is a template, and might need editing before it works on your project.
# Official docker image.
image: docker:latest
services:
- docker:dind
build-master:
stage: build
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker push "$CI_REGISTRY_IMAGE"
only:
- master
build-master-docker:
stage: build
script:
- docker login -u "$DOCKER_REGISTRY_USER" -p "$DOCKER_REGISTRY_PASSWORD"
- docker build --pull -t "$DOCKER_REGISTRY_IMAGE" .
- docker push "$DOCKER_REGISTRY_IMAGE"
only:
- master
build:
stage: build
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
except:
- master
deploy:
stage: deploy
script:
- apk add --update curl
- curl -H "X-Docker-Token:$DOCKER_AUTH_TOKEN" -X GET "https://siliconspirit.net/hooks/docker-iot-update?DOCKER_SERVICE_NAME=automation_$CI_PROJECT_NAME-bedroom&DOCKER_IMAGE_PREFIX=$DOCKER_REGISTRY_USER&DOCKER_IMAGE_NAME=$CI_PROJECT_NAME&DOCKER_IMAGE_TAG=$DOCKER_IMAGE_TAG"
- curl -H "X-Docker-Token:$DOCKER_AUTH_TOKEN" -X GET "https://siliconspirit.net/hooks/docker-iot-update?DOCKER_SERVICE_NAME=automation_$CI_PROJECT_NAME-guest-bedroom&DOCKER_IMAGE_PREFIX=$DOCKER_REGISTRY_USER&DOCKER_IMAGE_NAME=$CI_PROJECT_NAME&DOCKER_IMAGE_TAG=$DOCKER_IMAGE_TAG"
- curl -H "X-Docker-Token:$DOCKER_AUTH_TOKEN" -X GET "https://siliconspirit.net/hooks/docker-iot-update?DOCKER_SERVICE_NAME=automation_$CI_PROJECT_NAME-entrance&DOCKER_IMAGE_PREFIX=$DOCKER_REGISTRY_USER&DOCKER_IMAGE_NAME=$CI_PROJECT_NAME&DOCKER_IMAGE_TAG=$DOCKER_IMAGE_TAG"
- curl -H "X-Docker-Token:$DOCKER_AUTH_TOKEN" -X GET "https://siliconspirit.net/hooks/docker-iot-update?DOCKER_SERVICE_NAME=automation_$CI_PROJECT_NAME-living-room&DOCKER_IMAGE_PREFIX=$DOCKER_REGISTRY_USER&DOCKER_IMAGE_NAME=$CI_PROJECT_NAME&DOCKER_IMAGE_TAG=$DOCKER_IMAGE_TAG"
- curl -H "X-Docker-Token:$DOCKER_AUTH_TOKEN" -X GET "https://siliconspirit.net/hooks/docker-iot-update?DOCKER_SERVICE_NAME=automation_$CI_PROJECT_NAME-study&DOCKER_IMAGE_PREFIX=$DOCKER_REGISTRY_USER&DOCKER_IMAGE_NAME=$CI_PROJECT_NAME&DOCKER_IMAGE_TAG=$DOCKER_IMAGE_TAG"