-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
45 lines (38 loc) · 1.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
image: docker
services:
- docker:dind
variables:
GIT_STRATEGY: none
stages:
- build
- deploy
before_script:
- apk add --no-cache git
- git clone https://github.com/EricssonResearch/oslc_prolog.git
- cd oslc_prolog
build_image:
stage: build
script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
- docker build -t "$CI_REGISTRY_IMAGE" .
- docker push "$CI_REGISTRY_IMAGE"
only:
- master
deploy_to_swarm:
stage: deploy
script:
- echo "$CI_REGISTRY_PASSWORD" | docker -H $SWARM_MANAGER login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
- docker -H $SWARM_MANAGER stack deploy -c docker-compose.yml --with-registry-auth oslc_stack
allow_failure: true
only:
- master
deploy_to_swarm_erdc:
stage: deploy
script:
- echo "$CI_REGISTRY_PASSWORD" | docker -H $SWARM_MANAGER_ERDC login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
- docker -H $SWARM_MANAGER_ERDC stack deploy -c docker-compose.yml --with-registry-auth oslc_stack
allow_failure: true
only:
- master
tags:
- erdc