-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
79 lines (71 loc) · 1.91 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
stages:
- build
- test
- release
- deploy
variables:
ECR_HOME: 111111111111.dkr.ecr.us-west-2.amazonaws.com
TEST_IMAGE: $ECR_HOME/tartaruga:${CI_COMMIT_REF_NAME}_testing
RELEASE_IMAGE: $ECR_HOME/tartaruga:${CI_COMMIT_REF_NAME}
HOST_TEST: [email protected]
# HOST_PROD: [email protected]
before_script:
- (if cd ~/dockerutils; then git pull; else git clone -b merge https://github.com/tonylampada/dockerutils.git ~/dockerutils; fi)
- export PATH=$PATH:~/dockerutils/bin
- ldklogin.sh
build:
stage: build
tags: [shell]
script:
- docker build --pull -t $TEST_IMAGE .
- docker push $TEST_IMAGE
test_backend:
stage: test
tags: [shell]
script:
- docker pull $TEST_IMAGE
- ci/test_backend.sh
release-image:
stage: release
tags: [shell]
script:
- docker pull $TEST_IMAGE
- docker tag $TEST_IMAGE $RELEASE_IMAGE
- docker push $RELEASE_IMAGE
deploy-test:
stage: deploy
tags: [deploy]
environment:
name: tartaruga-test
url: https://test.tartaruga.com.br
script:
- export HOST=$HOST_TEST
- lupdateimg.sh "$HOST" tartaruga $CI_COMMIT_REF_NAME test
- lstopstart.sh tartaruga $CI_COMMIT_REF_NAME test web "-p 3000:3000"
deploy-front:
stage: deploy
tags: [deploy]
environment:
name: tartaruga-test
url: https://test.tartaruga.com.br
script:
- export HOST=$HOST_TEST
- lupdateimg.sh "$HOST" tartaruga $CI_COMMIT_REF_NAME test
- lstopstart.sh tartaruga $CI_COMMIT_REF_NAME test front "-p 3001:3000"
# deploy-prod:
# stage: deploy
# tags: [deploy]
# environment:
# name: tartaruga-prod
# url: https://app.tartaruga.com.br
# when:
# script:
# - export HOST=$HOST_PROD
# - lupdateimg.sh "$HOST" tartaruga $CI_COMMIT_REF_NAME prod
# - lstopstart.sh tartaruga $CI_COMMIT_REF_NAME prod web "-p 3000:3000"
# only:
# - master
# - dev
# - usergetuser
# - nopay2
# when: manual