forked from echoprotocol/explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
87 lines (79 loc) · 2.19 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
stages:
- build
- deploy
build.develop:
stage: build
variables:
NODE_ENV: production
NODE_APP_INSTANCE: develop
CI_FULL_REGISTRY: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
EXTERNAL_PORT: 26562
script:
- docker build --cache-from $CI_FULL_REGISTRY --build-arg NODE_APP_INSTANCE=${NODE_APP_INSTANCE} -t $CI_FULL_REGISTRY .
- docker-compose -p 656-echo-explorer-develop up -d
only:
- develop
tags:
- echo-linux
environment:
name: develop
url: https://656-echo-explorer.pixelplex-test.by
build.master:
stage: build
variables:
NODE_ENV: production
NODE_APP_INSTANCE: master
CI_FULL_REGISTRY: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
EXTERNAL_PORT: 36562
script:
- docker build --cache-from $CI_FULL_REGISTRY --build-arg NODE_APP_INSTANCE=${NODE_APP_INSTANCE} -t $CI_FULL_REGISTRY .
- docker-compose -p 656-echo-explorer-stage up -d
only:
- master
tags:
- echo-linux
environment:
name: master
url: http://656-echo-explorer.pixelplexlabs.com
build.production:
stage: build
variables:
NODE_ENV: production
NODE_APP_INSTANCE: production
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- docker build --build-arg NODE_APP_INSTANCE=${NODE_APP_INSTANCE} --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA --tag $CI_REGISTRY_IMAGE:latest .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker push $CI_REGISTRY_IMAGE:latest
after_script:
- docker logout $CI_REGISTRY
only:
- tags
tags:
- echo-linux
environment:
name: production
url: https://explorer.echo-dev.io
deploy.production:
stage: deploy
variables:
NODE_ENV: production
NODE_APP_INSTANCE: production
CI_FULL_REGISTRY: $CI_REGISTRY_IMAGE:latest
EXTERNAL_PORT: 26562
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- docker pull $CI_REGISTRY_IMAGE:latest
- docker-compose up -d
after_script:
- docker logout $CI_REGISTRY
only:
- tags
tags:
- echo-explorer-1
when: manual
environment:
name: production
url: https://explorer.echo-dev.io