-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
executable file
·53 lines (50 loc) · 1.17 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
49
50
51
52
53
stages:
- deploy
variables:
NETWORK_NAME: br0
DOMAIN: theseedsquad.com
IMAGE_NAME: $DOMAIN/website:latest
CONTAINER_IP: 172.18.0.122
CONTAINER_NAME: theseedsquad-website
deploy-sandbox:
stage: deploy
only:
- develop
tags:
- apps
- sandbox
variables:
DOMAIN: sandbox.theseedsquad.com
before_script:
- docker build --build-arg="DOMAIN=$DOMAIN" --cache-from="$IMAGE_NAME" -t $IMAGE_NAME .
script:
- docker rm -f $CONTAINER_NAME || true
- docker run
--restart="always"
--network="$NETWORK_NAME"
--ip="$CONTAINER_IP"
--log-opt="max-size=20M"
--log-opt="max-file=5"
--name="$CONTAINER_NAME"
-e="DOMAIN=$DOMAIN"
-d $IMAGE_NAME
deploy-live:
stage: deploy
only:
- tags
tags:
- apps
- live
before_script:
- docker build --build-arg="DOMAIN=$DOMAIN" --cache-from="$IMAGE_NAME" -t $IMAGE_NAME .
script:
- docker rm -f $CONTAINER_NAME || true
- docker run
--restart="always"
--network="$NETWORK_NAME"
--ip="$CONTAINER_IP"
--log-opt="max-size=20M"
--log-opt="max-file=5"
--name="$CONTAINER_NAME"
-e="DOMAIN=$DOMAIN"
-d $IMAGE_NAME