-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
39 lines (33 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
image: docker
services:
- docker:dind
build-staging:
stage: build
only:
- development
script:
- docker login registry.cscloud.ir
- docker-compose -f docker-compose-staging.yml build --force-rm
- docker push $REGISTRY_URL/$GROUP_NAME/$STACK_BUILD:staging
# build-production:
# stage: build
# only:
# - master
# script:
# - docker login registry.cscloud.ir
# - docker-compose -f docker-compose-prod.yml build --force-rm
# - docker push $REGISTRY_URL/$GROUP_NAME/$STACK_BUILD:production
deploy-staging:
stage: deploy
only:
- development
script:
- docker stack deploy --prune -c docker-compose-staging.yml $STACK_STAGING --with-registry-auth
- docker service update --force "$STACK_STAGING"_"$SERVICE1"
# deploy-production:
# stage: deploy
# only:
# - master
# script:
# - docker stack deploy --prune -c docker-compose-prod.yml $STACK_PRODUCTION --with-registry-auth
# - docker service update --force "$STACK_PRODUCTION"_"$SERVICE1"