-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
31 lines (28 loc) · 957 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
30
31
# This file is a template, and might need editing before it works on your project.
# Official docker image.
image: docker:latest
services:
- docker:dind
before_script:
- docker login --username gitlab-ci-token --password $CI_BUILD_TOKEN registry.gitlab.com
after_script:
- docker logout registry.gitlab.com
build-master:
variables:
DOCKER_DRIVER: overlayfs
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
deploy_to_swarm:
variables:
DOCKER_DRIVER: overlay
stage: deploy
script:
- echo "$NETLIMY_TLSCACERT" > ~/.docker/ca.pem
- echo "$NETLIMY_TLSCERT" > ~/.docker/cert.pem
- echo "$NETLIMY_TLSKEY" > ~/.docker/key.pem
- docker --tlsverify -H tcp://$NETLIMY_SERVER_IP:2376 stack deploy --with-registry-auth --compose-file=./production.yml netlimy