-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
65 lines (59 loc) · 1.64 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
# This file is a template, and might need editing before it works on your project.
# Official docker image.
image: docker:latest
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
build-master:
stage: build
script:
- docker build --rm -t "$CI_REGISTRY_IMAGE" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA" --build-arg BASE_API=https://api.snapp.market/mobile/v2 --build-arg MART_BASE_API=https://api.snapp.market .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"
- docker push "$CI_REGISTRY_IMAGE"
only:
- master
when: manual
tags:
- Front
build:
stage: build
script:
- docker build --rm -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" -t "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA" .
- docker push "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA"
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
except:
- master
when: manual
tags:
- Front
only:
- develop
deploy_production:
stage: deploy
script:
- export PRODUCTION_IMAGE="$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"
- docker-compose pull nginx_production
- docker-compose up -d nginx_production
only:
- master
when: manual
tags:
- Front
environment:
name: production
url: https://m.snapp.market
deploy_staging:
stage: deploy
script:
- export STAGING_IMAGE="$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA"
- docker-compose pull nginx_staging
- docker-compose up -d nginx_staging
only:
- develop
when: manual
tags:
- Front
environment:
name: staging
url: https://m-staging.snapp.market