-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
98 lines (85 loc) · 1.93 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_PROJECT_NAME
GIT_STRATEGY: clone
stages:
- build
- deploy
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
#### BUILD DEV ####
build_env_develop:
stage: build
script:
- chmod +x ./setup_env.sh
- ./setup_env.sh DEV
- docker build -t IMAGE_NAME:$TAG_IMAGE_DEV -f Dockerfile .
tags:
- NAME-frontend-develop
only:
- develop
#### DEPLOY DEV ####
deploy_env_develop:
variables:
GIT_STRATEGY: none
stage: deploy
script:
- docker push IMAGE_NAME:$TAG_IMAGE_DEV
- docker-compose -f .docker/docker-compose.yml up -d
tags:
- NAME-frontend-develop
only:
- develop
#### BUILD QA ####
build_env_qa:
stage: build
script:
- chmod +x ./setup_env.sh
- ./setup_env.sh QA
- docker build -t IMAGE_NAME:$TAG_IMAGE_QA -f Dockerfile .
- docker build -t IMAGE_NAME:$CI_COMMIT_SHORT_SHA -f Dockerfile .
tags:
- NAME-frontend-qa
only:
- qa
#### DEPLOY QA ####
deploy_env_qa:
variables:
GIT_STRATEGY: none
stage: deploy
script:
- docker push IMAGE_NAME:$TAG_IMAGE_QA
- docker push IMAGE_NAME:$CI_COMMIT_SHORT_SHA
- docker-compose -f .docker/docker-compose.yml up -d
tags:
- NAME-frontend-qa
only:
- qa
#### BUILD PROD ####
build_env_prod:
stage: build
script:
- chmod +x ./setup_env.sh
- ./setup_env.sh PROD
- docker build -t IMAGE_NAME:$TAG_IMAGE_PROD -f Dockerfile .
- docker build -t IMAGE_NAME:$CI_COMMIT_SHORT_SHA -f Dockerfile .
artifacts:
expire_in: 1 hour
paths:
- build
tags:
- NAME-frontend-production
only:
- main
#### DEPLOY PROD ####
deploy_env_prod:
variables:
GIT_STRATEGY: none
stage: deploy
script:
- docker push IMAGE_NAME:$TAG_IMAGE_PROD
- docker push IMAGE_NAME:$CI_COMMIT_SHORT_SHA
- docker-compose -f .docker/docker-compose.yml up -d
tags:
- NAME-frontend-production
only:
- main