This repository was archived by the owner on Oct 28, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +83
-7
lines changed
Expand file tree Collapse file tree 1 file changed +83
-7
lines changed Original file line number Diff line number Diff line change 11kind : pipeline
2- name : default
2+ name : test
33type : docker
44
5+ trigger :
6+ branch :
7+ - main
8+
59steps :
610 - name : Test
711 pull : if-not-exists
@@ -18,6 +22,27 @@ steps:
1822 - name : cache
1923 path : /tmp/cache
2024
25+ volumes :
26+ - name : cache
27+ host :
28+ path : /root/.buildcache
29+
30+ ---
31+ kind : pipeline
32+ name : deploy_staging
33+ type : docker
34+
35+ node :
36+ location : staging
37+
38+ depends_on :
39+ - test
40+
41+ trigger :
42+ branch :
43+ - main
44+
45+ steps :
2146 - name : Build Docker container
2247 pull : if-not-exists
2348 image : docker
@@ -52,23 +77,74 @@ steps:
5277 from_secret : slack_webhook_channel
5378 username : drone
5479
80+ volumes :
81+ - name : dockerSocket
82+ host :
83+ path : /var/run/docker.sock
84+ - name : dockerRunEnv
85+ host :
86+ path : /root/rtcv.env
87+ - name : dockerRunScript
88+ host :
89+ path : /root/rtcv.sh
90+
91+ ---
92+ kind : pipeline
93+ name : deploy_production
94+ type : docker
95+
96+ node :
97+ location : production
98+
99+ depends_on :
100+ - test
101+
55102trigger :
56103 branch :
57104 - main
58105
106+ steps :
107+ - name : Build Docker container
108+ pull : if-not-exists
109+ image : docker
110+ environment :
111+ DOCKER_BUILDKIT : 1 # This enables the docker build cache (this is NOT the dockerfile layers cache)
112+ commands :
113+ - docker build --memory 1.5GB -t rtcv:latest .
114+ volumes :
115+ - name : dockerSocket
116+ path : /var/run/docker.sock
117+
118+ - name : Deploy Docker container
119+ pull : if-not-exists
120+ image : docker
121+ commands :
122+ - docker rm -f rtcv # Remove the old container
123+ - /root/dockerRunScript # Run the script to deploy the container
124+ volumes :
125+ - name : dockerSocket
126+ path : /var/run/docker.sock
127+ - name : dockerRunEnv
128+ path : /root/rtcv.env
129+ - name : dockerRunScript
130+ path : /root/dockerRunScript
131+
132+ - name : slack
133+ image : plugins/slack
134+ settings :
135+ webhook :
136+ from_secret : slack_webhook
137+ channel :
138+ from_secret : slack_webhook_channel
139+ username : drone
140+
59141volumes :
60142 - name : dockerSocket
61143 host :
62144 path : /var/run/docker.sock
63- - name : cache
64- host :
65- path : /root/.buildcache
66145 - name : dockerRunEnv
67146 host :
68147 path : /root/rtcv.env
69148 - name : dockerRunScript
70149 host :
71150 path : /root/rtcv.sh
72-
73- node :
74- location : staging
You can’t perform that action at this time.
0 commit comments