-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
81 lines (76 loc) · 3.24 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
testing_build:
only:
- /^v(\d+\.)?(\d+\.)?(\*|\d+)-test\d*$/
stage: build
tags:
- builder
script:
- docker login --username $DOCKER_USERNAME --password $DOCKER_TOKEN
- echo "Building ThreeFold Connect for testing"
- mv frontend/public/config.testing.js frontend/public/config.js
- mv example/public/config.testing.js example/public/config.js
- docker build . -t jimber/3botlogin:testing-$CI_COMMIT_TAG
- docker push jimber/3botlogin:testing-$CI_COMMIT_TAG
testing_deploy:
only:
- /^v(\d+\.)?(\d+\.)?(\*|\d+)-test\d*$/
stage: deploy
tags:
- 3botconnect_testing_deployer
script:
- docker login --username $DOCKER_USERNAME --password $DOCKER_TOKEN
- echo "Deploying ThreeFold Connect for testing"
- docker rm -f 3botlogin || true
- docker pull jimber/3botlogin:testing-$CI_COMMIT_TAG
- docker run -d -it --restart=unless-stopped --network=jimber_proxy_net --name 3botlogin -v /opt/3botlogin/pythonsqlite.db:/usr/share/nginx/backend/pythonsqlite.db jimber/3botlogin:testing-$CI_COMMIT_TAG
staging_build:
only:
- /^v(\d+\.)?(\d+\.)?(\*|\d+)-rc\d*$/
stage: build
tags:
- builder
script:
- docker login --username $DOCKER_USERNAME --password $DOCKER_TOKEN
- echo "Building ThreeFold Connect for staging"
- mv frontend/public/config.staging.js frontend/public/config.js
- mv example/public/config.staging.js example/public/config.js
- docker build . -t jimber/3botlogin:staging-$CI_COMMIT_TAG
- docker push jimber/3botlogin:staging-$CI_COMMIT_TAG
staging_deploy:
only:
- /^v(\d+\.)?(\d+\.)?(\*|\d+)-rc\d*$/
stage: deploy
tags:
- 3botconnect_staging_deployer
script:
- docker login --username $DOCKER_USERNAME --password $DOCKER_TOKEN
- echo "Deploying ThreeFold Connect for staging"
- docker rm -f 3botlogin || true
- docker pull jimber/3botlogin:staging-$CI_COMMIT_TAG
- docker run -d -it --restart=unless-stopped --network=jimber_proxy_net --name 3botlogin -v /opt/3botlogin/pythonsqlite.db:/usr/share/nginx/backend/pythonsqlite.db -v /opt/3botlogin/config.ini:/usr/share/nginx/backend/config.ini jimber/3botlogin:staging-$CI_COMMIT_TAG
production_build:
only:
- /^v(\d+\.)?(\d+\.)?(\*|\d+)$/
stage: build
tags:
- builder
script:
- docker login --username $DOCKER_USERNAME --password $DOCKER_TOKEN
- echo "Building ThreeFold Connect for production"
- mv frontend/public/config.prod.js frontend/public/config.js
- mv example/public/config.prod.js example/public/config.js
- docker build . -t jimber/3botlogin:production-$CI_COMMIT_TAG
- docker push jimber/3botlogin:production-$CI_COMMIT_TAG
production_deploy:
only:
- /^v(\d+\.)?(\d+\.)?(\*|\d+)$/
when: manual
stage: deploy
tags:
- 3botconnect_production_deployer
script:
- docker login --username $DOCKER_USERNAME --password $DOCKER_TOKEN
- echo "Deploying ThreeFold Connect for production"
- docker rm -f 3botlogin
- docker pull jimber/3botlogin:production-$CI_COMMIT_TAG
- docker run -d -it --restart=unless-stopped --name 3botlogin -v /opt/3botlogin/db/pythonsqlite.db:/usr/share/nginx/backend/pythonsqlite.db -v /opt/3botlogin/config.ini:/usr/share/nginx/backend/config.ini --network=3proxynet jimber/3botlogin:production-$CI_COMMIT_TAG