##// END OF EJS Templates
feat: dev-tools, ensure deamonized commands stay within process
super-admin -
Show More
@@ -1,3953 +1,4007 b''
1 #!/usr/bin/env bash
1 #!/usr/bin/env bash
2 # This script was generated by bashly 1.0.8 (https://bashly.dannyb.co)
2 # This script was generated by bashly 1.0.8 (https://bashly.dannyb.co)
3 # Modifying it manually is not recommended
3 # Modifying it manually is not recommended
4
4
5 # :wrapper.bash3_bouncer
5 # :wrapper.bash3_bouncer
6 if [[ "${BASH_VERSINFO:-0}" -lt 4 ]]; then
6 if [[ "${BASH_VERSINFO:-0}" -lt 4 ]]; then
7 printf "bash version 4 or higher is required\n" >&2
7 printf "bash version 4 or higher is required\n" >&2
8 exit 1
8 exit 1
9 fi
9 fi
10
10
11 # :command.master_script
11 # :command.master_script
12
12
13 # :command.version_command
13 # :command.version_command
14 version_command() {
14 version_command() {
15 echo "$version"
15 echo "$version"
16 }
16 }
17
17
18 # :command.usage
18 # :command.usage
19 dev_tools_usage() {
19 dev_tools_usage() {
20 if [[ -n $long_usage ]]; then
20 if [[ -n $long_usage ]]; then
21 printf "dev-tools - CLI for various dev-tools operation on the stack\n"
21 printf "dev-tools - CLI for various dev-tools operation on the stack\n"
22 echo
22 echo
23
23
24 else
24 else
25 printf "dev-tools - CLI for various dev-tools operation on the stack\n"
25 printf "dev-tools - CLI for various dev-tools operation on the stack\n"
26 echo
26 echo
27
27
28 fi
28 fi
29
29
30 printf "%s\n" "Usage:"
30 printf "%s\n" "Usage:"
31 printf " dev-tools COMMAND\n"
31 printf " dev-tools COMMAND\n"
32 printf " dev-tools [COMMAND] --help | -h\n"
32 printf " dev-tools [COMMAND] --help | -h\n"
33 printf " dev-tools --version | -v\n"
33 printf " dev-tools --version | -v\n"
34 echo
34 echo
35 # :command.usage_commands
35 # :command.usage_commands
36 printf "%s\n" "dev-env Commands:"
36 printf "%s\n" "dev-env Commands:"
37 printf " %s run bash console for vcsserver\n" "vcs "
37 printf " %s run bash console for vcsserver\n" "vcs "
38 printf " %s run bash console for rhodecode-ce\n" "ce "
38 printf " %s run bash console for rhodecode-ce\n" "ce "
39 printf " %s run bash console for rhodecode-ee\n" "ee "
39 printf " %s run bash console for rhodecode-ee\n" "ee "
40 printf " %s run bash console for rhodecode-celery\n" "celery "
40 printf " %s run bash console for rhodecode-celery\n" "celery "
41 printf " %s run celery instance on top of mounted source code, e.g ./dev-tools celeryd&\n" "celeryd "
41 printf " %s run celery detached instance on top of mounted source code\n" "celeryd "
42 printf " %s run bash console for rhodecode-ssh\n" "ssh "
42 printf " %s run bash console for rhodecode-ssh\n" "ssh "
43 printf " %s run sshd instance for rhodecode-ssh\n" "sshd "
43 printf " %s run sshd detached instance on top of mounted source code\n" "sshd "
44 printf " %s run bash console for rhodecode-ssh\n" "svn "
44 printf " %s run bash console for rhodecode-ssh\n" "svn "
45 printf " %s run sshd instance for rhodecode-ssh\n" "svnd "
45 printf " %s run svn detached instance on top of mounted source code\n" "svnd "
46 printf " %s run bash console for rhodecode-tools-ce\n" "tools "
46 printf " %s run bash console for rhodecode-tools-ce\n" "tools "
47 printf " %s create dev env required to run vcsserver and rhodecode\n" "dev-env "
47 printf " %s create dev env required to run vcsserver and rhodecode\n" "dev-env "
48 printf " %s stops dev env\n" "dev-env-stop "
48 printf " %s stops dev env\n" "dev-env-stop "
49 echo
49 echo
50 printf "%s\n" "Cleanup Commands:"
50 printf "%s\n" "Cleanup Commands:"
51 printf " %s clears docker images\n" "prune "
51 printf " %s clears docker images\n" "prune "
52 printf " %s clears docker images and system cache, full cleanup. Be cautious !\n" "prune-all "
52 printf " %s clears docker images and system cache, full cleanup. Be cautious !\n" "prune-all "
53 echo
53 echo
54 printf "%s\n" "CLI generation Commands:"
54 printf "%s\n" "CLI generation Commands:"
55 printf " %s pull latest image of bashly\n" "cli-generate-pull "
55 printf " %s pull latest image of bashly\n" "cli-generate-pull "
56 printf " %s print out help about bashly\n" "cli-generate-help "
56 printf " %s print out help about bashly\n" "cli-generate-help "
57 printf " %s set the version for rcstack\n" "stack-cli-version "
57 printf " %s set the version for rcstack\n" "stack-cli-version "
58 printf " %s set the version for rcstack docker image\n" "stack-image-version"
58 printf " %s set the version for rcstack docker image\n" "stack-image-version"
59 printf " %s run a ./rcstack generation script\n" "cli-generate-rc "
59 printf " %s run a ./rcstack generation script\n" "cli-generate-rc "
60 printf " %s run a ./dev-tools generation script\n" "cli-generate-dev "
60 printf " %s run a ./dev-tools generation script\n" "cli-generate-dev "
61 echo
61 echo
62 printf "%s\n" "Build Commands:"
62 printf "%s\n" "Build Commands:"
63 printf " %s Fetch Artifacts to run installer based build\n" "get-build-artifacts"
63 printf " %s Fetch Artifacts to run installer based build\n" "get-build-artifacts"
64 printf " %s Build RhodeCode image from installer, ./dev-tools get-build-artifacts initially\n" "build-installer "
64 printf " %s Build RhodeCode image from installer, ./dev-tools get-build-artifacts initially\n" "build-installer "
65 printf " %s Fetch RhodeCode sources, store in .source dir to run a source-based builds\n" "get-build-source "
65 printf " %s Fetch RhodeCode sources, store in .source dir to run a source-based builds\n" "get-build-source "
66 printf " %s Build RhodeCode image from source, requires ./dev-tools get-build-source initially\n" "build-source "
66 printf " %s Build RhodeCode image from source, requires ./dev-tools get-build-source initially\n" "build-source "
67 echo
67 echo
68
68
69 # :command.long_usage
69 # :command.long_usage
70 if [[ -n $long_usage ]]; then
70 if [[ -n $long_usage ]]; then
71 printf "%s\n" "Options:"
71 printf "%s\n" "Options:"
72
72
73 # :command.usage_fixed_flags
73 # :command.usage_fixed_flags
74 printf " %s\n" "--help, -h"
74 printf " %s\n" "--help, -h"
75 printf " Show this help\n"
75 printf " Show this help\n"
76 echo
76 echo
77 printf " %s\n" "--version, -v"
77 printf " %s\n" "--version, -v"
78 printf " Show version number\n"
78 printf " Show version number\n"
79 echo
79 echo
80
80
81 # :command.footer
81 # :command.footer
82 printf "RhodeCode Inc 2024\n\n"
82 printf "RhodeCode Inc 2024\n\n"
83 echo
83 echo
84
84
85 fi
85 fi
86 }
86 }
87
87
88 # :command.usage
88 # :command.usage
89 dev_tools_vcs_usage() {
89 dev_tools_vcs_usage() {
90 if [[ -n $long_usage ]]; then
90 if [[ -n $long_usage ]]; then
91 printf "dev-tools vcs - run bash console for vcsserver\n"
91 printf "dev-tools vcs - run bash console for vcsserver\n"
92 echo
92 echo
93
93
94 else
94 else
95 printf "dev-tools vcs - run bash console for vcsserver\n"
95 printf "dev-tools vcs - run bash console for vcsserver\n"
96 echo
96 echo
97
97
98 fi
98 fi
99
99
100 printf "Alias: v\n"
100 printf "Alias: v\n"
101 echo
101 echo
102
102
103 printf "%s\n" "Usage:"
103 printf "%s\n" "Usage:"
104 printf " dev-tools vcs [OPTIONS]\n"
104 printf " dev-tools vcs [OPTIONS]\n"
105 printf " dev-tools vcs --help | -h\n"
105 printf " dev-tools vcs --help | -h\n"
106 echo
106 echo
107
107
108 # :command.long_usage
108 # :command.long_usage
109 if [[ -n $long_usage ]]; then
109 if [[ -n $long_usage ]]; then
110 printf "%s\n" "Options:"
110 printf "%s\n" "Options:"
111
111
112 # :command.usage_flags
112 # :command.usage_flags
113 # :flag.usage
113 # :flag.usage
114 printf " %s\n" "--workdir WORKDIR"
114 printf " %s\n" "--workdir WORKDIR"
115 printf " workdir to run the pip install -e on top of can be ce or ee only\n"
115 printf " workdir to run the pip install -e on top of can be ce or ee only\n"
116 printf " Default: /home/rhodecode/rhodecode-vcsserver\n"
116 printf " Default: /home/rhodecode/rhodecode-vcsserver\n"
117 echo
117 echo
118
118
119 # :flag.usage
119 # :flag.usage
120 printf " %s\n" "--cmd CMD"
120 printf " %s\n" "--cmd CMD"
121 printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n"
121 printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n"
122 printf " Default: .dev-env/cmd-vcs.sh\n"
122 printf " Default: .dev-env/cmd-vcs.sh\n"
123 echo
123 echo
124
124
125 # :flag.usage
125 # :flag.usage
126 printf " %s\n" "--no-tty"
126 printf " %s\n" "--no-tty"
127 printf " when running docker command don't attach to TTY. Useful for running a script\n out of shell context, e.g crontab\n"
127 printf " when running docker command don't attach to TTY. Useful for running a script\n out of shell context, e.g crontab\n"
128 echo
128 echo
129
129
130 # :command.usage_fixed_flags
130 # :command.usage_fixed_flags
131 printf " %s\n" "--help, -h"
131 printf " %s\n" "--help, -h"
132 printf " Show this help\n"
132 printf " Show this help\n"
133 echo
133 echo
134
134
135 fi
135 fi
136 }
136 }
137
137
138 # :command.usage
138 # :command.usage
139 dev_tools_ce_usage() {
139 dev_tools_ce_usage() {
140 if [[ -n $long_usage ]]; then
140 if [[ -n $long_usage ]]; then
141 printf "dev-tools ce - run bash console for rhodecode-ce\n"
141 printf "dev-tools ce - run bash console for rhodecode-ce\n"
142 echo
142 echo
143
143
144 else
144 else
145 printf "dev-tools ce - run bash console for rhodecode-ce\n"
145 printf "dev-tools ce - run bash console for rhodecode-ce\n"
146 echo
146 echo
147
147
148 fi
148 fi
149
149
150 printf "Alias: c\n"
150 printf "Alias: c\n"
151 echo
151 echo
152
152
153 printf "%s\n" "Usage:"
153 printf "%s\n" "Usage:"
154 printf " dev-tools ce [OPTIONS]\n"
154 printf " dev-tools ce [OPTIONS]\n"
155 printf " dev-tools ce --help | -h\n"
155 printf " dev-tools ce --help | -h\n"
156 echo
156 echo
157
157
158 # :command.long_usage
158 # :command.long_usage
159 if [[ -n $long_usage ]]; then
159 if [[ -n $long_usage ]]; then
160 printf "%s\n" "Options:"
160 printf "%s\n" "Options:"
161
161
162 # :command.usage_flags
162 # :command.usage_flags
163 # :flag.usage
163 # :flag.usage
164 printf " %s\n" "--workdir WORKDIR"
164 printf " %s\n" "--workdir WORKDIR"
165 printf " workdir to run the pip install -e on top of can be ce or ee only\n"
165 printf " workdir to run the pip install -e on top of can be ce or ee only\n"
166 printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n"
166 printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n"
167 echo
167 echo
168
168
169 # :flag.usage
169 # :flag.usage
170 printf " %s\n" "--cmd CMD"
170 printf " %s\n" "--cmd CMD"
171 printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n"
171 printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n"
172 printf " Default: .dev-env/cmd-ce.sh\n"
172 printf " Default: .dev-env/cmd-ce.sh\n"
173 echo
173 echo
174
174
175 # :flag.usage
175 # :flag.usage
176 printf " %s\n" "--no-tty"
176 printf " %s\n" "--no-tty"
177 printf " when running docker command don't attach to TTY. Useful for running a script\n out of shell context, e.g crontab\n"
177 printf " when running docker command don't attach to TTY. Useful for running a script\n out of shell context, e.g crontab\n"
178 echo
178 echo
179
179
180 # :command.usage_fixed_flags
180 # :command.usage_fixed_flags
181 printf " %s\n" "--help, -h"
181 printf " %s\n" "--help, -h"
182 printf " Show this help\n"
182 printf " Show this help\n"
183 echo
183 echo
184
184
185 fi
185 fi
186 }
186 }
187
187
188 # :command.usage
188 # :command.usage
189 dev_tools_ee_usage() {
189 dev_tools_ee_usage() {
190 if [[ -n $long_usage ]]; then
190 if [[ -n $long_usage ]]; then
191 printf "dev-tools ee - run bash console for rhodecode-ee\n"
191 printf "dev-tools ee - run bash console for rhodecode-ee\n"
192 echo
192 echo
193
193
194 else
194 else
195 printf "dev-tools ee - run bash console for rhodecode-ee\n"
195 printf "dev-tools ee - run bash console for rhodecode-ee\n"
196 echo
196 echo
197
197
198 fi
198 fi
199
199
200 printf "Alias: e\n"
200 printf "Alias: e\n"
201 echo
201 echo
202
202
203 printf "%s\n" "Usage:"
203 printf "%s\n" "Usage:"
204 printf " dev-tools ee [OPTIONS]\n"
204 printf " dev-tools ee [OPTIONS]\n"
205 printf " dev-tools ee --help | -h\n"
205 printf " dev-tools ee --help | -h\n"
206 echo
206 echo
207
207
208 # :command.long_usage
208 # :command.long_usage
209 if [[ -n $long_usage ]]; then
209 if [[ -n $long_usage ]]; then
210 printf "%s\n" "Options:"
210 printf "%s\n" "Options:"
211
211
212 # :command.usage_flags
212 # :command.usage_flags
213 # :flag.usage
213 # :flag.usage
214 printf " %s\n" "--workdir WORKDIR"
214 printf " %s\n" "--workdir WORKDIR"
215 printf " workdir to run the pip install -e on top of can be ce or ee only\n"
215 printf " workdir to run the pip install -e on top of can be ce or ee only\n"
216 printf " Default: /home/rhodecode/rhodecode-enterprise-ee\n"
216 printf " Default: /home/rhodecode/rhodecode-enterprise-ee\n"
217 echo
217 echo
218
218
219 # :flag.usage
219 # :flag.usage
220 printf " %s\n" "--cmd CMD"
220 printf " %s\n" "--cmd CMD"
221 printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n"
221 printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n"
222 printf " Default: .dev-env/cmd-ee.sh\n"
222 printf " Default: .dev-env/cmd-ee.sh\n"
223 echo
223 echo
224
224
225 # :flag.usage
225 # :flag.usage
226 printf " %s\n" "--no-tty"
226 printf " %s\n" "--no-tty"
227 printf " when running docker command don't attach to TTY. Useful for running a script\n out of shell context, e.g crontab\n"
227 printf " when running docker command don't attach to TTY. Useful for running a script\n out of shell context, e.g crontab\n"
228 echo
228 echo
229
229
230 # :command.usage_fixed_flags
230 # :command.usage_fixed_flags
231 printf " %s\n" "--help, -h"
231 printf " %s\n" "--help, -h"
232 printf " Show this help\n"
232 printf " Show this help\n"
233 echo
233 echo
234
234
235 fi
235 fi
236 }
236 }
237
237
238 # :command.usage
238 # :command.usage
239 dev_tools_celery_usage() {
239 dev_tools_celery_usage() {
240 if [[ -n $long_usage ]]; then
240 if [[ -n $long_usage ]]; then
241 printf "dev-tools celery - run bash console for rhodecode-celery\n"
241 printf "dev-tools celery - run bash console for rhodecode-celery\n"
242 echo
242 echo
243
243
244 else
244 else
245 printf "dev-tools celery - run bash console for rhodecode-celery\n"
245 printf "dev-tools celery - run bash console for rhodecode-celery\n"
246 echo
246 echo
247
247
248 fi
248 fi
249
249
250 printf "%s\n" "Usage:"
250 printf "%s\n" "Usage:"
251 printf " dev-tools celery [OPTIONS]\n"
251 printf " dev-tools celery [OPTIONS]\n"
252 printf " dev-tools celery --help | -h\n"
252 printf " dev-tools celery --help | -h\n"
253 echo
253 echo
254
254
255 # :command.long_usage
255 # :command.long_usage
256 if [[ -n $long_usage ]]; then
256 if [[ -n $long_usage ]]; then
257 printf "%s\n" "Options:"
257 printf "%s\n" "Options:"
258
258
259 # :command.usage_flags
259 # :command.usage_flags
260 # :flag.usage
260 # :flag.usage
261 printf " %s\n" "--workdir WORKDIR"
261 printf " %s\n" "--workdir WORKDIR"
262 printf " workdir to run the pip install -e on top of can be ce or ee only\n"
262 printf " workdir to run the pip install -e on top of can be ce or ee only\n"
263 printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n"
263 printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n"
264 echo
264 echo
265
265
266 # :flag.usage
266 # :flag.usage
267 printf " %s\n" "--cmd CMD"
267 printf " %s\n" "--cmd CMD"
268 printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n"
268 printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n"
269 printf " Default: .dev-env/cmd-celery.sh\n"
269 printf " Default: .dev-env/cmd-celery.sh\n"
270 echo
270 echo
271
271
272 # :command.usage_fixed_flags
272 # :command.usage_fixed_flags
273 printf " %s\n" "--help, -h"
273 printf " %s\n" "--help, -h"
274 printf " Show this help\n"
274 printf " Show this help\n"
275 echo
275 echo
276
276
277 fi
277 fi
278 }
278 }
279
279
280 # :command.usage
280 # :command.usage
281 dev_tools_celeryd_usage() {
281 dev_tools_celeryd_usage() {
282 if [[ -n $long_usage ]]; then
282 if [[ -n $long_usage ]]; then
283 printf "dev-tools celeryd - run celery instance on top of mounted source code, e.g ./dev-tools celeryd&\n"
283 printf "dev-tools celeryd - run celery detached instance on top of mounted source code\n"
284 echo
284 echo
285
285
286 else
286 else
287 printf "dev-tools celeryd - run celery instance on top of mounted source code, e.g ./dev-tools celeryd&\n"
287 printf "dev-tools celeryd - run celery detached instance on top of mounted source code\n"
288 echo
288 echo
289
289
290 fi
290 fi
291
291
292 printf "%s\n" "Usage:"
292 printf "%s\n" "Usage:"
293 printf " dev-tools celeryd [OPTIONS]\n"
293 printf " dev-tools celeryd [OPTIONS]\n"
294 printf " dev-tools celeryd --help | -h\n"
294 printf " dev-tools celeryd --help | -h\n"
295 echo
295 echo
296
296
297 # :command.long_usage
297 # :command.long_usage
298 if [[ -n $long_usage ]]; then
298 if [[ -n $long_usage ]]; then
299 printf "%s\n" "Options:"
299 printf "%s\n" "Options:"
300
300
301 # :command.usage_flags
301 # :command.usage_flags
302 # :flag.usage
302 # :flag.usage
303 printf " %s\n" "--workdir WORKDIR"
303 printf " %s\n" "--workdir WORKDIR"
304 printf " workdir to run the pip install -e on top of can be ce or ee only\n"
304 printf " workdir to run the pip install -e on top of can be ce or ee only\n"
305 printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n"
305 printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n"
306 echo
306 echo
307
307
308 # :flag.usage
308 # :flag.usage
309 printf " %s\n" "--cmd CMD"
309 printf " %s\n" "--cmd CMD"
310 printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n"
310 printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n"
311 printf " Default: .dev-env/cmd-celeryd.sh\n"
311 printf " Default: .dev-env/cmd-celeryd.sh\n"
312 echo
312 echo
313
313
314 # :flag.usage
315 printf " %s\n" "--force-cmd"
316 printf " enforce re-creation of the startup command\n"
317 echo
318
314 # :command.usage_fixed_flags
319 # :command.usage_fixed_flags
315 printf " %s\n" "--help, -h"
320 printf " %s\n" "--help, -h"
316 printf " Show this help\n"
321 printf " Show this help\n"
317 echo
322 echo
318
323
319 fi
324 fi
320 }
325 }
321
326
322 # :command.usage
327 # :command.usage
323 dev_tools_ssh_usage() {
328 dev_tools_ssh_usage() {
324 if [[ -n $long_usage ]]; then
329 if [[ -n $long_usage ]]; then
325 printf "dev-tools ssh - run bash console for rhodecode-ssh\n"
330 printf "dev-tools ssh - run bash console for rhodecode-ssh\n"
326 echo
331 echo
327
332
328 else
333 else
329 printf "dev-tools ssh - run bash console for rhodecode-ssh\n"
334 printf "dev-tools ssh - run bash console for rhodecode-ssh\n"
330 echo
335 echo
331
336
332 fi
337 fi
333
338
334 printf "%s\n" "Usage:"
339 printf "%s\n" "Usage:"
335 printf " dev-tools ssh [OPTIONS]\n"
340 printf " dev-tools ssh [OPTIONS]\n"
336 printf " dev-tools ssh --help | -h\n"
341 printf " dev-tools ssh --help | -h\n"
337 echo
342 echo
338
343
339 # :command.long_usage
344 # :command.long_usage
340 if [[ -n $long_usage ]]; then
345 if [[ -n $long_usage ]]; then
341 printf "%s\n" "Options:"
346 printf "%s\n" "Options:"
342
347
343 # :command.usage_flags
348 # :command.usage_flags
344 # :flag.usage
349 # :flag.usage
345 printf " %s\n" "--workdir WORKDIR"
350 printf " %s\n" "--workdir WORKDIR"
346 printf " workdir to run the pip install -e on top of can be ce or ee only\n"
351 printf " workdir to run the pip install -e on top of can be ce or ee only\n"
347 printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n"
352 printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n"
348 echo
353 echo
349
354
350 # :flag.usage
355 # :flag.usage
351 printf " %s\n" "--cmd CMD"
356 printf " %s\n" "--cmd CMD"
352 printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n"
357 printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n"
353 printf " Default: .dev-env/cmd-ssh.sh\n"
358 printf " Default: .dev-env/cmd-ssh.sh\n"
354 echo
359 echo
355
360
356 # :command.usage_fixed_flags
361 # :command.usage_fixed_flags
357 printf " %s\n" "--help, -h"
362 printf " %s\n" "--help, -h"
358 printf " Show this help\n"
363 printf " Show this help\n"
359 echo
364 echo
360
365
361 fi
366 fi
362 }
367 }
363
368
364 # :command.usage
369 # :command.usage
365 dev_tools_sshd_usage() {
370 dev_tools_sshd_usage() {
366 if [[ -n $long_usage ]]; then
371 if [[ -n $long_usage ]]; then
367 printf "dev-tools sshd - run sshd instance for rhodecode-ssh\n"
372 printf "dev-tools sshd - run sshd detached instance on top of mounted source code\n"
368 echo
373 echo
369
374
370 else
375 else
371 printf "dev-tools sshd - run sshd instance for rhodecode-ssh\n"
376 printf "dev-tools sshd - run sshd detached instance on top of mounted source code\n"
372 echo
377 echo
373
378
374 fi
379 fi
375
380
376 printf "%s\n" "Usage:"
381 printf "%s\n" "Usage:"
377 printf " dev-tools sshd [OPTIONS]\n"
382 printf " dev-tools sshd [OPTIONS]\n"
378 printf " dev-tools sshd --help | -h\n"
383 printf " dev-tools sshd --help | -h\n"
379 echo
384 echo
380
385
381 # :command.long_usage
386 # :command.long_usage
382 if [[ -n $long_usage ]]; then
387 if [[ -n $long_usage ]]; then
383 printf "%s\n" "Options:"
388 printf "%s\n" "Options:"
384
389
385 # :command.usage_flags
390 # :command.usage_flags
386 # :flag.usage
391 # :flag.usage
387 printf " %s\n" "--workdir WORKDIR"
392 printf " %s\n" "--workdir WORKDIR"
388 printf " workdir to run the pip install -e on top of can be ce or ee only\n"
393 printf " workdir to run the pip install -e on top of can be ce or ee only\n"
389 printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n"
394 printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n"
390 echo
395 echo
391
396
392 # :flag.usage
397 # :flag.usage
393 printf " %s\n" "--cmd CMD"
398 printf " %s\n" "--cmd CMD"
394 printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n"
399 printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n"
395 printf " Default: .dev-env/cmd-sshd.sh\n"
400 printf " Default: .dev-env/cmd-sshd.sh\n"
396 echo
401 echo
397
402
403 # :flag.usage
404 printf " %s\n" "--force-cmd"
405 printf " enforce re-creation of the startup command\n"
406 echo
407
398 # :command.usage_fixed_flags
408 # :command.usage_fixed_flags
399 printf " %s\n" "--help, -h"
409 printf " %s\n" "--help, -h"
400 printf " Show this help\n"
410 printf " Show this help\n"
401 echo
411 echo
402
412
403 fi
413 fi
404 }
414 }
405
415
406 # :command.usage
416 # :command.usage
407 dev_tools_svn_usage() {
417 dev_tools_svn_usage() {
408 if [[ -n $long_usage ]]; then
418 if [[ -n $long_usage ]]; then
409 printf "dev-tools svn - run bash console for rhodecode-ssh\n"
419 printf "dev-tools svn - run bash console for rhodecode-ssh\n"
410 echo
420 echo
411
421
412 else
422 else
413 printf "dev-tools svn - run bash console for rhodecode-ssh\n"
423 printf "dev-tools svn - run bash console for rhodecode-ssh\n"
414 echo
424 echo
415
425
416 fi
426 fi
417
427
418 printf "%s\n" "Usage:"
428 printf "%s\n" "Usage:"
419 printf " dev-tools svn [OPTIONS]\n"
429 printf " dev-tools svn [OPTIONS]\n"
420 printf " dev-tools svn --help | -h\n"
430 printf " dev-tools svn --help | -h\n"
421 echo
431 echo
422
432
423 # :command.long_usage
433 # :command.long_usage
424 if [[ -n $long_usage ]]; then
434 if [[ -n $long_usage ]]; then
425 printf "%s\n" "Options:"
435 printf "%s\n" "Options:"
426
436
427 # :command.usage_flags
437 # :command.usage_flags
428 # :flag.usage
438 # :flag.usage
429 printf " %s\n" "--workdir WORKDIR"
439 printf " %s\n" "--workdir WORKDIR"
430 printf " workdir to run the pip install -e on top of can be ce or ee only\n"
440 printf " workdir to run the pip install -e on top of can be ce or ee only\n"
431 printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n"
441 printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n"
432 echo
442 echo
433
443
434 # :flag.usage
444 # :flag.usage
435 printf " %s\n" "--cmd CMD"
445 printf " %s\n" "--cmd CMD"
436 printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n"
446 printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n"
437 printf " Default: .dev-env/cmd-svn.sh\n"
447 printf " Default: .dev-env/cmd-svn.sh\n"
438 echo
448 echo
439
449
440 # :command.usage_fixed_flags
450 # :command.usage_fixed_flags
441 printf " %s\n" "--help, -h"
451 printf " %s\n" "--help, -h"
442 printf " Show this help\n"
452 printf " Show this help\n"
443 echo
453 echo
444
454
445 fi
455 fi
446 }
456 }
447
457
448 # :command.usage
458 # :command.usage
449 dev_tools_svnd_usage() {
459 dev_tools_svnd_usage() {
450 if [[ -n $long_usage ]]; then
460 if [[ -n $long_usage ]]; then
451 printf "dev-tools svnd - run sshd instance for rhodecode-ssh\n"
461 printf "dev-tools svnd - run svn detached instance on top of mounted source code\n"
452 echo
462 echo
453
463
454 else
464 else
455 printf "dev-tools svnd - run sshd instance for rhodecode-ssh\n"
465 printf "dev-tools svnd - run svn detached instance on top of mounted source code\n"
456 echo
466 echo
457
467
458 fi
468 fi
459
469
460 printf "%s\n" "Usage:"
470 printf "%s\n" "Usage:"
461 printf " dev-tools svnd [OPTIONS]\n"
471 printf " dev-tools svnd [OPTIONS]\n"
462 printf " dev-tools svnd --help | -h\n"
472 printf " dev-tools svnd --help | -h\n"
463 echo
473 echo
464
474
465 # :command.long_usage
475 # :command.long_usage
466 if [[ -n $long_usage ]]; then
476 if [[ -n $long_usage ]]; then
467 printf "%s\n" "Options:"
477 printf "%s\n" "Options:"
468
478
469 # :command.usage_flags
479 # :command.usage_flags
470 # :flag.usage
480 # :flag.usage
471 printf " %s\n" "--workdir WORKDIR"
481 printf " %s\n" "--workdir WORKDIR"
472 printf " workdir to run the pip install -e on top of can be ce or ee only\n"
482 printf " workdir to run the pip install -e on top of can be ce or ee only\n"
473 printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n"
483 printf " Default: /home/rhodecode/rhodecode-enterprise-ce\n"
474 echo
484 echo
475
485
476 # :flag.usage
486 # :flag.usage
477 printf " %s\n" "--cmd CMD"
487 printf " %s\n" "--cmd CMD"
478 printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n"
488 printf " cmd script to run, this is on host machine, relative to $WORKSPACE_HOME\n"
479 printf " Default: .dev-env/cmd-svnd.sh\n"
489 printf " Default: .dev-env/cmd-svnd.sh\n"
480 echo
490 echo
481
491
492 # :flag.usage
493 printf " %s\n" "--force-cmd"
494 printf " enforce re-creation of the startup command\n"
495 echo
496
482 # :command.usage_fixed_flags
497 # :command.usage_fixed_flags
483 printf " %s\n" "--help, -h"
498 printf " %s\n" "--help, -h"
484 printf " Show this help\n"
499 printf " Show this help\n"
485 echo
500 echo
486
501
487 fi
502 fi
488 }
503 }
489
504
490 # :command.usage
505 # :command.usage
491 dev_tools_tools_usage() {
506 dev_tools_tools_usage() {
492 if [[ -n $long_usage ]]; then
507 if [[ -n $long_usage ]]; then
493 printf "dev-tools tools - run bash console for rhodecode-tools-ce\n"
508 printf "dev-tools tools - run bash console for rhodecode-tools-ce\n"
494 echo
509 echo
495
510
496 else
511 else
497 printf "dev-tools tools - run bash console for rhodecode-tools-ce\n"
512 printf "dev-tools tools - run bash console for rhodecode-tools-ce\n"
498 echo
513 echo
499
514
500 fi
515 fi
501
516
502 printf "Alias: t\n"
517 printf "Alias: t\n"
503 echo
518 echo
504
519
505 printf "%s\n" "Usage:"
520 printf "%s\n" "Usage:"
506 printf " dev-tools tools\n"
521 printf " dev-tools tools\n"
507 printf " dev-tools tools --help | -h\n"
522 printf " dev-tools tools --help | -h\n"
508 echo
523 echo
509
524
510 # :command.long_usage
525 # :command.long_usage
511 if [[ -n $long_usage ]]; then
526 if [[ -n $long_usage ]]; then
512 printf "%s\n" "Options:"
527 printf "%s\n" "Options:"
513
528
514 # :command.usage_fixed_flags
529 # :command.usage_fixed_flags
515 printf " %s\n" "--help, -h"
530 printf " %s\n" "--help, -h"
516 printf " Show this help\n"
531 printf " Show this help\n"
517 echo
532 echo
518
533
519 fi
534 fi
520 }
535 }
521
536
522 # :command.usage
537 # :command.usage
523 dev_tools_dev_env_usage() {
538 dev_tools_dev_env_usage() {
524 if [[ -n $long_usage ]]; then
539 if [[ -n $long_usage ]]; then
525 printf "dev-tools dev-env - create dev env required to run vcsserver and rhodecode\n"
540 printf "dev-tools dev-env - create dev env required to run vcsserver and rhodecode\n"
526 echo
541 echo
527
542
528 else
543 else
529 printf "dev-tools dev-env - create dev env required to run vcsserver and rhodecode\n"
544 printf "dev-tools dev-env - create dev env required to run vcsserver and rhodecode\n"
530 echo
545 echo
531
546
532 fi
547 fi
533
548
534 printf "%s\n" "Usage:"
549 printf "%s\n" "Usage:"
535 printf " dev-tools dev-env\n"
550 printf " dev-tools dev-env\n"
536 printf " dev-tools dev-env --help | -h\n"
551 printf " dev-tools dev-env --help | -h\n"
537 echo
552 echo
538
553
539 # :command.long_usage
554 # :command.long_usage
540 if [[ -n $long_usage ]]; then
555 if [[ -n $long_usage ]]; then
541 printf "%s\n" "Options:"
556 printf "%s\n" "Options:"
542
557
543 # :command.usage_fixed_flags
558 # :command.usage_fixed_flags
544 printf " %s\n" "--help, -h"
559 printf " %s\n" "--help, -h"
545 printf " Show this help\n"
560 printf " Show this help\n"
546 echo
561 echo
547
562
548 fi
563 fi
549 }
564 }
550
565
551 # :command.usage
566 # :command.usage
552 dev_tools_dev_env_stop_usage() {
567 dev_tools_dev_env_stop_usage() {
553 if [[ -n $long_usage ]]; then
568 if [[ -n $long_usage ]]; then
554 printf "dev-tools dev-env-stop - stops dev env\n"
569 printf "dev-tools dev-env-stop - stops dev env\n"
555 echo
570 echo
556
571
557 else
572 else
558 printf "dev-tools dev-env-stop - stops dev env\n"
573 printf "dev-tools dev-env-stop - stops dev env\n"
559 echo
574 echo
560
575
561 fi
576 fi
562
577
563 printf "%s\n" "Usage:"
578 printf "%s\n" "Usage:"
564 printf " dev-tools dev-env-stop\n"
579 printf " dev-tools dev-env-stop\n"
565 printf " dev-tools dev-env-stop --help | -h\n"
580 printf " dev-tools dev-env-stop --help | -h\n"
566 echo
581 echo
567
582
568 # :command.long_usage
583 # :command.long_usage
569 if [[ -n $long_usage ]]; then
584 if [[ -n $long_usage ]]; then
570 printf "%s\n" "Options:"
585 printf "%s\n" "Options:"
571
586
572 # :command.usage_fixed_flags
587 # :command.usage_fixed_flags
573 printf " %s\n" "--help, -h"
588 printf " %s\n" "--help, -h"
574 printf " Show this help\n"
589 printf " Show this help\n"
575 echo
590 echo
576
591
577 fi
592 fi
578 }
593 }
579
594
580 # :command.usage
595 # :command.usage
581 dev_tools_prune_usage() {
596 dev_tools_prune_usage() {
582 if [[ -n $long_usage ]]; then
597 if [[ -n $long_usage ]]; then
583 printf "dev-tools prune - clears docker images\n"
598 printf "dev-tools prune - clears docker images\n"
584 echo
599 echo
585
600
586 else
601 else
587 printf "dev-tools prune - clears docker images\n"
602 printf "dev-tools prune - clears docker images\n"
588 echo
603 echo
589
604
590 fi
605 fi
591
606
592 printf "%s\n" "Usage:"
607 printf "%s\n" "Usage:"
593 printf " dev-tools prune\n"
608 printf " dev-tools prune\n"
594 printf " dev-tools prune --help | -h\n"
609 printf " dev-tools prune --help | -h\n"
595 echo
610 echo
596
611
597 # :command.long_usage
612 # :command.long_usage
598 if [[ -n $long_usage ]]; then
613 if [[ -n $long_usage ]]; then
599 printf "%s\n" "Options:"
614 printf "%s\n" "Options:"
600
615
601 # :command.usage_fixed_flags
616 # :command.usage_fixed_flags
602 printf " %s\n" "--help, -h"
617 printf " %s\n" "--help, -h"
603 printf " Show this help\n"
618 printf " Show this help\n"
604 echo
619 echo
605
620
606 fi
621 fi
607 }
622 }
608
623
609 # :command.usage
624 # :command.usage
610 dev_tools_prune_all_usage() {
625 dev_tools_prune_all_usage() {
611 if [[ -n $long_usage ]]; then
626 if [[ -n $long_usage ]]; then
612 printf "dev-tools prune-all - clears docker images and system cache, full cleanup. Be cautious !\n"
627 printf "dev-tools prune-all - clears docker images and system cache, full cleanup. Be cautious !\n"
613 echo
628 echo
614
629
615 else
630 else
616 printf "dev-tools prune-all - clears docker images and system cache, full cleanup. Be cautious !\n"
631 printf "dev-tools prune-all - clears docker images and system cache, full cleanup. Be cautious !\n"
617 echo
632 echo
618
633
619 fi
634 fi
620
635
621 printf "%s\n" "Usage:"
636 printf "%s\n" "Usage:"
622 printf " dev-tools prune-all\n"
637 printf " dev-tools prune-all\n"
623 printf " dev-tools prune-all --help | -h\n"
638 printf " dev-tools prune-all --help | -h\n"
624 echo
639 echo
625
640
626 # :command.long_usage
641 # :command.long_usage
627 if [[ -n $long_usage ]]; then
642 if [[ -n $long_usage ]]; then
628 printf "%s\n" "Options:"
643 printf "%s\n" "Options:"
629
644
630 # :command.usage_fixed_flags
645 # :command.usage_fixed_flags
631 printf " %s\n" "--help, -h"
646 printf " %s\n" "--help, -h"
632 printf " Show this help\n"
647 printf " Show this help\n"
633 echo
648 echo
634
649
635 fi
650 fi
636 }
651 }
637
652
638 # :command.usage
653 # :command.usage
639 dev_tools_cli_generate_pull_usage() {
654 dev_tools_cli_generate_pull_usage() {
640 if [[ -n $long_usage ]]; then
655 if [[ -n $long_usage ]]; then
641 printf "dev-tools cli-generate-pull - pull latest image of bashly\n"
656 printf "dev-tools cli-generate-pull - pull latest image of bashly\n"
642 echo
657 echo
643
658
644 else
659 else
645 printf "dev-tools cli-generate-pull - pull latest image of bashly\n"
660 printf "dev-tools cli-generate-pull - pull latest image of bashly\n"
646 echo
661 echo
647
662
648 fi
663 fi
649
664
650 printf "%s\n" "Usage:"
665 printf "%s\n" "Usage:"
651 printf " dev-tools cli-generate-pull\n"
666 printf " dev-tools cli-generate-pull\n"
652 printf " dev-tools cli-generate-pull --help | -h\n"
667 printf " dev-tools cli-generate-pull --help | -h\n"
653 echo
668 echo
654
669
655 # :command.long_usage
670 # :command.long_usage
656 if [[ -n $long_usage ]]; then
671 if [[ -n $long_usage ]]; then
657 printf "%s\n" "Options:"
672 printf "%s\n" "Options:"
658
673
659 # :command.usage_fixed_flags
674 # :command.usage_fixed_flags
660 printf " %s\n" "--help, -h"
675 printf " %s\n" "--help, -h"
661 printf " Show this help\n"
676 printf " Show this help\n"
662 echo
677 echo
663
678
664 fi
679 fi
665 }
680 }
666
681
667 # :command.usage
682 # :command.usage
668 dev_tools_cli_generate_help_usage() {
683 dev_tools_cli_generate_help_usage() {
669 if [[ -n $long_usage ]]; then
684 if [[ -n $long_usage ]]; then
670 printf "dev-tools cli-generate-help - print out help about bashly\n"
685 printf "dev-tools cli-generate-help - print out help about bashly\n"
671 echo
686 echo
672
687
673 else
688 else
674 printf "dev-tools cli-generate-help - print out help about bashly\n"
689 printf "dev-tools cli-generate-help - print out help about bashly\n"
675 echo
690 echo
676
691
677 fi
692 fi
678
693
679 printf "%s\n" "Usage:"
694 printf "%s\n" "Usage:"
680 printf " dev-tools cli-generate-help\n"
695 printf " dev-tools cli-generate-help\n"
681 printf " dev-tools cli-generate-help --help | -h\n"
696 printf " dev-tools cli-generate-help --help | -h\n"
682 echo
697 echo
683
698
684 # :command.long_usage
699 # :command.long_usage
685 if [[ -n $long_usage ]]; then
700 if [[ -n $long_usage ]]; then
686 printf "%s\n" "Options:"
701 printf "%s\n" "Options:"
687
702
688 # :command.usage_fixed_flags
703 # :command.usage_fixed_flags
689 printf " %s\n" "--help, -h"
704 printf " %s\n" "--help, -h"
690 printf " Show this help\n"
705 printf " Show this help\n"
691 echo
706 echo
692
707
693 fi
708 fi
694 }
709 }
695
710
696 # :command.usage
711 # :command.usage
697 dev_tools_stack_cli_version_usage() {
712 dev_tools_stack_cli_version_usage() {
698 if [[ -n $long_usage ]]; then
713 if [[ -n $long_usage ]]; then
699 printf "dev-tools stack-cli-version - set the version for rcstack\n"
714 printf "dev-tools stack-cli-version - set the version for rcstack\n"
700 echo
715 echo
701
716
702 else
717 else
703 printf "dev-tools stack-cli-version - set the version for rcstack\n"
718 printf "dev-tools stack-cli-version - set the version for rcstack\n"
704 echo
719 echo
705
720
706 fi
721 fi
707
722
708 printf "%s\n" "Usage:"
723 printf "%s\n" "Usage:"
709 printf " dev-tools stack-cli-version VERSION\n"
724 printf " dev-tools stack-cli-version VERSION\n"
710 printf " dev-tools stack-cli-version --help | -h\n"
725 printf " dev-tools stack-cli-version --help | -h\n"
711 echo
726 echo
712
727
713 # :command.long_usage
728 # :command.long_usage
714 if [[ -n $long_usage ]]; then
729 if [[ -n $long_usage ]]; then
715 printf "%s\n" "Options:"
730 printf "%s\n" "Options:"
716
731
717 # :command.usage_fixed_flags
732 # :command.usage_fixed_flags
718 printf " %s\n" "--help, -h"
733 printf " %s\n" "--help, -h"
719 printf " Show this help\n"
734 printf " Show this help\n"
720 echo
735 echo
721
736
722 # :command.usage_args
737 # :command.usage_args
723 printf "%s\n" "Arguments:"
738 printf "%s\n" "Arguments:"
724
739
725 # :argument.usage
740 # :argument.usage
726 printf " %s\n" "VERSION"
741 printf " %s\n" "VERSION"
727 printf " Version to set e.g '5.0.0'\n"
742 printf " Version to set e.g '5.0.0'\n"
728 echo
743 echo
729
744
730 fi
745 fi
731 }
746 }
732
747
733 # :command.usage
748 # :command.usage
734 dev_tools_stack_image_version_usage() {
749 dev_tools_stack_image_version_usage() {
735 if [[ -n $long_usage ]]; then
750 if [[ -n $long_usage ]]; then
736 printf "dev-tools stack-image-version - set the version for rcstack docker image\n"
751 printf "dev-tools stack-image-version - set the version for rcstack docker image\n"
737 echo
752 echo
738
753
739 else
754 else
740 printf "dev-tools stack-image-version - set the version for rcstack docker image\n"
755 printf "dev-tools stack-image-version - set the version for rcstack docker image\n"
741 echo
756 echo
742
757
743 fi
758 fi
744
759
745 printf "%s\n" "Usage:"
760 printf "%s\n" "Usage:"
746 printf " dev-tools stack-image-version VERSION\n"
761 printf " dev-tools stack-image-version VERSION\n"
747 printf " dev-tools stack-image-version --help | -h\n"
762 printf " dev-tools stack-image-version --help | -h\n"
748 echo
763 echo
749
764
750 # :command.long_usage
765 # :command.long_usage
751 if [[ -n $long_usage ]]; then
766 if [[ -n $long_usage ]]; then
752 printf "%s\n" "Options:"
767 printf "%s\n" "Options:"
753
768
754 # :command.usage_fixed_flags
769 # :command.usage_fixed_flags
755 printf " %s\n" "--help, -h"
770 printf " %s\n" "--help, -h"
756 printf " Show this help\n"
771 printf " Show this help\n"
757 echo
772 echo
758
773
759 # :command.usage_args
774 # :command.usage_args
760 printf "%s\n" "Arguments:"
775 printf "%s\n" "Arguments:"
761
776
762 # :argument.usage
777 # :argument.usage
763 printf " %s\n" "VERSION"
778 printf " %s\n" "VERSION"
764 printf " Version to set e.g '5.0.0'\n"
779 printf " Version to set e.g '5.0.0'\n"
765 echo
780 echo
766
781
767 fi
782 fi
768 }
783 }
769
784
770 # :command.usage
785 # :command.usage
771 dev_tools_cli_generate_rc_usage() {
786 dev_tools_cli_generate_rc_usage() {
772 if [[ -n $long_usage ]]; then
787 if [[ -n $long_usage ]]; then
773 printf "dev-tools cli-generate-rc - run a ./rcstack generation script\n"
788 printf "dev-tools cli-generate-rc - run a ./rcstack generation script\n"
774 echo
789 echo
775
790
776 else
791 else
777 printf "dev-tools cli-generate-rc - run a ./rcstack generation script\n"
792 printf "dev-tools cli-generate-rc - run a ./rcstack generation script\n"
778 echo
793 echo
779
794
780 fi
795 fi
781
796
782 printf "%s\n" "Usage:"
797 printf "%s\n" "Usage:"
783 printf " dev-tools cli-generate-rc [OPTIONS]\n"
798 printf " dev-tools cli-generate-rc [OPTIONS]\n"
784 printf " dev-tools cli-generate-rc --help | -h\n"
799 printf " dev-tools cli-generate-rc --help | -h\n"
785 echo
800 echo
786
801
787 # :command.long_usage
802 # :command.long_usage
788 if [[ -n $long_usage ]]; then
803 if [[ -n $long_usage ]]; then
789 printf "%s\n" "Options:"
804 printf "%s\n" "Options:"
790
805
791 # :command.usage_flags
806 # :command.usage_flags
792 # :flag.usage
807 # :flag.usage
793 printf " %s\n" "--one-time, -o"
808 printf " %s\n" "--one-time, -o"
794 printf " run the command a single time without watch\n"
809 printf " run the command a single time without watch\n"
795 echo
810 echo
796
811
797 # :command.usage_fixed_flags
812 # :command.usage_fixed_flags
798 printf " %s\n" "--help, -h"
813 printf " %s\n" "--help, -h"
799 printf " Show this help\n"
814 printf " Show this help\n"
800 echo
815 echo
801
816
802 fi
817 fi
803 }
818 }
804
819
805 # :command.usage
820 # :command.usage
806 dev_tools_cli_generate_dev_usage() {
821 dev_tools_cli_generate_dev_usage() {
807 if [[ -n $long_usage ]]; then
822 if [[ -n $long_usage ]]; then
808 printf "dev-tools cli-generate-dev - run a ./dev-tools generation script\n"
823 printf "dev-tools cli-generate-dev - run a ./dev-tools generation script\n"
809 echo
824 echo
810
825
811 else
826 else
812 printf "dev-tools cli-generate-dev - run a ./dev-tools generation script\n"
827 printf "dev-tools cli-generate-dev - run a ./dev-tools generation script\n"
813 echo
828 echo
814
829
815 fi
830 fi
816
831
817 printf "%s\n" "Usage:"
832 printf "%s\n" "Usage:"
818 printf " dev-tools cli-generate-dev [OPTIONS]\n"
833 printf " dev-tools cli-generate-dev [OPTIONS]\n"
819 printf " dev-tools cli-generate-dev --help | -h\n"
834 printf " dev-tools cli-generate-dev --help | -h\n"
820 echo
835 echo
821
836
822 # :command.long_usage
837 # :command.long_usage
823 if [[ -n $long_usage ]]; then
838 if [[ -n $long_usage ]]; then
824 printf "%s\n" "Options:"
839 printf "%s\n" "Options:"
825
840
826 # :command.usage_flags
841 # :command.usage_flags
827 # :flag.usage
842 # :flag.usage
828 printf " %s\n" "--one-time, -o"
843 printf " %s\n" "--one-time, -o"
829 printf " run the command a single time without watch\n"
844 printf " run the command a single time without watch\n"
830 echo
845 echo
831
846
832 # :command.usage_fixed_flags
847 # :command.usage_fixed_flags
833 printf " %s\n" "--help, -h"
848 printf " %s\n" "--help, -h"
834 printf " Show this help\n"
849 printf " Show this help\n"
835 echo
850 echo
836
851
837 fi
852 fi
838 }
853 }
839
854
840 # :command.usage
855 # :command.usage
841 dev_tools_get_build_artifacts_usage() {
856 dev_tools_get_build_artifacts_usage() {
842 if [[ -n $long_usage ]]; then
857 if [[ -n $long_usage ]]; then
843 printf "dev-tools get-build-artifacts - Fetch Artifacts to run installer based build\n"
858 printf "dev-tools get-build-artifacts - Fetch Artifacts to run installer based build\n"
844 echo
859 echo
845
860
846 else
861 else
847 printf "dev-tools get-build-artifacts - Fetch Artifacts to run installer based build\n"
862 printf "dev-tools get-build-artifacts - Fetch Artifacts to run installer based build\n"
848 echo
863 echo
849
864
850 fi
865 fi
851
866
852 printf "%s\n" "Usage:"
867 printf "%s\n" "Usage:"
853 printf " dev-tools get-build-artifacts [OPTIONS]\n"
868 printf " dev-tools get-build-artifacts [OPTIONS]\n"
854 printf " dev-tools get-build-artifacts --help | -h\n"
869 printf " dev-tools get-build-artifacts --help | -h\n"
855 echo
870 echo
856
871
857 # :command.long_usage
872 # :command.long_usage
858 if [[ -n $long_usage ]]; then
873 if [[ -n $long_usage ]]; then
859 printf "%s\n" "Options:"
874 printf "%s\n" "Options:"
860
875
861 # :command.usage_flags
876 # :command.usage_flags
862 # :flag.usage
877 # :flag.usage
863 printf " %s\n" "--auth AUTH"
878 printf " %s\n" "--auth AUTH"
864 printf " Specify custom auth for curl e.g -u admin:secret\n"
879 printf " Specify custom auth for curl e.g -u admin:secret\n"
865 printf " Default: \n"
880 printf " Default: \n"
866 echo
881 echo
867
882
868 # :flag.usage
883 # :flag.usage
869 printf " %s\n" "--installer-url INSTALLER_URL"
884 printf " %s\n" "--installer-url INSTALLER_URL"
870 printf " Installer Download URL\n"
885 printf " Installer Download URL\n"
871 printf " Default: https://dls.rhodecode.com/dls/N2E2ZTY1NzA3NjYxNDA2NTc1NjI3MTcyNzA2MjcxNzIyZTcwNjI3YQ==/rhodecode-control/latest-linux-ee\n"
886 printf " Default: https://dls.rhodecode.com/dls/N2E2ZTY1NzA3NjYxNDA2NTc1NjI3MTcyNzA2MjcxNzIyZTcwNjI3YQ==/rhodecode-control/latest-linux-ee\n"
872 echo
887 echo
873
888
874 # :flag.usage
889 # :flag.usage
875 printf " %s\n" "--manifest-url MANIFEST_URL"
890 printf " %s\n" "--manifest-url MANIFEST_URL"
876 printf " Manifest file url\n"
891 printf " Manifest file url\n"
877 printf " Default: https://dls.rhodecode.com/linux/MANIFEST\n"
892 printf " Default: https://dls.rhodecode.com/linux/MANIFEST\n"
878 echo
893 echo
879
894
880 # :flag.usage
895 # :flag.usage
881 printf " %s\n" "--version-name VERSION_NAME"
896 printf " %s\n" "--version-name VERSION_NAME"
882 printf " Specify custom build ver e.g 4.27.0\n"
897 printf " Specify custom build ver e.g 4.27.0\n"
883 printf " Default: $RC_CLI_VERSION_NAME\n"
898 printf " Default: $RC_CLI_VERSION_NAME\n"
884 echo
899 echo
885
900
886 # :command.usage_fixed_flags
901 # :command.usage_fixed_flags
887 printf " %s\n" "--help, -h"
902 printf " %s\n" "--help, -h"
888 printf " Show this help\n"
903 printf " Show this help\n"
889 echo
904 echo
890
905
891 fi
906 fi
892 }
907 }
893
908
894 # :command.usage
909 # :command.usage
895 dev_tools_build_installer_usage() {
910 dev_tools_build_installer_usage() {
896 if [[ -n $long_usage ]]; then
911 if [[ -n $long_usage ]]; then
897 printf "dev-tools build-installer - Build RhodeCode image from installer, ./dev-tools get-build-artifacts initially\n"
912 printf "dev-tools build-installer - Build RhodeCode image from installer, ./dev-tools get-build-artifacts initially\n"
898 echo
913 echo
899
914
900 else
915 else
901 printf "dev-tools build-installer - Build RhodeCode image from installer, ./dev-tools get-build-artifacts initially\n"
916 printf "dev-tools build-installer - Build RhodeCode image from installer, ./dev-tools get-build-artifacts initially\n"
902 echo
917 echo
903
918
904 fi
919 fi
905
920
906 printf "%s\n" "Usage:"
921 printf "%s\n" "Usage:"
907 printf " dev-tools build-installer [OPTIONS]\n"
922 printf " dev-tools build-installer [OPTIONS]\n"
908 printf " dev-tools build-installer --help | -h\n"
923 printf " dev-tools build-installer --help | -h\n"
909 echo
924 echo
910
925
911 # :command.long_usage
926 # :command.long_usage
912 if [[ -n $long_usage ]]; then
927 if [[ -n $long_usage ]]; then
913 printf "%s\n" "Options:"
928 printf "%s\n" "Options:"
914
929
915 # :command.usage_flags
930 # :command.usage_flags
916 # :flag.usage
931 # :flag.usage
917 printf " %s\n" "--version-name VERSION_NAME"
932 printf " %s\n" "--version-name VERSION_NAME"
918 printf " Specify custom build ver e.g 4.27.0\n"
933 printf " Specify custom build ver e.g 4.27.0\n"
919 printf " Default: $RC_CLI_VERSION_NAME\n"
934 printf " Default: $RC_CLI_VERSION_NAME\n"
920 echo
935 echo
921
936
922 # :command.usage_fixed_flags
937 # :command.usage_fixed_flags
923 printf " %s\n" "--help, -h"
938 printf " %s\n" "--help, -h"
924 printf " Show this help\n"
939 printf " Show this help\n"
925 echo
940 echo
926
941
927 fi
942 fi
928 }
943 }
929
944
930 # :command.usage
945 # :command.usage
931 dev_tools_get_build_source_usage() {
946 dev_tools_get_build_source_usage() {
932 if [[ -n $long_usage ]]; then
947 if [[ -n $long_usage ]]; then
933 printf "dev-tools get-build-source - Fetch RhodeCode sources, store in .source dir to run a source-based builds\n"
948 printf "dev-tools get-build-source - Fetch RhodeCode sources, store in .source dir to run a source-based builds\n"
934 echo
949 echo
935
950
936 else
951 else
937 printf "dev-tools get-build-source - Fetch RhodeCode sources, store in .source dir to run a source-based builds\n"
952 printf "dev-tools get-build-source - Fetch RhodeCode sources, store in .source dir to run a source-based builds\n"
938 echo
953 echo
939
954
940 fi
955 fi
941
956
942 printf "%s\n" "Usage:"
957 printf "%s\n" "Usage:"
943 printf " dev-tools get-build-source [OPTIONS]\n"
958 printf " dev-tools get-build-source [OPTIONS]\n"
944 printf " dev-tools get-build-source --help | -h\n"
959 printf " dev-tools get-build-source --help | -h\n"
945 echo
960 echo
946
961
947 # :command.long_usage
962 # :command.long_usage
948 if [[ -n $long_usage ]]; then
963 if [[ -n $long_usage ]]; then
949 printf "%s\n" "Options:"
964 printf "%s\n" "Options:"
950
965
951 # :command.usage_flags
966 # :command.usage_flags
952 # :flag.usage
967 # :flag.usage
953 printf " %s\n" "--revision REVISION"
968 printf " %s\n" "--revision REVISION"
954 printf " revision to download\n"
969 printf " revision to download\n"
955 printf " Default: default\n"
970 printf " Default: default\n"
956 echo
971 echo
957
972
958 # :flag.usage
973 # :flag.usage
959 printf " %s\n" "--source-dir SOURCE_DIR"
974 printf " %s\n" "--source-dir SOURCE_DIR"
960 printf " dir to store the downloaded source code\n"
975 printf " dir to store the downloaded source code\n"
961 printf " Default: $PWD/.source\n"
976 printf " Default: $PWD/.source\n"
962 echo
977 echo
963
978
964 # :flag.usage
979 # :flag.usage
965 printf " %s\n" "--auth-token AUTH_TOKEN"
980 printf " %s\n" "--auth-token AUTH_TOKEN"
966 printf " Specify AUTH TOKEN to obtain sources\n"
981 printf " Specify AUTH TOKEN to obtain sources\n"
967 echo
982 echo
968
983
969 # :flag.usage
984 # :flag.usage
970 printf " %s\n" "--server-url SERVER_URL"
985 printf " %s\n" "--server-url SERVER_URL"
971 printf " Specify RhodeCode server location where projects should be downloaded\n"
986 printf " Specify RhodeCode server location where projects should be downloaded\n"
972 printf " Default: https://code.rhodecode.com\n"
987 printf " Default: https://code.rhodecode.com\n"
973 echo
988 echo
974
989
975 # :command.usage_fixed_flags
990 # :command.usage_fixed_flags
976 printf " %s\n" "--help, -h"
991 printf " %s\n" "--help, -h"
977 printf " Show this help\n"
992 printf " Show this help\n"
978 echo
993 echo
979
994
980 # :command.usage_examples
995 # :command.usage_examples
981 printf "%s\n" "Examples:"
996 printf "%s\n" "Examples:"
982 printf " ./dev-tools get-sources $RC_CLI_VERSION_NAME\n"
997 printf " ./dev-tools get-sources $RC_CLI_VERSION_NAME\n"
983 printf " ./dev-tools get-sources default --auth-token xyxyxyx --server-url\n https://secret.repo/\n"
998 printf " ./dev-tools get-sources default --auth-token xyxyxyx --server-url\n https://secret.repo/\n"
984 echo
999 echo
985
1000
986 fi
1001 fi
987 }
1002 }
988
1003
989 # :command.usage
1004 # :command.usage
990 dev_tools_build_source_usage() {
1005 dev_tools_build_source_usage() {
991 if [[ -n $long_usage ]]; then
1006 if [[ -n $long_usage ]]; then
992 printf "dev-tools build-source - Build RhodeCode image from source, requires ./dev-tools get-build-source initially\n"
1007 printf "dev-tools build-source - Build RhodeCode image from source, requires ./dev-tools get-build-source initially\n"
993 echo
1008 echo
994
1009
995 else
1010 else
996 printf "dev-tools build-source - Build RhodeCode image from source, requires ./dev-tools get-build-source initially\n"
1011 printf "dev-tools build-source - Build RhodeCode image from source, requires ./dev-tools get-build-source initially\n"
997 echo
1012 echo
998
1013
999 fi
1014 fi
1000
1015
1001 printf "%s\n" "Usage:"
1016 printf "%s\n" "Usage:"
1002 printf " dev-tools build-source [OPTIONS]\n"
1017 printf " dev-tools build-source [OPTIONS]\n"
1003 printf " dev-tools build-source --help | -h\n"
1018 printf " dev-tools build-source --help | -h\n"
1004 echo
1019 echo
1005
1020
1006 # :command.long_usage
1021 # :command.long_usage
1007 if [[ -n $long_usage ]]; then
1022 if [[ -n $long_usage ]]; then
1008 printf "%s\n" "Options:"
1023 printf "%s\n" "Options:"
1009
1024
1010 # :command.usage_flags
1025 # :command.usage_flags
1011 # :flag.usage
1026 # :flag.usage
1012 printf " %s\n" "--version-name VERSION_NAME"
1027 printf " %s\n" "--version-name VERSION_NAME"
1013 printf " Specify custom build ver e.g 4.27.0\n"
1028 printf " Specify custom build ver e.g 4.27.0\n"
1014 printf " Default: $RC_CLI_VERSION_NAME\n"
1029 printf " Default: $RC_CLI_VERSION_NAME\n"
1015 echo
1030 echo
1016
1031
1017 # :flag.usage
1032 # :flag.usage
1018 printf " %s\n" "--source-build-yaml BUILD_SOURCE_YAML"
1033 printf " %s\n" "--source-build-yaml BUILD_SOURCE_YAML"
1019 printf " yaml file to build source against\n"
1034 printf " yaml file to build source against\n"
1020 printf " Default: build_yaml/docker-compose-apps.5.yaml\n"
1035 printf " Default: build_yaml/docker-compose-apps.5.yaml\n"
1021 echo
1036 echo
1022
1037
1023 # :flag.usage
1038 # :flag.usage
1024 printf " %s\n" "--tag TAG (repeatable)"
1039 printf " %s\n" "--tag TAG (repeatable)"
1025 printf " tag build image\n"
1040 printf " tag build image\n"
1026 echo
1041 echo
1027
1042
1028 # :command.usage_fixed_flags
1043 # :command.usage_fixed_flags
1029 printf " %s\n" "--help, -h"
1044 printf " %s\n" "--help, -h"
1030 printf " Show this help\n"
1045 printf " Show this help\n"
1031 echo
1046 echo
1032
1047
1033 # :command.usage_examples
1048 # :command.usage_examples
1034 printf "%s\n" "Examples:"
1049 printf "%s\n" "Examples:"
1035 printf " ./dev-tools build-source --source-build-yaml\n build_yaml/docker-compose-apps.5.yaml --version-name 5.0.0.beta1 --tag beta\n"
1050 printf " ./dev-tools build-source --source-build-yaml\n build_yaml/docker-compose-apps.5.yaml --version-name 5.0.0.beta1 --tag beta\n"
1036 printf " ./dev-tools build-source --source-build-yaml\n build_yaml/docker-compose-apps.4.yaml --version-name 4.28.0 --tag stable\n"
1051 printf " ./dev-tools build-source --source-build-yaml\n build_yaml/docker-compose-apps.4.yaml --version-name 4.28.0 --tag stable\n"
1037 echo
1052 echo
1038
1053
1039 fi
1054 fi
1040 }
1055 }
1041
1056
1042 # :command.normalize_input
1057 # :command.normalize_input
1043 normalize_input() {
1058 normalize_input() {
1044 local arg flags
1059 local arg flags
1045
1060
1046 while [[ $# -gt 0 ]]; do
1061 while [[ $# -gt 0 ]]; do
1047 arg="$1"
1062 arg="$1"
1048 if [[ $arg =~ ^(--[a-zA-Z0-9_\-]+)=(.+)$ ]]; then
1063 if [[ $arg =~ ^(--[a-zA-Z0-9_\-]+)=(.+)$ ]]; then
1049 input+=("${BASH_REMATCH[1]}")
1064 input+=("${BASH_REMATCH[1]}")
1050 input+=("${BASH_REMATCH[2]}")
1065 input+=("${BASH_REMATCH[2]}")
1051 elif [[ $arg =~ ^(-[a-zA-Z0-9])=(.+)$ ]]; then
1066 elif [[ $arg =~ ^(-[a-zA-Z0-9])=(.+)$ ]]; then
1052 input+=("${BASH_REMATCH[1]}")
1067 input+=("${BASH_REMATCH[1]}")
1053 input+=("${BASH_REMATCH[2]}")
1068 input+=("${BASH_REMATCH[2]}")
1054 elif [[ $arg =~ ^-([a-zA-Z0-9][a-zA-Z0-9]+)$ ]]; then
1069 elif [[ $arg =~ ^-([a-zA-Z0-9][a-zA-Z0-9]+)$ ]]; then
1055 flags="${BASH_REMATCH[1]}"
1070 flags="${BASH_REMATCH[1]}"
1056 for ((i = 0; i < ${#flags}; i++)); do
1071 for ((i = 0; i < ${#flags}; i++)); do
1057 input+=("-${flags:i:1}")
1072 input+=("-${flags:i:1}")
1058 done
1073 done
1059 else
1074 else
1060 input+=("$arg")
1075 input+=("$arg")
1061 fi
1076 fi
1062
1077
1063 shift
1078 shift
1064 done
1079 done
1065 }
1080 }
1066 # :command.inspect_args
1081 # :command.inspect_args
1067 inspect_args() {
1082 inspect_args() {
1068 if ((${#args[@]})); then
1083 if ((${#args[@]})); then
1069 readarray -t sorted_keys < <(printf '%s\n' "${!args[@]}" | sort)
1084 readarray -t sorted_keys < <(printf '%s\n' "${!args[@]}" | sort)
1070 echo args:
1085 echo args:
1071 for k in "${sorted_keys[@]}"; do echo "- \${args[$k]} = ${args[$k]}"; done
1086 for k in "${sorted_keys[@]}"; do echo "- \${args[$k]} = ${args[$k]}"; done
1072 else
1087 else
1073 echo args: none
1088 echo args: none
1074 fi
1089 fi
1075
1090
1076 if ((${#other_args[@]})); then
1091 if ((${#other_args[@]})); then
1077 echo
1092 echo
1078 echo other_args:
1093 echo other_args:
1079 echo "- \${other_args[*]} = ${other_args[*]}"
1094 echo "- \${other_args[*]} = ${other_args[*]}"
1080 for i in "${!other_args[@]}"; do
1095 for i in "${!other_args[@]}"; do
1081 echo "- \${other_args[$i]} = ${other_args[$i]}"
1096 echo "- \${other_args[$i]} = ${other_args[$i]}"
1082 done
1097 done
1083 fi
1098 fi
1084
1099
1085 if ((${#deps[@]})); then
1100 if ((${#deps[@]})); then
1086 readarray -t sorted_keys < <(printf '%s\n' "${!deps[@]}" | sort)
1101 readarray -t sorted_keys < <(printf '%s\n' "${!deps[@]}" | sort)
1087 echo
1102 echo
1088 echo deps:
1103 echo deps:
1089 for k in "${sorted_keys[@]}"; do echo "- \${deps[$k]} = ${deps[$k]}"; done
1104 for k in "${sorted_keys[@]}"; do echo "- \${deps[$k]} = ${deps[$k]}"; done
1090 fi
1105 fi
1091
1106
1092 }
1107 }
1093
1108
1094 # :command.command_functions
1109 # :command.command_functions
1095 # :command.function
1110 # :command.function
1096 dev_tools_vcs_command() {
1111 dev_tools_vcs_command() {
1097 # src/vcs_command.sh
1112 # src/vcs_command.sh
1098 if [[ -v WORKSPACE_HOME ]];
1113 if [[ -v WORKSPACE_HOME ]];
1099 then
1114 then
1100 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1115 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1101 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1116 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1102 else
1117 else
1103 echo "WORKSPACE_HOME env var is not set"
1118 echo "WORKSPACE_HOME env var is not set"
1104 exit 1
1119 exit 1
1105 fi
1120 fi
1106
1121
1107 RUN_WITHOUT_TTY=${args[--no-tty]}
1122 RUN_WITHOUT_TTY=${args[--no-tty]}
1108 code_workdir=${args[--workdir]}
1123 code_workdir=${args[--workdir]}
1109 cmd_script=${args[--cmd]}
1124 cmd_script=${args[--cmd]}
1110
1125
1111 exec_script=$WORKSPACE_HOME/$cmd_script
1126 exec_script=$WORKSPACE_HOME/$cmd_script
1112 container_name=dev-vcsserver
1127 container_name=dev-vcsserver
1113 env_file=".custom/.dev.env"
1128 env_file=".custom/.dev.env"
1114
1129
1115 RC_DEV_CMD_HELP="make dev-srv"
1130 RC_DEV_CMD_HELP="make dev-srv"
1116
1131
1117 if [[ ! -f $exec_script ]]; then
1132 if [[ ! -f $exec_script ]]; then
1118 echo "Generating new $exec_script file..."
1133 echo "Generating new $exec_script file..."
1119 mkdir -p $(dirname $exec_script)
1134 mkdir -p $(dirname $exec_script)
1120
1135
1121 cat <<< "
1136 cat <<< "
1122 # Generated dev-env script for rhodecode-vcsserver
1137 # Generated dev-env script for rhodecode-vcsserver
1123
1138
1124 echo \"Run vcsserver dev using the following command:\"
1139 echo \"Run vcsserver dev using the following command:\"
1125 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1140 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1126 echo \"$RC_DEV_CMD_HELP\"
1141 echo \"$RC_DEV_CMD_HELP\"
1127 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1142 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1128 make sh
1143 make sh
1129 " > $exec_script
1144 " > $exec_script
1130 chmod +x $exec_script
1145 chmod +x $exec_script
1131 fi
1146 fi
1132 echo "Using exec script: $exec_script"
1147 echo "Using exec script: $exec_script"
1133
1148
1134 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1149 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1135
1150
1136 INTERACTIVE_FLAGS="--interactive --tty"
1151 INTERACTIVE_FLAGS="--interactive --tty"
1137 if [[ $RUN_WITHOUT_TTY ]]; then
1152 if [[ $RUN_WITHOUT_TTY ]]; then
1138 INTERACTIVE_FLAGS="--interactive"
1153 INTERACTIVE_FLAGS="--interactive"
1139 fi
1154 fi
1140
1155
1141 eval "
1156 eval "
1142 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1157 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1143 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1158 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1144 run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1159 run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1145 --workdir=\"$code_workdir\" \
1160 --workdir=\"$code_workdir\" \
1146 --name=\"$container_name\" \
1161 --name=\"$container_name\" \
1147 $INTERACTIVE_FLAGS \
1162 $INTERACTIVE_FLAGS \
1148 --publish 10010:10010 \
1163 --publish 10010:10010 \
1149 vcsserver bash $docker_exec_script"
1164 vcsserver bash $docker_exec_script"
1150
1165
1151 }
1166 }
1152
1167
1153 # :command.function
1168 # :command.function
1154 dev_tools_ce_command() {
1169 dev_tools_ce_command() {
1155 # src/ce_command.sh
1170 # src/ce_command.sh
1156 if [[ -v WORKSPACE_HOME ]];
1171 if [[ -v WORKSPACE_HOME ]];
1157 then
1172 then
1158 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1173 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1159 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1174 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1160 else
1175 else
1161 echo "WORKSPACE_HOME env var is not set"
1176 echo "WORKSPACE_HOME env var is not set"
1162 exit 1
1177 exit 1
1163 fi
1178 fi
1164
1179
1165 RUN_WITHOUT_TTY=${args[--no-tty]}
1180 RUN_WITHOUT_TTY=${args[--no-tty]}
1166 code_workdir=${args[--workdir]}
1181 code_workdir=${args[--workdir]}
1167 cmd_script=${args[--cmd]}
1182 cmd_script=${args[--cmd]}
1168
1183
1169 exec_script=$WORKSPACE_HOME/$cmd_script
1184 exec_script=$WORKSPACE_HOME/$cmd_script
1170 container_name=dev-enterprise-ce
1185 container_name=dev-enterprise-ce
1171 env_file=".custom/.dev.env"
1186 env_file=".custom/.dev.env"
1172
1187
1173 RC_DEV_CMD_HELP="make dev-srv"
1188 RC_DEV_CMD_HELP="make dev-srv"
1174
1189
1175 if [[ ! -f $exec_script ]]; then
1190 if [[ ! -f $exec_script ]]; then
1176 echo "Generating new $exec_script file..."
1191 echo "Generating new $exec_script file..."
1177 mkdir -p $(dirname $exec_script)
1192 mkdir -p $(dirname $exec_script)
1178
1193
1179 cat <<< "
1194 cat <<< "
1180 # Generated dev-env script for rhodecode-enterprise-ce
1195 # Generated dev-env script for rhodecode-enterprise-ce
1181
1196
1182 echo \"Run rhodecode-enterprise-ce dev using the following command:\"
1197 echo \"Run rhodecode-enterprise-ce dev using the following command:\"
1183 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1198 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1184 echo \"$RC_DEV_CMD_HELP\"
1199 echo \"$RC_DEV_CMD_HELP\"
1185 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1200 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1186 make sh
1201 make sh
1187 " > $exec_script
1202 " > $exec_script
1188 chmod +x $exec_script
1203 chmod +x $exec_script
1189 fi
1204 fi
1190 echo "Using exec script: $exec_script"
1205 echo "Using exec script: $exec_script"
1191
1206
1192 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1207 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1193
1208
1194 INTERACTIVE_FLAGS="--interactive --tty"
1209 INTERACTIVE_FLAGS="--interactive --tty"
1195 if [[ $RUN_WITHOUT_TTY ]]; then
1210 if [[ $RUN_WITHOUT_TTY ]]; then
1196 INTERACTIVE_FLAGS="--interactive"
1211 INTERACTIVE_FLAGS="--interactive"
1197 fi
1212 fi
1198
1213
1199 eval "
1214 eval "
1200 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1215 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1201 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1216 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1202 run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1217 run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1203 --workdir=\"$code_workdir\" \
1218 --workdir=\"$code_workdir\" \
1204 --name=\"$container_name\" \
1219 --name=\"$container_name\" \
1205 $INTERACTIVE_FLAGS \
1220 $INTERACTIVE_FLAGS \
1206 --publish 10020:10020 \
1221 --publish 10020:10020 \
1207 rhodecode bash $docker_exec_script"
1222 rhodecode bash $docker_exec_script"
1208
1223
1209 }
1224 }
1210
1225
1211 # :command.function
1226 # :command.function
1212 dev_tools_ee_command() {
1227 dev_tools_ee_command() {
1213 # src/ee_command.sh
1228 # src/ee_command.sh
1214 if [[ -v WORKSPACE_HOME ]];
1229 if [[ -v WORKSPACE_HOME ]];
1215 then
1230 then
1216 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1231 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1217 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1232 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1218 else
1233 else
1219 echo "WORKSPACE_HOME env var is not set"
1234 echo "WORKSPACE_HOME env var is not set"
1220 exit 1
1235 exit 1
1221 fi
1236 fi
1222
1237
1223 RUN_WITHOUT_TTY=${args[--no-tty]}
1238 RUN_WITHOUT_TTY=${args[--no-tty]}
1224 code_workdir=${args[--workdir]}
1239 code_workdir=${args[--workdir]}
1225 cmd_script=${args[--cmd]}
1240 cmd_script=${args[--cmd]}
1226
1241
1227 exec_script=$WORKSPACE_HOME/$cmd_script
1242 exec_script=$WORKSPACE_HOME/$cmd_script
1228 container_name=dev-enterprise-ee
1243 container_name=dev-enterprise-ee
1229 env_file=".custom/.dev.env"
1244 env_file=".custom/.dev.env"
1230
1245
1231 RC_DEV_CMD_HELP="make dev-srv"
1246 RC_DEV_CMD_HELP="make dev-srv"
1232
1247
1233 if [[ ! -f $exec_script ]]; then
1248 if [[ ! -f $exec_script ]]; then
1234 echo "Generating new $exec_script file..."
1249 echo "Generating new $exec_script file..."
1235 mkdir -p $(dirname $exec_script)
1250 mkdir -p $(dirname $exec_script)
1236
1251
1237 cat <<< "
1252 cat <<< "
1238 # Generated dev-env script for rhodecode-enterprise-ee
1253 # Generated dev-env script for rhodecode-enterprise-ee
1239
1254
1240 echo \"Run rhodecode-enterprise-ee dev using the following command:\"
1255 echo \"Run rhodecode-enterprise-ee dev using the following command:\"
1241 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1256 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1242 echo \"$RC_DEV_CMD_HELP\"
1257 echo \"$RC_DEV_CMD_HELP\"
1243 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1258 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1244 make sh
1259 make sh
1245 " > $exec_script
1260 " > $exec_script
1246 chmod +x $exec_script
1261 chmod +x $exec_script
1247 fi
1262 fi
1248 echo "Using exec script: $exec_script"
1263 echo "Using exec script: $exec_script"
1249
1264
1250 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1265 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1251
1266
1252 INTERACTIVE_FLAGS="--interactive --tty"
1267 INTERACTIVE_FLAGS="--interactive --tty"
1253 if [[ $RUN_WITHOUT_TTY ]]; then
1268 if [[ $RUN_WITHOUT_TTY ]]; then
1254 INTERACTIVE_FLAGS="--interactive"
1269 INTERACTIVE_FLAGS="--interactive"
1255 fi
1270 fi
1256
1271
1257 eval "
1272 eval "
1258 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1273 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1259 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1274 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1260 run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1275 run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1261 --workdir=\"$code_workdir\" \
1276 --workdir=\"$code_workdir\" \
1262 --name=\"$container_name\" \
1277 --name=\"$container_name\" \
1263 $INTERACTIVE_FLAGS \
1278 $INTERACTIVE_FLAGS \
1264 --publish 10020:10020 \
1279 --publish 10020:10020 \
1265 rhodecode bash $docker_exec_script"
1280 rhodecode bash $docker_exec_script"
1266
1281
1267 }
1282 }
1268
1283
1269 # :command.function
1284 # :command.function
1270 dev_tools_celery_command() {
1285 dev_tools_celery_command() {
1271 # src/celery_command.sh
1286 # src/celery_command.sh
1272 if [[ -v WORKSPACE_HOME ]];
1287 if [[ -v WORKSPACE_HOME ]];
1273 then
1288 then
1274 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1289 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1275 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1290 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1276 else
1291 else
1277 echo "WORKSPACE_HOME env var is not set"
1292 echo "WORKSPACE_HOME env var is not set"
1278 exit 1
1293 exit 1
1279 fi
1294 fi
1280
1295
1281 code_workdir=${args[--workdir]}
1296 code_workdir=${args[--workdir]}
1282 cmd_script=${args[--cmd]}
1297 cmd_script=${args[--cmd]}
1283
1298
1284 exec_script=$WORKSPACE_HOME/$cmd_script
1299 exec_script=$WORKSPACE_HOME/$cmd_script
1285 container_name=dev-celery
1300 container_name=dev-celery
1286 env_file=".custom/.dev.env"
1301 env_file=".custom/.dev.env"
1287
1302
1288 echo "Using exec script: $exec_script"
1303 echo "Using exec script: $exec_script"
1289
1304
1290 RC_DEV_CMD_HELP="celery --no-color --app=rhodecode.lib.celerylib.loader worker --autoscale=4,2 --max-tasks-per-child=100 --task-events --loglevel=DEBUG --ini=.dev/dev.ini"
1305 RC_DEV_CMD_HELP="celery --no-color --app=rhodecode.lib.celerylib.loader worker --autoscale=4,2 --max-tasks-per-child=100 --task-events --loglevel=DEBUG --ini=.dev/dev.ini"
1291
1306
1292 if [[ ! -f $exec_script ]]; then
1307 if [[ ! -f $exec_script ]]; then
1293 echo "Generating new $exec_script file..."
1308 echo "Generating new $exec_script file..."
1294 mkdir -p $(dirname $exec_script)
1309 mkdir -p $(dirname $exec_script)
1295
1310
1296 cat <<< "
1311 cat <<< "
1297 # Generated dev-env script for celery
1312 # Generated dev-env script for celery
1298
1313
1299 echo \"Run celery dev using the following command:\"
1314 echo \"Run celery dev using the following command:\"
1300 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1315 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1301 echo \"$RC_DEV_CMD_HELP\"
1316 echo \"$RC_DEV_CMD_HELP\"
1302 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1317 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1303 make sh
1318 make sh
1304 " > $exec_script
1319 " > $exec_script
1305 chmod +x $exec_script
1320 chmod +x $exec_script
1306 fi
1321 fi
1307
1322
1308 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1323 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1309
1324
1310 docker_id=$(docker ps -q --filter "name=$container_name" --filter name="rc_cluster_apps-celery")
1325 docker_id=$(docker ps -q --filter "name=$container_name" --filter name="rc_cluster_apps-celery")
1311
1326
1312 if [[ $docker_id ]]; then
1327 if [[ $docker_id ]]; then
1313 echo $container_name FOUND, Killing old one !
1328 echo $container_name FOUND, Killing old one !
1314 docker kill -s 9 $docker_id
1329 docker kill -s 9 $docker_id
1315 sleep 5
1330 sleep 5
1316 docker rm -fv $container_name
1331 docker rm -fv $container_name
1317 echo "done..."
1332 echo "done..."
1318 else
1333 else
1319 echo $container_name not found
1334 echo $container_name not found
1320 fi
1335 fi
1321
1336
1322 eval "
1337 eval "
1323 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1338 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1324 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1339 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1325 run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1340 run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1326 --workdir=\"$code_workdir\" \
1341 --workdir=\"$code_workdir\" \
1327 --name=\"$container_name\" \
1342 --name=\"$container_name\" \
1328 --interactive --tty \
1343 --interactive --tty \
1329 rhodecode bash $docker_exec_script"
1344 rhodecode bash $docker_exec_script"
1330
1345
1331 }
1346 }
1332
1347
1333 # :command.function
1348 # :command.function
1334 dev_tools_celeryd_command() {
1349 dev_tools_celeryd_command() {
1335 # src/celeryd_command.sh
1350 # src/celeryd_command.sh
1336 if [[ -v WORKSPACE_HOME ]];
1351 if [[ -v WORKSPACE_HOME ]];
1337 then
1352 then
1338 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1353 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1339 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1354 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1340 else
1355 else
1341 echo "WORKSPACE_HOME env var is not set"
1356 echo "WORKSPACE_HOME env var is not set"
1342 exit 1
1357 exit 1
1343 fi
1358 fi
1344
1359
1345 code_workdir=${args[--workdir]}
1360 code_workdir=${args[--workdir]}
1346 cmd_script=${args[--cmd]}
1361 cmd_script=${args[--cmd]}
1362 force_cmd=${args[--force-cmd]}
1347
1363
1348 exec_script=$WORKSPACE_HOME/$cmd_script
1364 exec_script=$WORKSPACE_HOME/$cmd_script
1349 container_name=dev-celeryd
1365 container_name=dev-celeryd
1350 env_file=".custom/.dev.env"
1366 env_file=".custom/.dev.env"
1351
1367
1352 echo "Using exec script: $exec_script"
1368 echo "Using exec script: $exec_script"
1353
1369
1354 RC_DEV_CMD_HELP=""
1370 RC_DEV_CMD_HELP=""
1355
1371
1356 if [[ ! -f $exec_script ]]; then
1372 if [[ ! -f $exec_script || $force_cmd ]]; then
1357 echo "Generating new $exec_script file..."
1373 echo "Generating new $exec_script file..."
1358 mkdir -p $(dirname $exec_script)
1374 mkdir -p $(dirname $exec_script)
1359
1375
1360 cat <<< "
1376 cat <<< "
1377 #!/bin/bash
1361 # Generated dev-env script for celeryd
1378 # Generated dev-env script for celeryd
1379 #echo \"Run celery dev using the following command:\"
1362
1380
1363 echo \"Run celery dev using the following command:\"
1364 make dev-env && celery --no-color --app=rhodecode.lib.celerylib.loader worker --autoscale=4,2 --max-tasks-per-child=100 --task-events --loglevel=DEBUG --ini=.dev/dev.ini
1381 make dev-env && celery --no-color --app=rhodecode.lib.celerylib.loader worker --autoscale=4,2 --max-tasks-per-child=100 --task-events --loglevel=DEBUG --ini=.dev/dev.ini
1365 " > $exec_script
1382 " > $exec_script
1366 chmod +x $exec_script
1383 chmod +x $exec_script
1367 fi
1384 fi
1368
1385
1369 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1386 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1370
1387
1371 docker_id=$(docker ps -q --filter "name=$container_name" --filter name="rc_cluster_apps-celery")
1388 docker_id=$(docker ps -q --filter "name=$container_name" --filter name="rc_cluster_apps-celery")
1372
1389
1373 if [[ $docker_id ]]; then
1390 if [[ $docker_id ]]; then
1374 echo $container_name FOUND, Killing old one !
1391 echo $container_name FOUND, Killing old one !
1375 docker kill -s 9 $docker_id
1392 docker kill -s 9 $docker_id
1376 sleep 5
1393 sleep 5
1377 docker rm -fv $container_name
1394 docker rm -fv $container_name
1378 echo "done..."
1395 echo "done..."
1379 else
1396 else
1380 echo $container_name not found
1397 echo $container_name not found
1381 fi
1398 fi
1382
1399
1400 # HELPER
1401 # docker logs -f $(docker ps -q --filter "name=celeryd")
1402
1383 eval "
1403 eval "
1384 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1404 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1385 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1405 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1386 run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1406 run -e RC_APP_PROC=1 -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1387 --workdir=\"$code_workdir\" \
1407 --workdir=\"$code_workdir\" \
1388 --name=\"$container_name\" \
1408 --name=\"$container_name\" \
1389 --detach \
1409 --detach \
1390 rhodecode $docker_exec_script"
1410 rhodecode $docker_exec_script"
1391
1411
1392 }
1412 }
1393
1413
1394 # :command.function
1414 # :command.function
1395 dev_tools_ssh_command() {
1415 dev_tools_ssh_command() {
1396 # src/ssh_command.sh
1416 # src/ssh_command.sh
1397 if [[ -v WORKSPACE_HOME ]];
1417 if [[ -v WORKSPACE_HOME ]];
1398 then
1418 then
1399 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1419 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1400 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1420 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1401 else
1421 else
1402 echo "WORKSPACE_HOME env var is not set"
1422 echo "WORKSPACE_HOME env var is not set"
1403 exit 1
1423 exit 1
1404 fi
1424 fi
1405
1425
1406 code_workdir=${args[--workdir]}
1426 code_workdir=${args[--workdir]}
1407 cmd_script=${args[--cmd]}
1427 cmd_script=${args[--cmd]}
1408
1428
1409 exec_script=$WORKSPACE_HOME/$cmd_script
1429 exec_script=$WORKSPACE_HOME/$cmd_script
1410 container_name=dev-ssh
1430 container_name=dev-ssh
1411 env_file=".custom/.dev.env"
1431 env_file=".custom/.dev.env"
1412
1432
1413 echo "Using exec script: $exec_script"
1433 echo "Using exec script: $exec_script"
1414
1434
1415 RC_DEV_CMD_HELP="mkdir -p /run/sshd && /usr/sbin/sshd -f /etc/rhodecode/sshd_config -D -e"
1435 RC_DEV_CMD_HELP="mkdir -p /run/sshd && /usr/sbin/sshd -f /etc/rhodecode/sshd_config -D -e"
1416
1436
1417 if [[ ! -f $exec_script ]]; then
1437 if [[ ! -f $exec_script ]]; then
1418 echo "Generating new $exec_script file..."
1438 echo "Generating new $exec_script file..."
1419 mkdir -p $(dirname $exec_script)
1439 mkdir -p $(dirname $exec_script)
1420
1440
1421 cat <<< "
1441 cat <<< "
1422 # Generated dev-env script for ssh
1442 # Generated dev-env script for ssh
1423
1443
1424 echo \"Run ssh dev using the following command:\"
1444 echo \"Run ssh dev using the following command:\"
1425 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1445 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1426 echo \"$RC_DEV_CMD_HELP\"
1446 echo \"$RC_DEV_CMD_HELP\"
1427 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1447 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1428 make sh
1448 make sh
1429 " > $exec_script
1449 " > $exec_script
1430 chmod +x $exec_script
1450 chmod +x $exec_script
1431 fi
1451 fi
1432
1452
1433 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1453 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1434
1454
1435 docker_id=$(docker ps -q --filter "name=$container_name" --filter name="rc_cluster_apps-sshd")
1455 docker_id=$(docker ps -q --filter "name=$container_name" --filter name="rc_cluster_apps-sshd")
1436
1456
1437 if [[ $docker_id ]]; then
1457 if [[ $docker_id ]]; then
1438 echo $container_name FOUND, Killing old one !
1458 echo $container_name FOUND, Killing old one !
1439 docker kill -s 9 $docker_id
1459 docker kill -s 9 $docker_id
1440 sleep 5
1460 sleep 5
1441 docker rm -fv $container_name
1461 docker rm -fv $container_name
1442 echo "done..."
1462 echo "done..."
1443 else
1463 else
1444 echo $container_name not found
1464 echo $container_name not found
1445 fi
1465 fi
1446
1466
1447 RC_SSH_PORT=9022
1467 RC_SSH_PORT=9022
1448
1468
1449 eval "
1469 eval "
1450 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1470 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1451 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1471 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1452 run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1472 run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1453 --workdir=\"$code_workdir\" \
1473 --workdir=\"$code_workdir\" \
1454 --name=\"$container_name\" \
1474 --name=\"$container_name\" \
1455 --interactive --tty \
1475 --interactive --tty \
1456 --publish $RC_SSH_PORT:22 \
1476 --publish $RC_SSH_PORT:22 \
1457 sshd bash $docker_exec_script"
1477 sshd bash $docker_exec_script"
1458
1478
1459 }
1479 }
1460
1480
1461 # :command.function
1481 # :command.function
1462 dev_tools_sshd_command() {
1482 dev_tools_sshd_command() {
1463 # src/sshd_command.sh
1483 # src/sshd_command.sh
1464 if [[ -v WORKSPACE_HOME ]];
1484 if [[ -v WORKSPACE_HOME ]];
1465 then
1485 then
1466 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1486 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1467 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1487 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1468 else
1488 else
1469 echo "WORKSPACE_HOME env var is not set"
1489 echo "WORKSPACE_HOME env var is not set"
1470 exit 1
1490 exit 1
1471 fi
1491 fi
1472
1492
1473 code_workdir=${args[--workdir]}
1493 code_workdir=${args[--workdir]}
1474 cmd_script=${args[--cmd]}
1494 cmd_script=${args[--cmd]}
1495 force_cmd=${args[--force-cmd]}
1475
1496
1476 exec_script=$WORKSPACE_HOME/$cmd_script
1497 exec_script=$WORKSPACE_HOME/$cmd_script
1477 container_name=dev-sshd
1498 container_name=dev-sshd
1478 env_file=".custom/.dev.env"
1499 env_file=".custom/.dev.env"
1479
1500
1480 echo "Using exec script: $exec_script"
1501 echo "Using exec script: $exec_script"
1481
1502
1482 RC_DEV_CMD_HELP=""
1503 RC_DEV_CMD_HELP=""
1483
1504
1484 if [[ ! -f $exec_script ]]; then
1505 if [[ ! -f $exec_script || $force_cmd ]]; then
1485 echo "Generating new $exec_script file..."
1506 echo "Generating new $exec_script file..."
1486 mkdir -p $(dirname $exec_script)
1507 mkdir -p $(dirname $exec_script)
1487
1508
1488 cat <<< "
1509 cat <<< "
1510 #!/bin/bash
1489 # Generated dev-env script for ssh
1511 # Generated dev-env script for ssh
1512 #echo \"Run ssh dev using the following command:\"
1490
1513
1491 echo \"Run ssh dev using the following command:\"
1492 make dev-env && mkdir -p /run/sshd && /usr/sbin/sshd -f /etc/rhodecode/sshd_config -D -e
1514 make dev-env && mkdir -p /run/sshd && /usr/sbin/sshd -f /etc/rhodecode/sshd_config -D -e
1493 " > $exec_script
1515 " > $exec_script
1494 chmod +x $exec_script
1516 chmod +x $exec_script
1495 fi
1517 fi
1496
1518
1497 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1519 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1498
1520
1499 docker_id=$(docker ps -q --filter "name=$container_name" --filter name="rc_cluster_apps-sshd")
1521 docker_id=$(docker ps -q --filter "name=$container_name" --filter name="rc_cluster_apps-sshd")
1500
1522
1501 if [[ $docker_id ]]; then
1523 if [[ $docker_id ]]; then
1502 echo $container_name FOUND, Killing old one !
1524 echo $container_name FOUND, Killing old one !
1503 docker kill -s 9 $docker_id
1525 docker kill -s 9 $docker_id
1504 sleep 5
1526 sleep 5
1505 docker rm -fv $container_name
1527 docker rm -fv $container_name
1506 echo "done..."
1528 echo "done..."
1507 else
1529 else
1508 echo $container_name not found
1530 echo $container_name not found
1509 fi
1531 fi
1510
1532
1533 # HELPER
1534 # docker logs -f $(docker ps -q --filter "name=sshd")
1535
1511 RC_SSH_PORT=9022
1536 RC_SSH_PORT=9022
1512
1537
1513 eval "
1538 eval "
1514 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1539 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1515 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1540 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1516 run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1541 run -e RC_APP_PROC=1 -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1517 --workdir=\"$code_workdir\" \
1542 --workdir=\"$code_workdir\" \
1518 --name=\"$container_name\" \
1543 --name=\"$container_name\" \
1519 --detach \
1544 --detach \
1520 --publish $RC_SSH_PORT:22 \
1545 --publish $RC_SSH_PORT:22 \
1521 sshd $docker_exec_script"
1546 sshd $docker_exec_script"
1522
1547
1523 }
1548 }
1524
1549
1525 # :command.function
1550 # :command.function
1526 dev_tools_svn_command() {
1551 dev_tools_svn_command() {
1527 # src/svn_command.sh
1552 # src/svn_command.sh
1528 if [[ -v WORKSPACE_HOME ]];
1553 if [[ -v WORKSPACE_HOME ]];
1529 then
1554 then
1530 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1555 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1531 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1556 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1532 else
1557 else
1533 echo "WORKSPACE_HOME env var is not set"
1558 echo "WORKSPACE_HOME env var is not set"
1534 exit 1
1559 exit 1
1535 fi
1560 fi
1536
1561
1537 code_workdir=${args[--workdir]}
1562 code_workdir=${args[--workdir]}
1538 cmd_script=${args[--cmd]}
1563 cmd_script=${args[--cmd]}
1539
1564
1540 exec_script=$WORKSPACE_HOME/$cmd_script
1565 exec_script=$WORKSPACE_HOME/$cmd_script
1541 container_name=dev-svn
1566 container_name=dev-svn
1542 env_file=".custom/.dev.env"
1567 env_file=".custom/.dev.env"
1543
1568
1544 echo "Using exec script: $exec_script"
1569 echo "Using exec script: $exec_script"
1545
1570
1546 RC_DEV_CMD_HELP="apachectl -D FOREGROUND"
1571 RC_DEV_CMD_HELP="apachectl -D FOREGROUND"
1547
1572
1548 if [[ ! -f $exec_script ]]; then
1573 if [[ ! -f $exec_script ]]; then
1549 echo "Generating new $exec_script file..."
1574 echo "Generating new $exec_script file..."
1550 mkdir -p $(dirname $exec_script)
1575 mkdir -p $(dirname $exec_script)
1551
1576
1552 cat <<< "
1577 cat <<< "
1553 # Generated dev-env script for svn
1578 # Generated dev-env script for svn
1554
1579
1555 echo \"Run svn dev using the following command:\"
1580 echo \"Run svn dev using the following command:\"
1556 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1581 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1557 echo \"$RC_DEV_CMD_HELP\"
1582 echo \"$RC_DEV_CMD_HELP\"
1558 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1583 echo \"++++++++++++++++++++++++++++++++++++++++++++++++++\"
1559 make sh
1584 make sh
1560 " > $exec_script
1585 " > $exec_script
1561 chmod +x $exec_script
1586 chmod +x $exec_script
1562 fi
1587 fi
1563
1588
1564 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1589 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1565
1590
1566 docker_id=$(docker ps -q --filter "name=$container_name" --filter name="rc_cluster_apps-svn")
1591 docker_id=$(docker ps -q --filter "name=$container_name" --filter name="rc_cluster_apps-svn")
1567
1592
1568 if [[ $docker_id ]]; then
1593 if [[ $docker_id ]]; then
1569 echo $container_name FOUND, Killing old one !
1594 echo $container_name FOUND, Killing old one !
1570 docker kill -s 9 $docker_id
1595 docker kill -s 9 $docker_id
1571 sleep 5
1596 sleep 5
1572 docker rm -fv $container_name
1597 docker rm -fv $container_name
1573 echo "done..."
1598 echo "done..."
1574 else
1599 else
1575 echo $container_name not found
1600 echo $container_name not found
1576 fi
1601 fi
1577
1602
1578 eval "
1603 eval "
1579 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1604 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1580 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1605 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1581 run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1606 run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1582 --workdir=\"$code_workdir\" \
1607 --workdir=\"$code_workdir\" \
1583 --name=\"$container_name\" \
1608 --name=\"$container_name\" \
1584 --interactive --tty \
1609 --interactive --tty \
1585 svn bash $docker_exec_script"
1610 svn bash $docker_exec_script"
1586
1611
1587 }
1612 }
1588
1613
1589 # :command.function
1614 # :command.function
1590 dev_tools_svnd_command() {
1615 dev_tools_svnd_command() {
1591 # src/svnd_command.sh
1616 # src/svnd_command.sh
1592 if [[ -v WORKSPACE_HOME ]];
1617 if [[ -v WORKSPACE_HOME ]];
1593 then
1618 then
1594 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1619 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1595 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1620 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1596 else
1621 else
1597 echo "WORKSPACE_HOME env var is not set"
1622 echo "WORKSPACE_HOME env var is not set"
1598 exit 1
1623 exit 1
1599 fi
1624 fi
1600
1625
1601 code_workdir=${args[--workdir]}
1626 code_workdir=${args[--workdir]}
1602 cmd_script=${args[--cmd]}
1627 cmd_script=${args[--cmd]}
1628 force_cmd=${args[--force-cmd]}
1603
1629
1604 exec_script=$WORKSPACE_HOME/$cmd_script
1630 exec_script=$WORKSPACE_HOME/$cmd_script
1605 container_name=dev-svnd
1631 container_name=dev-svnd
1606 env_file=".custom/.dev.env"
1632 env_file=".custom/.dev.env"
1607
1633
1608 echo "Using exec script: $exec_script"
1634 echo "Using exec script: $exec_script"
1609
1635
1610 RC_DEV_CMD_HELP=""
1636 RC_DEV_CMD_HELP=""
1611
1637
1612 if [[ ! -f $exec_script ]]; then
1638 if [[ ! -f $exec_script || $force_cmd ]]; then
1613 echo "Generating new $exec_script file..."
1639 echo "Generating new $exec_script file..."
1614 mkdir -p $(dirname $exec_script)
1640 mkdir -p $(dirname $exec_script)
1615
1641
1616 cat <<< "
1642 cat <<< "
1643 #!/bin/bash
1617 # Generated dev-env script for svn
1644 # Generated dev-env script for svn
1645 #echo \"Run svn dev using the following command:\"
1618
1646
1619 echo \"Run svn dev using the following command:\"
1620 make dev-env && apachectl -D FOREGROUND
1647 make dev-env && apachectl -D FOREGROUND
1621 " > $exec_script
1648 " > $exec_script
1622 chmod +x $exec_script
1649 chmod +x $exec_script
1623 fi
1650 fi
1624
1651
1625 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1652 docker_exec_script="/var/opt/rhodecode_repo_store/$cmd_script"
1626
1653
1627 docker_id=$(docker ps -q --filter "name=$container_name" --filter name="rc_cluster_apps-svnd")
1654 docker_id=$(docker ps -q --filter "name=$container_name" --filter name="rc_cluster_apps-svnd")
1628
1655
1629 if [[ $docker_id ]]; then
1656 if [[ $docker_id ]]; then
1630 echo $container_name FOUND, Killing old one !
1657 echo $container_name FOUND, Killing old one !
1631 docker kill -s 9 $docker_id
1658 docker kill -s 9 $docker_id
1632 sleep 5
1659 sleep 5
1633 docker rm -fv $container_name
1660 docker rm -fv $container_name
1634 echo "done..."
1661 echo "done..."
1635 else
1662 else
1636 echo $container_name not found
1663 echo $container_name not found
1637 fi
1664 fi
1638
1665
1666 # HELPER
1667 # docker logs -f $(docker ps -q --filter "name=svnd")
1668
1639 eval "
1669 eval "
1640 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1670 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME RC_DEV_CMD_HELP=\"$RC_DEV_CMD_HELP\" \
1641 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1671 ./rcstack stack --env-file-path $env_file rhodecode -f docker-compose-apps.dev.yaml \
1642 run -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1672 run -e RC_APP_PROC=1 -e RC_DEV_CMD_HELP=\"'$RC_DEV_CMD_HELP'\" -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_$container_name --rm --use-aliases \
1643 --workdir=\"$code_workdir\" \
1673 --workdir=\"$code_workdir\" \
1644 --name=\"$container_name\" \
1674 --name=\"$container_name\" \
1645 --detach \
1675 --detach \
1646 svn $docker_exec_script"
1676 svn $docker_exec_script"
1647
1677
1648 }
1678 }
1649
1679
1650 # :command.function
1680 # :command.function
1651 dev_tools_tools_command() {
1681 dev_tools_tools_command() {
1652 # src/tools_command.sh
1682 # src/tools_command.sh
1653 container_name=dev-tools
1683 container_name=dev-tools
1654
1684
1655 docker ps -q --filter "name=$container_name" | grep -q . && echo $container_name found || echo $container_name not found
1685 docker ps -q --filter "name=$container_name" | grep -q . && echo $container_name found || echo $container_name not found
1656 docker ps -q --filter "name=$container_name" | grep -q . && docker stop -t 120 $container_name && docker rm -fv $container_name
1686 docker ps -q --filter "name=$container_name" | grep -q . && docker stop -t 120 $container_name && docker rm -fv $container_name
1657
1687
1658 if [[ -v WORKSPACE_HOME ]];
1688 if [[ -v WORKSPACE_HOME ]];
1659 then
1689 then
1660 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1690 DEFAULT_WORKSPACE_HOME=$WORKSPACE_HOME
1661 else
1691 else
1662 echo "WORKSPACE_HOME env var is not set"
1692 echo "WORKSPACE_HOME env var is not set"
1663 exit 1
1693 exit 1
1664 fi
1694 fi
1665
1695
1666 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1696 echo "Using default WORKSPACE_HOME path: $DEFAULT_WORKSPACE_HOME"
1667
1697
1668 eval "
1698 eval "
1669 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME \
1699 WORKSPACE_HOME=$DEFAULT_WORKSPACE_HOME \
1670 ./rcstack stack --env-file-path .custom/.dev.env rhodecode -f docker-compose-apps.dev.yaml \
1700 ./rcstack stack --env-file-path .custom/.dev.env rhodecode -f docker-compose-apps.dev.yaml \
1671 run -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_tools_bash \
1701 run -e ENV_FILE= -e RC_ENV_FILE= -e RC_APP_TYPE=rhodecode_tools_bash \
1672 --rm --use-aliases \
1702 --rm --use-aliases \
1673 --workdir=\"/home/rhodecode/rhodecode-tools-ce\" \
1703 --workdir=\"/home/rhodecode/rhodecode-tools-ce\" \
1674 --interactive --tty \
1704 --interactive --tty \
1675 --name=\"$container_name\" rhodecode bash /home/rhodecode/rhodecode-tools-ce/.dev/dev-env.sh"
1705 --name=\"$container_name\" rhodecode bash /home/rhodecode/rhodecode-tools-ce/.dev/dev-env.sh"
1676
1706
1677 }
1707 }
1678
1708
1679 # :command.function
1709 # :command.function
1680 dev_tools_dev_env_command() {
1710 dev_tools_dev_env_command() {
1681 # src/dev_env_command.sh
1711 # src/dev_env_command.sh
1682 DEV_ENV_CMD="up --detach"
1712 DEV_ENV_CMD="up --detach"
1683
1713
1684 echo "STARTING DEV ENV DOCKER CONTAINERS: $DEV_ENV_CMD"
1714 echo "STARTING DEV ENV DOCKER CONTAINERS: $DEV_ENV_CMD"
1685
1715
1686 cmd=$(echo "$METRICS_DEV_ENV_TMPL" | sed "s/{{DEV_ENV_CMD}}/$DEV_ENV_CMD/g")
1716 cmd=$(echo "$METRICS_DEV_ENV_TMPL" | sed "s/{{DEV_ENV_CMD}}/$DEV_ENV_CMD/g")
1687 eval $cmd
1717 eval $cmd
1688
1718
1689 cmd=$(echo "$RC_DEV_ENV_TMPL" | sed "s/{{DEV_ENV_CMD}}/$DEV_ENV_CMD/g")
1719 cmd=$(echo "$RC_DEV_ENV_TMPL" | sed "s/{{DEV_ENV_CMD}}/$DEV_ENV_CMD/g")
1690 eval $cmd
1720 eval $cmd
1691
1721
1692 eval "./rcstack status"
1722 eval "./rcstack status"
1693
1723
1694 echo "DEV ENV START FINISHED"
1724 echo "DEV ENV START FINISHED"
1695
1725
1696 }
1726 }
1697
1727
1698 # :command.function
1728 # :command.function
1699 dev_tools_dev_env_stop_command() {
1729 dev_tools_dev_env_stop_command() {
1700 # src/dev_env_stop_command.sh
1730 # src/dev_env_stop_command.sh
1701 DEV_ENV_CMD="down"
1731 DEV_ENV_CMD="down"
1702
1732
1703 echo "STOPPING DEV ENV DOCKER CONTAINERS: $DEV_ENV_CMD"
1733 echo "STOPPING DEV ENV DOCKER CONTAINERS: $DEV_ENV_CMD"
1704
1734
1705 cmd=$(echo "$METRICS_DEV_ENV_TMPL" | sed "s/{{DEV_ENV_CMD}}/$DEV_ENV_CMD/g")
1735 cmd=$(echo "$METRICS_DEV_ENV_TMPL" | sed "s/{{DEV_ENV_CMD}}/$DEV_ENV_CMD/g")
1706 eval $cmd
1736 eval $cmd
1707
1737
1708 cmd=$(echo "$RC_DEV_ENV_TMPL" | sed "s/{{DEV_ENV_CMD}}/$DEV_ENV_CMD/g")
1738 cmd=$(echo "$RC_DEV_ENV_TMPL" | sed "s/{{DEV_ENV_CMD}}/$DEV_ENV_CMD/g")
1709 eval $cmd
1739 eval $cmd
1710
1740
1711 eval "./rcstack status"
1741 eval "./rcstack status"
1712
1742
1713 echo "DEV ENV START FINISHED"
1743 echo "DEV ENV START FINISHED"
1714
1744
1715 }
1745 }
1716
1746
1717 # :command.function
1747 # :command.function
1718 dev_tools_prune_command() {
1748 dev_tools_prune_command() {
1719 # src/prune_command.sh
1749 # src/prune_command.sh
1720 docker container prune -f
1750 docker container prune -f
1721 docker image prune -f
1751 docker image prune -f
1722 docker builder prune -f
1752 docker builder prune -f
1723 docker system df
1753 docker system df
1724 }
1754 }
1725
1755
1726 # :command.function
1756 # :command.function
1727 dev_tools_prune_all_command() {
1757 dev_tools_prune_all_command() {
1728 # src/prune_all_command.sh
1758 # src/prune_all_command.sh
1729 docker container prune -f
1759 docker container prune -f
1730 docker image prune -f
1760 docker image prune -f
1731 docker image prune --all
1761 docker image prune --all
1732 docker builder prune -f
1762 docker builder prune -f
1733 docker builder prune --all
1763 docker builder prune --all
1734 docker system prune -f
1764 docker system prune -f
1735 docker system df
1765 docker system df
1736 }
1766 }
1737
1767
1738 # :command.function
1768 # :command.function
1739 dev_tools_cli_generate_pull_command() {
1769 dev_tools_cli_generate_pull_command() {
1740 # src/cli_generate_pull_command.sh
1770 # src/cli_generate_pull_command.sh
1741 docker pull $bashly_image
1771 docker pull $bashly_image
1742 }
1772 }
1743
1773
1744 # :command.function
1774 # :command.function
1745 dev_tools_cli_generate_help_command() {
1775 dev_tools_cli_generate_help_command() {
1746 # src/cli_generate_help_command.sh
1776 # src/cli_generate_help_command.sh
1747 source_dir=/media/psf/Home/workspace/rcstack-cli-modules/dev-tools
1777 source_dir=/media/psf/Home/workspace/rcstack-cli-modules/dev-tools
1748 target_dir=/media/psf/Home/workspace/rhodecode-docker/scripts/dev-tools
1778 target_dir=/media/psf/Home/workspace/rhodecode-docker/scripts/dev-tools
1749
1779
1750 echo "To pull latest image:"
1780 echo "To pull latest image:"
1751 echo " docker pull $bashly_image"
1781 echo " docker pull $bashly_image"
1752
1782
1753 echo "To run generation manually:"
1783 echo "To run generation manually:"
1754 echo " docker run --rm -it --user $(id -u):$(id -g) --volume "$source_dir:/app" --volume "$target_dir:/dest" -e BASHLY_TARGET_DIR=/dest $bashly_image generate"
1784 echo " docker run --rm -it --user $(id -u):$(id -g) --volume "$source_dir:/app" --volume "$target_dir:/dest" -e BASHLY_TARGET_DIR=/dest $bashly_image generate"
1755
1785
1756 echo "To upgrade builting scripts:"
1786 echo "To upgrade builting scripts:"
1757 echo " docker run --rm -it --user $(id -u):$(id -g) --volume "$source_dir:/app" --volume "$target_dir:/dest" -e BASHLY_TARGET_DIR=/dest $bashly_image generate --upgrade"
1787 echo " docker run --rm -it --user $(id -u):$(id -g) --volume "$source_dir:/app" --volume "$target_dir:/dest" -e BASHLY_TARGET_DIR=/dest $bashly_image generate --upgrade"
1758
1788
1759 #bashly generate --upgrade
1789 #bashly generate --upgrade
1760
1790
1761 # bashly add completions_script && source ./completions.bash
1791 # bashly add completions_script && source ./completions.bash
1762
1792
1763 #alias bashly='docker run --rm -it --user $(id -u):$(id -g) --volume "$PWD:/app" dannyben/bashly:edge'
1793 #alias bashly='docker run --rm -it --user $(id -u):$(id -g) --volume "$PWD:/app" dannyben/bashly:edge'
1764 }
1794 }
1765
1795
1766 # :command.function
1796 # :command.function
1767 dev_tools_stack_cli_version_command() {
1797 dev_tools_stack_cli_version_command() {
1768 # src/stack_cli_version_command.sh
1798 # src/stack_cli_version_command.sh
1769 version=${args[version]}
1799 version=${args[version]}
1770 version_file=$(pwd)/VERSION
1800 version_file=$(pwd)/VERSION
1771 yaml_file=$(pwd)/scripts/rcstack/src/bashly.yml
1801 yaml_file=$(pwd)/scripts/rcstack/src/bashly.yml
1772
1802
1773 echo "Setting $version to $version_file"
1803 echo "Setting $version to $version_file"
1774 echo -n $version > $version_file
1804 echo -n $version > $version_file
1775
1805
1776 echo "Setting $version to $yaml_file"
1806 echo "Setting $version to $yaml_file"
1777 sed -i -E "s/version:.+/version: $version/" $yaml_file
1807 sed -i -E "s/version:.+/version: $version/" $yaml_file
1778
1808
1779 }
1809 }
1780
1810
1781 # :command.function
1811 # :command.function
1782 dev_tools_stack_image_version_command() {
1812 dev_tools_stack_image_version_command() {
1783 # src/stack_image_version_command.sh
1813 # src/stack_image_version_command.sh
1784 version=${args[version]}
1814 version=${args[version]}
1785
1815
1786 #ARG RHODECODE_VERSION=5.0.0
1816 #ARG RHODECODE_VERSION=5.0.0
1787 docker_file=$(pwd)/service/rhodecode/rhodecode_5.dockerfile
1817 docker_file=$(pwd)/service/rhodecode/rhodecode_5.dockerfile
1788
1818
1789 # rc_image_ver=5.0.0
1819 # rc_image_ver=5.0.0
1790 initialize_file=$(pwd)/scripts/rcstack/src/initialize.sh
1820 initialize_file=$(pwd)/scripts/rcstack/src/initialize.sh
1791
1821
1792 echo "Setting $version to $docker_file"
1822 echo "Setting $version to $docker_file"
1793 sed -i -E "s/ARG RHODECODE_VERSION.+/ARG RHODECODE_VERSION=$version/" $docker_file
1823 sed -i -E "s/ARG RHODECODE_VERSION.+/ARG RHODECODE_VERSION=$version/" $docker_file
1794
1824
1795 echo "Setting $version to $initialize_file"
1825 echo "Setting $version to $initialize_file"
1796 sed -i -E "s/rc_image_ver.+/rc_image_ver=$version/" $initialize_file
1826 sed -i -E "s/rc_image_ver.+/rc_image_ver=$version/" $initialize_file
1797
1827
1798 }
1828 }
1799
1829
1800 # :command.function
1830 # :command.function
1801 dev_tools_cli_generate_rc_command() {
1831 dev_tools_cli_generate_rc_command() {
1802 # src/cli_generate_rc_command.sh
1832 # src/cli_generate_rc_command.sh
1803 one_time=${args[--one-time]}
1833 one_time=${args[--one-time]}
1804
1834
1805 source_dir="$WORKSPACE_HOME/rcstack-cli-modules/rcstack"
1835 source_dir="$WORKSPACE_HOME/rcstack-cli-modules/rcstack"
1806 target_dir="$WORKSPACE_HOME/rhodecode-enterprise-docker/scripts/rcstack"
1836 target_dir="$WORKSPACE_HOME/rhodecode-enterprise-docker/scripts/rcstack"
1807
1837
1808 echo "Using $source_dir/src/bashly.yaml @ $bashly_image"
1838 echo "Using $source_dir/src/bashly.yaml @ $bashly_image"
1809
1839
1810 if [[ $one_time ]]; then
1840 if [[ $one_time ]]; then
1811 docker run --rm -it --user $(id -u):$(id -g) --volume "$source_dir:/app" --volume "$target_dir:/dest" -e BASHLY_TARGET_DIR=/dest $bashly_image generate --upgrade
1841 docker run --rm -it --user $(id -u):$(id -g) --volume "$source_dir:/app" --volume "$target_dir:/dest" -e BASHLY_TARGET_DIR=/dest $bashly_image generate --upgrade
1812 else
1842 else
1813 docker run --rm -it --user $(id -u):$(id -g) --volume "$source_dir:/app" --volume "$target_dir:/dest" -e BASHLY_TARGET_DIR=/dest $bashly_image generate --watch
1843 docker run --rm -it --user $(id -u):$(id -g) --volume "$source_dir:/app" --volume "$target_dir:/dest" -e BASHLY_TARGET_DIR=/dest $bashly_image generate --watch
1814 fi
1844 fi
1815
1845
1816 }
1846 }
1817
1847
1818 # :command.function
1848 # :command.function
1819 dev_tools_cli_generate_dev_command() {
1849 dev_tools_cli_generate_dev_command() {
1820 # src/cli_generate_dev_command.sh
1850 # src/cli_generate_dev_command.sh
1821 one_time=${args[--one-time]}
1851 one_time=${args[--one-time]}
1822
1852
1823 echo "Using scripts/dev-tools/bashly.yaml @ $bashly_image"
1853 echo "Using scripts/dev-tools/bashly.yaml @ $bashly_image"
1824 source_dir=/media/psf/Home/workspace/rcstack-cli-modules/dev-tools
1854 source_dir=/media/psf/Home/workspace/rcstack-cli-modules/dev-tools
1825 target_dir=/media/psf/Home/workspace/rhodecode-docker/scripts/dev-tools
1855 target_dir=/media/psf/Home/workspace/rhodecode-docker/scripts/dev-tools
1826
1856
1827 if [[ $one_time ]]; then
1857 if [[ $one_time ]]; then
1828 docker run --rm -it --user $(id -u):$(id -g) --volume "$source_dir:/app" --volume "$target_dir:/dest" -e BASHLY_TARGET_DIR=/dest $bashly_image generate --upgrade
1858 docker run --rm -it --user $(id -u):$(id -g) --volume "$source_dir:/app" --volume "$target_dir:/dest" -e BASHLY_TARGET_DIR=/dest $bashly_image generate --upgrade
1829 else
1859 else
1830 docker run --rm -it --user $(id -u):$(id -g) --volume "$source_dir:/app" --volume "$target_dir:/dest" -e BASHLY_TARGET_DIR=/dest $bashly_image generate --watch
1860 docker run --rm -it --user $(id -u):$(id -g) --volume "$source_dir:/app" --volume "$target_dir:/dest" -e BASHLY_TARGET_DIR=/dest $bashly_image generate --watch
1831 fi
1861 fi
1832
1862
1833 }
1863 }
1834
1864
1835 # :command.function
1865 # :command.function
1836 dev_tools_get_build_artifacts_command() {
1866 dev_tools_get_build_artifacts_command() {
1837 # src/get_build_artifacts_command.sh
1867 # src/get_build_artifacts_command.sh
1838
1868
1839 DEBUG=${args[--debug]}
1869 DEBUG=${args[--debug]}
1840 AUTH=${args[--auth]}
1870 AUTH=${args[--auth]}
1841 INSTALLER_URL=${args[--installer-url]}
1871 INSTALLER_URL=${args[--installer-url]}
1842 MANIFEST_URL=${args[--manifest-url]}
1872 MANIFEST_URL=${args[--manifest-url]}
1843 RC_VERSION=${args[--version-name]}
1873 RC_VERSION=${args[--version-name]}
1844 VER=$RC_VERSION
1874 VER=$RC_VERSION
1845
1875
1846 CACHE_DIR=$PWD/.cache
1876 CACHE_DIR=$PWD/.cache
1847 VER_REGEX="$VER+x86_64"
1877 VER_REGEX="$VER+x86_64"
1848
1878
1849 if [[ $VER == "" ]]; then
1879 if [[ $VER == "" ]]; then
1850 msg="Version is empty, please set --version-name correctly"
1880 msg="Version is empty, please set --version-name correctly"
1851 echo "$(red $msg)"
1881 echo "$(red $msg)"
1852 exit 1
1882 exit 1
1853 fi
1883 fi
1854
1884
1855 echo "Downloading Artifacts for version: $VER"
1885 echo "Downloading Artifacts for version: $VER"
1856 mkdir -p $CACHE_DIR
1886 mkdir -p $CACHE_DIR
1857
1887
1858 echo "1/4 Checking available downloads from MANIFEST file"
1888 echo "1/4 Checking available downloads from MANIFEST file"
1859
1889
1860 ARTS=$(curl -s $AUTH $MANIFEST_URL | grep --ignore-case "$VER_REGEX" | cut -d ' ' -f 2)
1890 ARTS=$(curl -s $AUTH $MANIFEST_URL | grep --ignore-case "$VER_REGEX" | cut -d ' ' -f 2)
1861
1891
1862 if [[ $DEBUG ]]; then
1892 if [[ $DEBUG ]]; then
1863 echo "DEBUG START"
1893 echo "DEBUG START"
1864 curl -s $AUTH $MANIFEST_URL | grep --ignore-case "$VER_REGEX" || echo "no regex match"
1894 curl -s $AUTH $MANIFEST_URL | grep --ignore-case "$VER_REGEX" || echo "no regex match"
1865 curl -s $AUTH $MANIFEST_URL | grep --ignore-case "$VER_REGEX" | cut -d ' ' -f 2
1895 curl -s $AUTH $MANIFEST_URL | grep --ignore-case "$VER_REGEX" | cut -d ' ' -f 2
1866 echo "Found following artifacts:"
1896 echo "Found following artifacts:"
1867 echo $ARTS
1897 echo $ARTS
1868 echo "DEBUG END"
1898 echo "DEBUG END"
1869 fi
1899 fi
1870
1900
1871 if [[ $ARTS == "" ]]; then
1901 if [[ $ARTS == "" ]]; then
1872 MSG="Failed to found any MANIFEST entries for version $VER make sure there exists release with that version or use --version to specify different version"
1902 MSG="Failed to found any MANIFEST entries for version $VER make sure there exists release with that version or use --version to specify different version"
1873 echo "$(red $MSG)"
1903 echo "$(red $MSG)"
1874 exit 1
1904 exit 1
1875 fi
1905 fi
1876
1906
1877 echo "2/4 Downloading locale-archive"
1907 echo "2/4 Downloading locale-archive"
1878 curl -L https://dls.rhodecode.com/assets/locale-archive -J -O
1908 curl -L https://dls.rhodecode.com/assets/locale-archive -J -O
1879 mv -v locale-archive "$CACHE_DIR"
1909 mv -v locale-archive "$CACHE_DIR"
1880
1910
1881 # vcsserver/ce/ee
1911 # vcsserver/ce/ee
1882 echo "3/4 Downloading installer artifacts"
1912 echo "3/4 Downloading installer artifacts"
1883 for url in $ARTS; do
1913 for url in $ARTS; do
1884 echo "Downloading $url with $AUTH"
1914 echo "Downloading $url with $AUTH"
1885 curl $AUTH --fail-early -L ${url} -J -O
1915 curl $AUTH --fail-early -L ${url} -J -O
1886 done
1916 done
1887
1917
1888 #for url in $(curl -s $MANIFEST_URL | grep --ignore-case -E 'control.+\+x86_64' | cut -d ' ' -f 2); do
1918 #for url in $(curl -s $MANIFEST_URL | grep --ignore-case -E 'control.+\+x86_64' | cut -d ' ' -f 2); do
1889 # echo "Downloading $url"
1919 # echo "Downloading $url"
1890 # curl -L ${url} -J -O
1920 # curl -L ${url} -J -O
1891 #done
1921 #done
1892
1922
1893 echo "4/4 Downloading installer from $INSTALLER_URL"
1923 echo "4/4 Downloading installer from $INSTALLER_URL"
1894 curl $AUTH -L $INSTALLER_URL -J -O
1924 curl $AUTH -L $INSTALLER_URL -J -O
1895
1925
1896 INSTALLER=$(ls -Art RhodeCode-installer-* | tail -n 1)
1926 INSTALLER=$(ls -Art RhodeCode-installer-* | tail -n 1)
1897 if [[ -n $INSTALLER ]]; then
1927 if [[ -n $INSTALLER ]]; then
1898 chmod +x "${INSTALLER}"
1928 chmod +x "${INSTALLER}"
1899 fi
1929 fi
1900
1930
1901 echo "Copying artifacts into $CACHE_DIR"
1931 echo "Copying artifacts into $CACHE_DIR"
1902
1932
1903 mv -v "${INSTALLER}" $CACHE_DIR
1933 mv -v "${INSTALLER}" $CACHE_DIR
1904 mv -v *.bz2 $CACHE_DIR
1934 mv -v *.bz2 $CACHE_DIR
1905 ls -lh $CACHE_DIR
1935 ls -lh $CACHE_DIR
1906
1936
1907 }
1937 }
1908
1938
1909 # :command.function
1939 # :command.function
1910 dev_tools_build_installer_command() {
1940 dev_tools_build_installer_command() {
1911 # src/build_installer_command.sh
1941 # src/build_installer_command.sh
1912
1942
1913 rc_version=${args[--version-name]}
1943 rc_version=${args[--version-name]}
1914 export RC_VERSION=$rc_version
1944 export RC_VERSION=$rc_version
1915 eval "echo INSTALLER BASED BUILDING${RC_VERSION}"
1945 eval "echo INSTALLER BASED BUILDING${RC_VERSION}"
1916
1946
1917 RC_VERSION=$rc_version ./$RC_SCRIPT_NAME stack rhodecode build --progress plain rhodecode
1947 RC_VERSION=$rc_version ./$RC_SCRIPT_NAME stack rhodecode build --progress plain rhodecode
1918
1948
1919 }
1949 }
1920
1950
1921 # :command.function
1951 # :command.function
1922 dev_tools_get_build_source_command() {
1952 dev_tools_get_build_source_command() {
1923 # src/get_build_source_command.sh
1953 # src/get_build_source_command.sh
1924
1954
1925 DEBUG=${args[--debug]}
1955 DEBUG=${args[--debug]}
1926 AUTH_TOKEN=${args[--auth-token]}
1956 AUTH_TOKEN=${args[--auth-token]}
1927 SERVER_URL=${args[--server-url]}
1957 SERVER_URL=${args[--server-url]}
1928 revision=${args[--revision]}
1958 revision=${args[--revision]}
1929
1959
1930 SOURCE_DIR=${args[--source-dir]}
1960 SOURCE_DIR=${args[--source-dir]}
1931
1961
1932 RHODECODE_VCS_HASH=$revision
1962 RHODECODE_VCS_HASH=$revision
1933 RHODECODE_CE_HASH=$revision
1963 RHODECODE_CE_HASH=$revision
1934 RHODECODE_EE_HASH=$revision
1964 RHODECODE_EE_HASH=$revision
1935
1965
1936 # download sources
1966 # download sources
1937 echo "** download rhodecode source for build from $SERVER_URL using '$revision' hash **"
1967 echo "** download rhodecode source for build from $SERVER_URL using '$revision' hash **"
1938 mkdir -p "$SOURCE_DIR"
1968 mkdir -p "$SOURCE_DIR"
1939
1969
1940 dl_url="$SERVER_URL/rhodecode-vcsserver/archive/$RHODECODE_VCS_HASH.tgz?with_hash=0"
1970 dl_url="$SERVER_URL/rhodecode-vcsserver/archive/$RHODECODE_VCS_HASH.tgz?with_hash=0"
1941 echo "getting $dl_url"
1971 echo "getting $dl_url"
1942 curl --fail --header "X-Rc-Auth-Token: $AUTH_TOKEN" -L $dl_url | tar -xz -C $SOURCE_DIR
1972 curl --fail --header "X-Rc-Auth-Token: $AUTH_TOKEN" -L $dl_url | tar -xz -C $SOURCE_DIR
1943
1973
1944 dl_url="$SERVER_URL/rhodecode-enterprise-ce/archive/$RHODECODE_CE_HASH.tgz?with_hash=0"
1974 dl_url="$SERVER_URL/rhodecode-enterprise-ce/archive/$RHODECODE_CE_HASH.tgz?with_hash=0"
1945 echo "getting $SERVER_URL/rhodecode-enterprise-ce/archive/$RHODECODE_CE_HASH.tgz"
1975 echo "getting $SERVER_URL/rhodecode-enterprise-ce/archive/$RHODECODE_CE_HASH.tgz"
1946 curl --fail --header "X-Rc-Auth-Token: $AUTH_TOKEN" -L $dl_url | tar -xz -C $SOURCE_DIR
1976 curl --fail --header "X-Rc-Auth-Token: $AUTH_TOKEN" -L $dl_url | tar -xz -C $SOURCE_DIR
1947
1977
1948 dl_url="$SERVER_URL/rhodecode-enterprise-ee/archive/$RHODECODE_EE_HASH.tgz?with_hash=0"
1978 dl_url="$SERVER_URL/rhodecode-enterprise-ee/archive/$RHODECODE_EE_HASH.tgz?with_hash=0"
1949 echo "$dl_url"
1979 echo "$dl_url"
1950 curl --fail --header "X-Rc-Auth-Token: $AUTH_TOKEN" -L $dl_url | tar -xz -C $SOURCE_DIR
1980 curl --fail --header "X-Rc-Auth-Token: $AUTH_TOKEN" -L $dl_url | tar -xz -C $SOURCE_DIR
1951
1981
1952 rm -rf $SOURCE_DIR/rhodecode-vcsserver && \
1982 rm -rf $SOURCE_DIR/rhodecode-vcsserver && \
1953 mv $SOURCE_DIR/*rhodecode-vcsserver-* $SOURCE_DIR/rhodecode-vcsserver
1983 mv $SOURCE_DIR/*rhodecode-vcsserver-* $SOURCE_DIR/rhodecode-vcsserver
1954 rm -rf $SOURCE_DIR/rhodecode-vcsserver/.hg
1984 rm -rf $SOURCE_DIR/rhodecode-vcsserver/.hg
1955
1985
1956 rm -rf $SOURCE_DIR/rhodecode-enterprise-ce && \
1986 rm -rf $SOURCE_DIR/rhodecode-enterprise-ce && \
1957 mv $SOURCE_DIR/*rhodecode-enterprise-ce-* $SOURCE_DIR/rhodecode-enterprise-ce
1987 mv $SOURCE_DIR/*rhodecode-enterprise-ce-* $SOURCE_DIR/rhodecode-enterprise-ce
1958 rm -rf $SOURCE_DIR/rhodecode-enterprise-ce/.hg
1988 rm -rf $SOURCE_DIR/rhodecode-enterprise-ce/.hg
1959
1989
1960 rm -rf $SOURCE_DIR/rhodecode-enterprise-ee && \
1990 rm -rf $SOURCE_DIR/rhodecode-enterprise-ee && \
1961 mv $SOURCE_DIR/*rhodecode-enterprise-ee-* $SOURCE_DIR/rhodecode-enterprise-ee
1991 mv $SOURCE_DIR/*rhodecode-enterprise-ee-* $SOURCE_DIR/rhodecode-enterprise-ee
1962 rm -rf $SOURCE_DIR/rhodecode-enterprise-ee/.hg
1992 rm -rf $SOURCE_DIR/rhodecode-enterprise-ee/.hg
1963
1993
1964 echo "downloading sources done to $SOURCE_DIR, directory now consists:"
1994 echo "downloading sources done to $SOURCE_DIR, directory now consists:"
1965 ls -l $SOURCE_DIR
1995 ls -l $SOURCE_DIR
1966
1996
1967 echo ""
1997 echo ""
1968 date_formatted=$(date +%Y.%m.%d.1)
1998 date_formatted=$(date +%Y.%m.%d.1)
1969 echo "to create source based build run:"
1999 echo "to create source based build run:"
1970 echo " ./$RC_SCRIPT_NAME build-source --version-name 4.28.0.$date_formatted --tag beta"
2000 echo " ./$RC_SCRIPT_NAME build-source --version-name 4.28.0.$date_formatted --tag beta"
1971 echo " ./$RC_SCRIPT_NAME build-source --version-name 5.0.0.$date_formatted --tag beta"
2001 echo " ./$RC_SCRIPT_NAME build-source --version-name 5.0.0.$date_formatted --tag beta"
1972
2002
1973 }
2003 }
1974
2004
1975 # :command.function
2005 # :command.function
1976 dev_tools_build_source_command() {
2006 dev_tools_build_source_command() {
1977 # src/build_source_command.sh
2007 # src/build_source_command.sh
1978
2008
1979 rc_version=${args[--version-name]}
2009 rc_version=${args[--version-name]}
1980 source_build_yaml=${args[--source-build-yaml]}
2010 source_build_yaml=${args[--source-build-yaml]}
1981
2011
1982 eval "tags_data=(${args[--tag]})"
2012 eval "tags_data=(${args[--tag]})"
1983
2013
1984 export RC_VERSION=$rc_version
2014 export RC_VERSION=$rc_version
1985 export RC_EDITION=ee
2015 export RC_EDITION=ee
1986
2016
1987 VCS_SHA=$(cat .source/rhodecode-vcsserver/.archival.txt | grep commit_id | cut -d ":" -f 2 | cut -c 1-6)
2017 VCS_SHA=$(cat .source/rhodecode-vcsserver/.archival.txt | grep commit_id | cut -d ":" -f 2 | cut -c 1-6)
1988 CE_SHA=$(cat .source/rhodecode-enterprise-ce/.archival.txt | grep commit_id | cut -d ":" -f 2 | cut -c 1-6)
2018 CE_SHA=$(cat .source/rhodecode-enterprise-ce/.archival.txt | grep commit_id | cut -d ":" -f 2 | cut -c 1-6)
1989 EE_SHA=$(cat .source/rhodecode-enterprise-ee/.archival.txt | grep commit_id | cut -d ":" -f 2 | cut -c 1-6)
2019 EE_SHA=$(cat .source/rhodecode-enterprise-ee/.archival.txt | grep commit_id | cut -d ":" -f 2 | cut -c 1-6)
1990
2020
1991 echo "build_source: SOURCE BASED BUILDING: $rc_version @ vcs:$VCS_SHA ce:$CE_SHA ee:$EE_SHA"
2021 echo "build_source: SOURCE BASED BUILDING: $rc_version @ vcs:$VCS_SHA ce:$CE_SHA ee:$EE_SHA"
1992 echo "build_source: tags:" ${tags_data[@]}
2022 echo "build_source: tags:" ${tags_data[@]}
1993 echo ""
2023 echo ""
1994
2024
1995 RC_SCRIPT_NAME=rcstack
2025 RC_SCRIPT_NAME=rcstack
1996 DOCKER_SCAN_SUGGEST=false RC_VERSION=$rc_version \
2026 DOCKER_SCAN_SUGGEST=false RC_VERSION=$rc_version \
1997 ./$RC_SCRIPT_NAME stack rhodecode -f $source_build_yaml \
2027 ./$RC_SCRIPT_NAME stack rhodecode -f $source_build_yaml \
1998 --progress plain \
2028 --progress plain \
1999 build \
2029 build \
2000 --build-arg VCS_SHA=$VCS_SHA \
2030 --build-arg VCS_SHA=$VCS_SHA \
2001 --build-arg CE_SHA=$CE_SHA \
2031 --build-arg CE_SHA=$CE_SHA \
2002 --build-arg EE_SHA=$EE_SHA \
2032 --build-arg EE_SHA=$EE_SHA \
2003 rhodecode
2033 rhodecode
2004
2034
2005 # now tag the ee to ce
2035 # now tag the ee to ce
2006 docker tag rhodecode/rhodecode-ee:$rc_version rhodecode/rhodecode-ce:$rc_version
2036 docker tag rhodecode/rhodecode-ee:$rc_version rhodecode/rhodecode-ce:$rc_version
2007
2037
2008 # apply the tags
2038 # apply the tags
2009 for tag in "${tags_data[@]}"; do
2039 for tag in "${tags_data[@]}"; do
2010 echo "build_source: creating tag:$tag"
2040 echo "build_source: creating tag:$tag"
2011 docker tag rhodecode/rhodecode-ee:$rc_version rhodecode/rhodecode-ee:$tag
2041 docker tag rhodecode/rhodecode-ee:$rc_version rhodecode/rhodecode-ee:$tag
2012 docker tag rhodecode/rhodecode-ee:$rc_version rhodecode/rhodecode-ce:$tag
2042 docker tag rhodecode/rhodecode-ee:$rc_version rhodecode/rhodecode-ce:$tag
2013 done
2043 done
2014
2044
2015 echo "build_source: consider setting release version using"
2045 echo "build_source: consider setting release version using"
2016 echo " ./$RC_SCRIPT_NAME cli set-image $rc_version"
2046 echo " ./$RC_SCRIPT_NAME cli set-image $rc_version"
2017
2047
2018 echo "build_source: push this image using"
2048 echo "build_source: push this image using"
2019 echo " docker push rhodecode/rhodecode-ee:$rc_version"
2049 echo " docker push rhodecode/rhodecode-ee:$rc_version"
2020 echo " docker push rhodecode/rhodecode-ce:$rc_version"
2050 echo " docker push rhodecode/rhodecode-ce:$rc_version"
2021
2051
2022 for tag in "${tags_data[@]}"; do
2052 for tag in "${tags_data[@]}"; do
2023 echo " docker push rhodecode/rhodecode-ee:$tag"
2053 echo " docker push rhodecode/rhodecode-ee:$tag"
2024 echo " docker push rhodecode/rhodecode-ce:$tag"
2054 echo " docker push rhodecode/rhodecode-ce:$tag"
2025 done
2055 done
2026 }
2056 }
2027
2057
2028 # :command.parse_requirements
2058 # :command.parse_requirements
2029 parse_requirements() {
2059 parse_requirements() {
2030 # :command.fixed_flags_filter
2060 # :command.fixed_flags_filter
2031 while [[ $# -gt 0 ]]; do
2061 while [[ $# -gt 0 ]]; do
2032 case "${1:-}" in
2062 case "${1:-}" in
2033 --version | -v)
2063 --version | -v)
2034 version_command
2064 version_command
2035 exit
2065 exit
2036 ;;
2066 ;;
2037
2067
2038 --help | -h)
2068 --help | -h)
2039 long_usage=yes
2069 long_usage=yes
2040 dev_tools_usage
2070 dev_tools_usage
2041 exit
2071 exit
2042 ;;
2072 ;;
2043
2073
2044 *)
2074 *)
2045 break
2075 break
2046 ;;
2076 ;;
2047
2077
2048 esac
2078 esac
2049 done
2079 done
2050
2080
2051 # :command.command_filter
2081 # :command.command_filter
2052 action=${1:-}
2082 action=${1:-}
2053
2083
2054 case $action in
2084 case $action in
2055 -*) ;;
2085 -*) ;;
2056
2086
2057 vcs | v)
2087 vcs | v)
2058 action="vcs"
2088 action="vcs"
2059 shift
2089 shift
2060 dev_tools_vcs_parse_requirements "$@"
2090 dev_tools_vcs_parse_requirements "$@"
2061 shift $#
2091 shift $#
2062 ;;
2092 ;;
2063
2093
2064 ce | c)
2094 ce | c)
2065 action="ce"
2095 action="ce"
2066 shift
2096 shift
2067 dev_tools_ce_parse_requirements "$@"
2097 dev_tools_ce_parse_requirements "$@"
2068 shift $#
2098 shift $#
2069 ;;
2099 ;;
2070
2100
2071 ee | e)
2101 ee | e)
2072 action="ee"
2102 action="ee"
2073 shift
2103 shift
2074 dev_tools_ee_parse_requirements "$@"
2104 dev_tools_ee_parse_requirements "$@"
2075 shift $#
2105 shift $#
2076 ;;
2106 ;;
2077
2107
2078 celery)
2108 celery)
2079 action="celery"
2109 action="celery"
2080 shift
2110 shift
2081 dev_tools_celery_parse_requirements "$@"
2111 dev_tools_celery_parse_requirements "$@"
2082 shift $#
2112 shift $#
2083 ;;
2113 ;;
2084
2114
2085 celeryd)
2115 celeryd)
2086 action="celeryd"
2116 action="celeryd"
2087 shift
2117 shift
2088 dev_tools_celeryd_parse_requirements "$@"
2118 dev_tools_celeryd_parse_requirements "$@"
2089 shift $#
2119 shift $#
2090 ;;
2120 ;;
2091
2121
2092 ssh)
2122 ssh)
2093 action="ssh"
2123 action="ssh"
2094 shift
2124 shift
2095 dev_tools_ssh_parse_requirements "$@"
2125 dev_tools_ssh_parse_requirements "$@"
2096 shift $#
2126 shift $#
2097 ;;
2127 ;;
2098
2128
2099 sshd)
2129 sshd)
2100 action="sshd"
2130 action="sshd"
2101 shift
2131 shift
2102 dev_tools_sshd_parse_requirements "$@"
2132 dev_tools_sshd_parse_requirements "$@"
2103 shift $#
2133 shift $#
2104 ;;
2134 ;;
2105
2135
2106 svn)
2136 svn)
2107 action="svn"
2137 action="svn"
2108 shift
2138 shift
2109 dev_tools_svn_parse_requirements "$@"
2139 dev_tools_svn_parse_requirements "$@"
2110 shift $#
2140 shift $#
2111 ;;
2141 ;;
2112
2142
2113 svnd)
2143 svnd)
2114 action="svnd"
2144 action="svnd"
2115 shift
2145 shift
2116 dev_tools_svnd_parse_requirements "$@"
2146 dev_tools_svnd_parse_requirements "$@"
2117 shift $#
2147 shift $#
2118 ;;
2148 ;;
2119
2149
2120 tools | t)
2150 tools | t)
2121 action="tools"
2151 action="tools"
2122 shift
2152 shift
2123 dev_tools_tools_parse_requirements "$@"
2153 dev_tools_tools_parse_requirements "$@"
2124 shift $#
2154 shift $#
2125 ;;
2155 ;;
2126
2156
2127 dev-env)
2157 dev-env)
2128 action="dev-env"
2158 action="dev-env"
2129 shift
2159 shift
2130 dev_tools_dev_env_parse_requirements "$@"
2160 dev_tools_dev_env_parse_requirements "$@"
2131 shift $#
2161 shift $#
2132 ;;
2162 ;;
2133
2163
2134 dev-env-stop)
2164 dev-env-stop)
2135 action="dev-env-stop"
2165 action="dev-env-stop"
2136 shift
2166 shift
2137 dev_tools_dev_env_stop_parse_requirements "$@"
2167 dev_tools_dev_env_stop_parse_requirements "$@"
2138 shift $#
2168 shift $#
2139 ;;
2169 ;;
2140
2170
2141 prune)
2171 prune)
2142 action="prune"
2172 action="prune"
2143 shift
2173 shift
2144 dev_tools_prune_parse_requirements "$@"
2174 dev_tools_prune_parse_requirements "$@"
2145 shift $#
2175 shift $#
2146 ;;
2176 ;;
2147
2177
2148 prune-all)
2178 prune-all)
2149 action="prune-all"
2179 action="prune-all"
2150 shift
2180 shift
2151 dev_tools_prune_all_parse_requirements "$@"
2181 dev_tools_prune_all_parse_requirements "$@"
2152 shift $#
2182 shift $#
2153 ;;
2183 ;;
2154
2184
2155 cli-generate-pull)
2185 cli-generate-pull)
2156 action="cli-generate-pull"
2186 action="cli-generate-pull"
2157 shift
2187 shift
2158 dev_tools_cli_generate_pull_parse_requirements "$@"
2188 dev_tools_cli_generate_pull_parse_requirements "$@"
2159 shift $#
2189 shift $#
2160 ;;
2190 ;;
2161
2191
2162 cli-generate-help)
2192 cli-generate-help)
2163 action="cli-generate-help"
2193 action="cli-generate-help"
2164 shift
2194 shift
2165 dev_tools_cli_generate_help_parse_requirements "$@"
2195 dev_tools_cli_generate_help_parse_requirements "$@"
2166 shift $#
2196 shift $#
2167 ;;
2197 ;;
2168
2198
2169 stack-cli-version)
2199 stack-cli-version)
2170 action="stack-cli-version"
2200 action="stack-cli-version"
2171 shift
2201 shift
2172 dev_tools_stack_cli_version_parse_requirements "$@"
2202 dev_tools_stack_cli_version_parse_requirements "$@"
2173 shift $#
2203 shift $#
2174 ;;
2204 ;;
2175
2205
2176 stack-image-version)
2206 stack-image-version)
2177 action="stack-image-version"
2207 action="stack-image-version"
2178 shift
2208 shift
2179 dev_tools_stack_image_version_parse_requirements "$@"
2209 dev_tools_stack_image_version_parse_requirements "$@"
2180 shift $#
2210 shift $#
2181 ;;
2211 ;;
2182
2212
2183 cli-generate-rc)
2213 cli-generate-rc)
2184 action="cli-generate-rc"
2214 action="cli-generate-rc"
2185 shift
2215 shift
2186 dev_tools_cli_generate_rc_parse_requirements "$@"
2216 dev_tools_cli_generate_rc_parse_requirements "$@"
2187 shift $#
2217 shift $#
2188 ;;
2218 ;;
2189
2219
2190 cli-generate-dev)
2220 cli-generate-dev)
2191 action="cli-generate-dev"
2221 action="cli-generate-dev"
2192 shift
2222 shift
2193 dev_tools_cli_generate_dev_parse_requirements "$@"
2223 dev_tools_cli_generate_dev_parse_requirements "$@"
2194 shift $#
2224 shift $#
2195 ;;
2225 ;;
2196
2226
2197 get-build-artifacts)
2227 get-build-artifacts)
2198 action="get-build-artifacts"
2228 action="get-build-artifacts"
2199 shift
2229 shift
2200 dev_tools_get_build_artifacts_parse_requirements "$@"
2230 dev_tools_get_build_artifacts_parse_requirements "$@"
2201 shift $#
2231 shift $#
2202 ;;
2232 ;;
2203
2233
2204 build-installer)
2234 build-installer)
2205 action="build-installer"
2235 action="build-installer"
2206 shift
2236 shift
2207 dev_tools_build_installer_parse_requirements "$@"
2237 dev_tools_build_installer_parse_requirements "$@"
2208 shift $#
2238 shift $#
2209 ;;
2239 ;;
2210
2240
2211 get-build-source)
2241 get-build-source)
2212 action="get-build-source"
2242 action="get-build-source"
2213 shift
2243 shift
2214 dev_tools_get_build_source_parse_requirements "$@"
2244 dev_tools_get_build_source_parse_requirements "$@"
2215 shift $#
2245 shift $#
2216 ;;
2246 ;;
2217
2247
2218 build-source)
2248 build-source)
2219 action="build-source"
2249 action="build-source"
2220 shift
2250 shift
2221 dev_tools_build_source_parse_requirements "$@"
2251 dev_tools_build_source_parse_requirements "$@"
2222 shift $#
2252 shift $#
2223 ;;
2253 ;;
2224
2254
2225 # :command.command_fallback
2255 # :command.command_fallback
2226 "")
2256 "")
2227 dev_tools_usage >&2
2257 dev_tools_usage >&2
2228 exit 1
2258 exit 1
2229 ;;
2259 ;;
2230
2260
2231 *)
2261 *)
2232 printf "invalid command: %s\n" "$action" >&2
2262 printf "invalid command: %s\n" "$action" >&2
2233 exit 1
2263 exit 1
2234 ;;
2264 ;;
2235
2265
2236 esac
2266 esac
2237
2267
2238 # :command.parse_requirements_while
2268 # :command.parse_requirements_while
2239 while [[ $# -gt 0 ]]; do
2269 while [[ $# -gt 0 ]]; do
2240 key="$1"
2270 key="$1"
2241 case "$key" in
2271 case "$key" in
2242
2272
2243 -?*)
2273 -?*)
2244 printf "invalid option: %s\n" "$key" >&2
2274 printf "invalid option: %s\n" "$key" >&2
2245 exit 1
2275 exit 1
2246 ;;
2276 ;;
2247
2277
2248 *)
2278 *)
2249 # :command.parse_requirements_case
2279 # :command.parse_requirements_case
2250 # :command.parse_requirements_case_simple
2280 # :command.parse_requirements_case_simple
2251 printf "invalid argument: %s\n" "$key" >&2
2281 printf "invalid argument: %s\n" "$key" >&2
2252 exit 1
2282 exit 1
2253
2283
2254 ;;
2284 ;;
2255
2285
2256 esac
2286 esac
2257 done
2287 done
2258
2288
2259 }
2289 }
2260
2290
2261 # :command.parse_requirements
2291 # :command.parse_requirements
2262 dev_tools_vcs_parse_requirements() {
2292 dev_tools_vcs_parse_requirements() {
2263 # :command.fixed_flags_filter
2293 # :command.fixed_flags_filter
2264 while [[ $# -gt 0 ]]; do
2294 while [[ $# -gt 0 ]]; do
2265 case "${1:-}" in
2295 case "${1:-}" in
2266 --help | -h)
2296 --help | -h)
2267 long_usage=yes
2297 long_usage=yes
2268 dev_tools_vcs_usage
2298 dev_tools_vcs_usage
2269 exit
2299 exit
2270 ;;
2300 ;;
2271
2301
2272 *)
2302 *)
2273 break
2303 break
2274 ;;
2304 ;;
2275
2305
2276 esac
2306 esac
2277 done
2307 done
2278
2308
2279 # :command.command_filter
2309 # :command.command_filter
2280 action="vcs"
2310 action="vcs"
2281
2311
2282 # :command.parse_requirements_while
2312 # :command.parse_requirements_while
2283 while [[ $# -gt 0 ]]; do
2313 while [[ $# -gt 0 ]]; do
2284 key="$1"
2314 key="$1"
2285 case "$key" in
2315 case "$key" in
2286 # :flag.case
2316 # :flag.case
2287 --workdir)
2317 --workdir)
2288
2318
2289 # :flag.case_arg
2319 # :flag.case_arg
2290 if [[ -n ${2+x} ]]; then
2320 if [[ -n ${2+x} ]]; then
2291
2321
2292 args['--workdir']="$2"
2322 args['--workdir']="$2"
2293 shift
2323 shift
2294 shift
2324 shift
2295 else
2325 else
2296 printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2
2326 printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2
2297 exit 1
2327 exit 1
2298 fi
2328 fi
2299 ;;
2329 ;;
2300
2330
2301 # :flag.case
2331 # :flag.case
2302 --cmd)
2332 --cmd)
2303
2333
2304 # :flag.case_arg
2334 # :flag.case_arg
2305 if [[ -n ${2+x} ]]; then
2335 if [[ -n ${2+x} ]]; then
2306
2336
2307 args['--cmd']="$2"
2337 args['--cmd']="$2"
2308 shift
2338 shift
2309 shift
2339 shift
2310 else
2340 else
2311 printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2
2341 printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2
2312 exit 1
2342 exit 1
2313 fi
2343 fi
2314 ;;
2344 ;;
2315
2345
2316 # :flag.case
2346 # :flag.case
2317 --no-tty)
2347 --no-tty)
2318
2348
2319 # :flag.case_no_arg
2349 # :flag.case_no_arg
2320 args['--no-tty']=1
2350 args['--no-tty']=1
2321 shift
2351 shift
2322 ;;
2352 ;;
2323
2353
2324 -?*)
2354 -?*)
2325 printf "invalid option: %s\n" "$key" >&2
2355 printf "invalid option: %s\n" "$key" >&2
2326 exit 1
2356 exit 1
2327 ;;
2357 ;;
2328
2358
2329 *)
2359 *)
2330 # :command.parse_requirements_case
2360 # :command.parse_requirements_case
2331 # :command.parse_requirements_case_simple
2361 # :command.parse_requirements_case_simple
2332 printf "invalid argument: %s\n" "$key" >&2
2362 printf "invalid argument: %s\n" "$key" >&2
2333 exit 1
2363 exit 1
2334
2364
2335 ;;
2365 ;;
2336
2366
2337 esac
2367 esac
2338 done
2368 done
2339
2369
2340 # :command.default_assignments
2370 # :command.default_assignments
2341 [[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-vcsserver"
2371 [[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-vcsserver"
2342 [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-vcs.sh"
2372 [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-vcs.sh"
2343
2373
2344 }
2374 }
2345
2375
2346 # :command.parse_requirements
2376 # :command.parse_requirements
2347 dev_tools_ce_parse_requirements() {
2377 dev_tools_ce_parse_requirements() {
2348 # :command.fixed_flags_filter
2378 # :command.fixed_flags_filter
2349 while [[ $# -gt 0 ]]; do
2379 while [[ $# -gt 0 ]]; do
2350 case "${1:-}" in
2380 case "${1:-}" in
2351 --help | -h)
2381 --help | -h)
2352 long_usage=yes
2382 long_usage=yes
2353 dev_tools_ce_usage
2383 dev_tools_ce_usage
2354 exit
2384 exit
2355 ;;
2385 ;;
2356
2386
2357 *)
2387 *)
2358 break
2388 break
2359 ;;
2389 ;;
2360
2390
2361 esac
2391 esac
2362 done
2392 done
2363
2393
2364 # :command.command_filter
2394 # :command.command_filter
2365 action="ce"
2395 action="ce"
2366
2396
2367 # :command.parse_requirements_while
2397 # :command.parse_requirements_while
2368 while [[ $# -gt 0 ]]; do
2398 while [[ $# -gt 0 ]]; do
2369 key="$1"
2399 key="$1"
2370 case "$key" in
2400 case "$key" in
2371 # :flag.case
2401 # :flag.case
2372 --workdir)
2402 --workdir)
2373
2403
2374 # :flag.case_arg
2404 # :flag.case_arg
2375 if [[ -n ${2+x} ]]; then
2405 if [[ -n ${2+x} ]]; then
2376
2406
2377 args['--workdir']="$2"
2407 args['--workdir']="$2"
2378 shift
2408 shift
2379 shift
2409 shift
2380 else
2410 else
2381 printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2
2411 printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2
2382 exit 1
2412 exit 1
2383 fi
2413 fi
2384 ;;
2414 ;;
2385
2415
2386 # :flag.case
2416 # :flag.case
2387 --cmd)
2417 --cmd)
2388
2418
2389 # :flag.case_arg
2419 # :flag.case_arg
2390 if [[ -n ${2+x} ]]; then
2420 if [[ -n ${2+x} ]]; then
2391
2421
2392 args['--cmd']="$2"
2422 args['--cmd']="$2"
2393 shift
2423 shift
2394 shift
2424 shift
2395 else
2425 else
2396 printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2
2426 printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2
2397 exit 1
2427 exit 1
2398 fi
2428 fi
2399 ;;
2429 ;;
2400
2430
2401 # :flag.case
2431 # :flag.case
2402 --no-tty)
2432 --no-tty)
2403
2433
2404 # :flag.case_no_arg
2434 # :flag.case_no_arg
2405 args['--no-tty']=1
2435 args['--no-tty']=1
2406 shift
2436 shift
2407 ;;
2437 ;;
2408
2438
2409 -?*)
2439 -?*)
2410 printf "invalid option: %s\n" "$key" >&2
2440 printf "invalid option: %s\n" "$key" >&2
2411 exit 1
2441 exit 1
2412 ;;
2442 ;;
2413
2443
2414 *)
2444 *)
2415 # :command.parse_requirements_case
2445 # :command.parse_requirements_case
2416 # :command.parse_requirements_case_simple
2446 # :command.parse_requirements_case_simple
2417 printf "invalid argument: %s\n" "$key" >&2
2447 printf "invalid argument: %s\n" "$key" >&2
2418 exit 1
2448 exit 1
2419
2449
2420 ;;
2450 ;;
2421
2451
2422 esac
2452 esac
2423 done
2453 done
2424
2454
2425 # :command.default_assignments
2455 # :command.default_assignments
2426 [[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce"
2456 [[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce"
2427 [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-ce.sh"
2457 [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-ce.sh"
2428
2458
2429 }
2459 }
2430
2460
2431 # :command.parse_requirements
2461 # :command.parse_requirements
2432 dev_tools_ee_parse_requirements() {
2462 dev_tools_ee_parse_requirements() {
2433 # :command.fixed_flags_filter
2463 # :command.fixed_flags_filter
2434 while [[ $# -gt 0 ]]; do
2464 while [[ $# -gt 0 ]]; do
2435 case "${1:-}" in
2465 case "${1:-}" in
2436 --help | -h)
2466 --help | -h)
2437 long_usage=yes
2467 long_usage=yes
2438 dev_tools_ee_usage
2468 dev_tools_ee_usage
2439 exit
2469 exit
2440 ;;
2470 ;;
2441
2471
2442 *)
2472 *)
2443 break
2473 break
2444 ;;
2474 ;;
2445
2475
2446 esac
2476 esac
2447 done
2477 done
2448
2478
2449 # :command.command_filter
2479 # :command.command_filter
2450 action="ee"
2480 action="ee"
2451
2481
2452 # :command.parse_requirements_while
2482 # :command.parse_requirements_while
2453 while [[ $# -gt 0 ]]; do
2483 while [[ $# -gt 0 ]]; do
2454 key="$1"
2484 key="$1"
2455 case "$key" in
2485 case "$key" in
2456 # :flag.case
2486 # :flag.case
2457 --workdir)
2487 --workdir)
2458
2488
2459 # :flag.case_arg
2489 # :flag.case_arg
2460 if [[ -n ${2+x} ]]; then
2490 if [[ -n ${2+x} ]]; then
2461
2491
2462 args['--workdir']="$2"
2492 args['--workdir']="$2"
2463 shift
2493 shift
2464 shift
2494 shift
2465 else
2495 else
2466 printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2
2496 printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2
2467 exit 1
2497 exit 1
2468 fi
2498 fi
2469 ;;
2499 ;;
2470
2500
2471 # :flag.case
2501 # :flag.case
2472 --cmd)
2502 --cmd)
2473
2503
2474 # :flag.case_arg
2504 # :flag.case_arg
2475 if [[ -n ${2+x} ]]; then
2505 if [[ -n ${2+x} ]]; then
2476
2506
2477 args['--cmd']="$2"
2507 args['--cmd']="$2"
2478 shift
2508 shift
2479 shift
2509 shift
2480 else
2510 else
2481 printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2
2511 printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2
2482 exit 1
2512 exit 1
2483 fi
2513 fi
2484 ;;
2514 ;;
2485
2515
2486 # :flag.case
2516 # :flag.case
2487 --no-tty)
2517 --no-tty)
2488
2518
2489 # :flag.case_no_arg
2519 # :flag.case_no_arg
2490 args['--no-tty']=1
2520 args['--no-tty']=1
2491 shift
2521 shift
2492 ;;
2522 ;;
2493
2523
2494 -?*)
2524 -?*)
2495 printf "invalid option: %s\n" "$key" >&2
2525 printf "invalid option: %s\n" "$key" >&2
2496 exit 1
2526 exit 1
2497 ;;
2527 ;;
2498
2528
2499 *)
2529 *)
2500 # :command.parse_requirements_case
2530 # :command.parse_requirements_case
2501 # :command.parse_requirements_case_simple
2531 # :command.parse_requirements_case_simple
2502 printf "invalid argument: %s\n" "$key" >&2
2532 printf "invalid argument: %s\n" "$key" >&2
2503 exit 1
2533 exit 1
2504
2534
2505 ;;
2535 ;;
2506
2536
2507 esac
2537 esac
2508 done
2538 done
2509
2539
2510 # :command.default_assignments
2540 # :command.default_assignments
2511 [[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ee"
2541 [[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ee"
2512 [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-ee.sh"
2542 [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-ee.sh"
2513
2543
2514 }
2544 }
2515
2545
2516 # :command.parse_requirements
2546 # :command.parse_requirements
2517 dev_tools_celery_parse_requirements() {
2547 dev_tools_celery_parse_requirements() {
2518 # :command.fixed_flags_filter
2548 # :command.fixed_flags_filter
2519 while [[ $# -gt 0 ]]; do
2549 while [[ $# -gt 0 ]]; do
2520 case "${1:-}" in
2550 case "${1:-}" in
2521 --help | -h)
2551 --help | -h)
2522 long_usage=yes
2552 long_usage=yes
2523 dev_tools_celery_usage
2553 dev_tools_celery_usage
2524 exit
2554 exit
2525 ;;
2555 ;;
2526
2556
2527 *)
2557 *)
2528 break
2558 break
2529 ;;
2559 ;;
2530
2560
2531 esac
2561 esac
2532 done
2562 done
2533
2563
2534 # :command.command_filter
2564 # :command.command_filter
2535 action="celery"
2565 action="celery"
2536
2566
2537 # :command.parse_requirements_while
2567 # :command.parse_requirements_while
2538 while [[ $# -gt 0 ]]; do
2568 while [[ $# -gt 0 ]]; do
2539 key="$1"
2569 key="$1"
2540 case "$key" in
2570 case "$key" in
2541 # :flag.case
2571 # :flag.case
2542 --workdir)
2572 --workdir)
2543
2573
2544 # :flag.case_arg
2574 # :flag.case_arg
2545 if [[ -n ${2+x} ]]; then
2575 if [[ -n ${2+x} ]]; then
2546
2576
2547 args['--workdir']="$2"
2577 args['--workdir']="$2"
2548 shift
2578 shift
2549 shift
2579 shift
2550 else
2580 else
2551 printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2
2581 printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2
2552 exit 1
2582 exit 1
2553 fi
2583 fi
2554 ;;
2584 ;;
2555
2585
2556 # :flag.case
2586 # :flag.case
2557 --cmd)
2587 --cmd)
2558
2588
2559 # :flag.case_arg
2589 # :flag.case_arg
2560 if [[ -n ${2+x} ]]; then
2590 if [[ -n ${2+x} ]]; then
2561
2591
2562 args['--cmd']="$2"
2592 args['--cmd']="$2"
2563 shift
2593 shift
2564 shift
2594 shift
2565 else
2595 else
2566 printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2
2596 printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2
2567 exit 1
2597 exit 1
2568 fi
2598 fi
2569 ;;
2599 ;;
2570
2600
2571 -?*)
2601 -?*)
2572 printf "invalid option: %s\n" "$key" >&2
2602 printf "invalid option: %s\n" "$key" >&2
2573 exit 1
2603 exit 1
2574 ;;
2604 ;;
2575
2605
2576 *)
2606 *)
2577 # :command.parse_requirements_case
2607 # :command.parse_requirements_case
2578 # :command.parse_requirements_case_simple
2608 # :command.parse_requirements_case_simple
2579 printf "invalid argument: %s\n" "$key" >&2
2609 printf "invalid argument: %s\n" "$key" >&2
2580 exit 1
2610 exit 1
2581
2611
2582 ;;
2612 ;;
2583
2613
2584 esac
2614 esac
2585 done
2615 done
2586
2616
2587 # :command.default_assignments
2617 # :command.default_assignments
2588 [[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce"
2618 [[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce"
2589 [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-celery.sh"
2619 [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-celery.sh"
2590
2620
2591 }
2621 }
2592
2622
2593 # :command.parse_requirements
2623 # :command.parse_requirements
2594 dev_tools_celeryd_parse_requirements() {
2624 dev_tools_celeryd_parse_requirements() {
2595 # :command.fixed_flags_filter
2625 # :command.fixed_flags_filter
2596 while [[ $# -gt 0 ]]; do
2626 while [[ $# -gt 0 ]]; do
2597 case "${1:-}" in
2627 case "${1:-}" in
2598 --help | -h)
2628 --help | -h)
2599 long_usage=yes
2629 long_usage=yes
2600 dev_tools_celeryd_usage
2630 dev_tools_celeryd_usage
2601 exit
2631 exit
2602 ;;
2632 ;;
2603
2633
2604 *)
2634 *)
2605 break
2635 break
2606 ;;
2636 ;;
2607
2637
2608 esac
2638 esac
2609 done
2639 done
2610
2640
2611 # :command.command_filter
2641 # :command.command_filter
2612 action="celeryd"
2642 action="celeryd"
2613
2643
2614 # :command.parse_requirements_while
2644 # :command.parse_requirements_while
2615 while [[ $# -gt 0 ]]; do
2645 while [[ $# -gt 0 ]]; do
2616 key="$1"
2646 key="$1"
2617 case "$key" in
2647 case "$key" in
2618 # :flag.case
2648 # :flag.case
2619 --workdir)
2649 --workdir)
2620
2650
2621 # :flag.case_arg
2651 # :flag.case_arg
2622 if [[ -n ${2+x} ]]; then
2652 if [[ -n ${2+x} ]]; then
2623
2653
2624 args['--workdir']="$2"
2654 args['--workdir']="$2"
2625 shift
2655 shift
2626 shift
2656 shift
2627 else
2657 else
2628 printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2
2658 printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2
2629 exit 1
2659 exit 1
2630 fi
2660 fi
2631 ;;
2661 ;;
2632
2662
2633 # :flag.case
2663 # :flag.case
2634 --cmd)
2664 --cmd)
2635
2665
2636 # :flag.case_arg
2666 # :flag.case_arg
2637 if [[ -n ${2+x} ]]; then
2667 if [[ -n ${2+x} ]]; then
2638
2668
2639 args['--cmd']="$2"
2669 args['--cmd']="$2"
2640 shift
2670 shift
2641 shift
2671 shift
2642 else
2672 else
2643 printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2
2673 printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2
2644 exit 1
2674 exit 1
2645 fi
2675 fi
2646 ;;
2676 ;;
2647
2677
2678 # :flag.case
2679 --force-cmd)
2680
2681 # :flag.case_no_arg
2682 args['--force-cmd']=1
2683 shift
2684 ;;
2685
2648 -?*)
2686 -?*)
2649 printf "invalid option: %s\n" "$key" >&2
2687 printf "invalid option: %s\n" "$key" >&2
2650 exit 1
2688 exit 1
2651 ;;
2689 ;;
2652
2690
2653 *)
2691 *)
2654 # :command.parse_requirements_case
2692 # :command.parse_requirements_case
2655 # :command.parse_requirements_case_simple
2693 # :command.parse_requirements_case_simple
2656 printf "invalid argument: %s\n" "$key" >&2
2694 printf "invalid argument: %s\n" "$key" >&2
2657 exit 1
2695 exit 1
2658
2696
2659 ;;
2697 ;;
2660
2698
2661 esac
2699 esac
2662 done
2700 done
2663
2701
2664 # :command.default_assignments
2702 # :command.default_assignments
2665 [[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce"
2703 [[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce"
2666 [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-celeryd.sh"
2704 [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-celeryd.sh"
2667
2705
2668 }
2706 }
2669
2707
2670 # :command.parse_requirements
2708 # :command.parse_requirements
2671 dev_tools_ssh_parse_requirements() {
2709 dev_tools_ssh_parse_requirements() {
2672 # :command.fixed_flags_filter
2710 # :command.fixed_flags_filter
2673 while [[ $# -gt 0 ]]; do
2711 while [[ $# -gt 0 ]]; do
2674 case "${1:-}" in
2712 case "${1:-}" in
2675 --help | -h)
2713 --help | -h)
2676 long_usage=yes
2714 long_usage=yes
2677 dev_tools_ssh_usage
2715 dev_tools_ssh_usage
2678 exit
2716 exit
2679 ;;
2717 ;;
2680
2718
2681 *)
2719 *)
2682 break
2720 break
2683 ;;
2721 ;;
2684
2722
2685 esac
2723 esac
2686 done
2724 done
2687
2725
2688 # :command.command_filter
2726 # :command.command_filter
2689 action="ssh"
2727 action="ssh"
2690
2728
2691 # :command.parse_requirements_while
2729 # :command.parse_requirements_while
2692 while [[ $# -gt 0 ]]; do
2730 while [[ $# -gt 0 ]]; do
2693 key="$1"
2731 key="$1"
2694 case "$key" in
2732 case "$key" in
2695 # :flag.case
2733 # :flag.case
2696 --workdir)
2734 --workdir)
2697
2735
2698 # :flag.case_arg
2736 # :flag.case_arg
2699 if [[ -n ${2+x} ]]; then
2737 if [[ -n ${2+x} ]]; then
2700
2738
2701 args['--workdir']="$2"
2739 args['--workdir']="$2"
2702 shift
2740 shift
2703 shift
2741 shift
2704 else
2742 else
2705 printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2
2743 printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2
2706 exit 1
2744 exit 1
2707 fi
2745 fi
2708 ;;
2746 ;;
2709
2747
2710 # :flag.case
2748 # :flag.case
2711 --cmd)
2749 --cmd)
2712
2750
2713 # :flag.case_arg
2751 # :flag.case_arg
2714 if [[ -n ${2+x} ]]; then
2752 if [[ -n ${2+x} ]]; then
2715
2753
2716 args['--cmd']="$2"
2754 args['--cmd']="$2"
2717 shift
2755 shift
2718 shift
2756 shift
2719 else
2757 else
2720 printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2
2758 printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2
2721 exit 1
2759 exit 1
2722 fi
2760 fi
2723 ;;
2761 ;;
2724
2762
2725 -?*)
2763 -?*)
2726 printf "invalid option: %s\n" "$key" >&2
2764 printf "invalid option: %s\n" "$key" >&2
2727 exit 1
2765 exit 1
2728 ;;
2766 ;;
2729
2767
2730 *)
2768 *)
2731 # :command.parse_requirements_case
2769 # :command.parse_requirements_case
2732 # :command.parse_requirements_case_simple
2770 # :command.parse_requirements_case_simple
2733 printf "invalid argument: %s\n" "$key" >&2
2771 printf "invalid argument: %s\n" "$key" >&2
2734 exit 1
2772 exit 1
2735
2773
2736 ;;
2774 ;;
2737
2775
2738 esac
2776 esac
2739 done
2777 done
2740
2778
2741 # :command.default_assignments
2779 # :command.default_assignments
2742 [[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce"
2780 [[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce"
2743 [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-ssh.sh"
2781 [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-ssh.sh"
2744
2782
2745 }
2783 }
2746
2784
2747 # :command.parse_requirements
2785 # :command.parse_requirements
2748 dev_tools_sshd_parse_requirements() {
2786 dev_tools_sshd_parse_requirements() {
2749 # :command.fixed_flags_filter
2787 # :command.fixed_flags_filter
2750 while [[ $# -gt 0 ]]; do
2788 while [[ $# -gt 0 ]]; do
2751 case "${1:-}" in
2789 case "${1:-}" in
2752 --help | -h)
2790 --help | -h)
2753 long_usage=yes
2791 long_usage=yes
2754 dev_tools_sshd_usage
2792 dev_tools_sshd_usage
2755 exit
2793 exit
2756 ;;
2794 ;;
2757
2795
2758 *)
2796 *)
2759 break
2797 break
2760 ;;
2798 ;;
2761
2799
2762 esac
2800 esac
2763 done
2801 done
2764
2802
2765 # :command.command_filter
2803 # :command.command_filter
2766 action="sshd"
2804 action="sshd"
2767
2805
2768 # :command.parse_requirements_while
2806 # :command.parse_requirements_while
2769 while [[ $# -gt 0 ]]; do
2807 while [[ $# -gt 0 ]]; do
2770 key="$1"
2808 key="$1"
2771 case "$key" in
2809 case "$key" in
2772 # :flag.case
2810 # :flag.case
2773 --workdir)
2811 --workdir)
2774
2812
2775 # :flag.case_arg
2813 # :flag.case_arg
2776 if [[ -n ${2+x} ]]; then
2814 if [[ -n ${2+x} ]]; then
2777
2815
2778 args['--workdir']="$2"
2816 args['--workdir']="$2"
2779 shift
2817 shift
2780 shift
2818 shift
2781 else
2819 else
2782 printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2
2820 printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2
2783 exit 1
2821 exit 1
2784 fi
2822 fi
2785 ;;
2823 ;;
2786
2824
2787 # :flag.case
2825 # :flag.case
2788 --cmd)
2826 --cmd)
2789
2827
2790 # :flag.case_arg
2828 # :flag.case_arg
2791 if [[ -n ${2+x} ]]; then
2829 if [[ -n ${2+x} ]]; then
2792
2830
2793 args['--cmd']="$2"
2831 args['--cmd']="$2"
2794 shift
2832 shift
2795 shift
2833 shift
2796 else
2834 else
2797 printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2
2835 printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2
2798 exit 1
2836 exit 1
2799 fi
2837 fi
2800 ;;
2838 ;;
2801
2839
2840 # :flag.case
2841 --force-cmd)
2842
2843 # :flag.case_no_arg
2844 args['--force-cmd']=1
2845 shift
2846 ;;
2847
2802 -?*)
2848 -?*)
2803 printf "invalid option: %s\n" "$key" >&2
2849 printf "invalid option: %s\n" "$key" >&2
2804 exit 1
2850 exit 1
2805 ;;
2851 ;;
2806
2852
2807 *)
2853 *)
2808 # :command.parse_requirements_case
2854 # :command.parse_requirements_case
2809 # :command.parse_requirements_case_simple
2855 # :command.parse_requirements_case_simple
2810 printf "invalid argument: %s\n" "$key" >&2
2856 printf "invalid argument: %s\n" "$key" >&2
2811 exit 1
2857 exit 1
2812
2858
2813 ;;
2859 ;;
2814
2860
2815 esac
2861 esac
2816 done
2862 done
2817
2863
2818 # :command.default_assignments
2864 # :command.default_assignments
2819 [[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce"
2865 [[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce"
2820 [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-sshd.sh"
2866 [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-sshd.sh"
2821
2867
2822 }
2868 }
2823
2869
2824 # :command.parse_requirements
2870 # :command.parse_requirements
2825 dev_tools_svn_parse_requirements() {
2871 dev_tools_svn_parse_requirements() {
2826 # :command.fixed_flags_filter
2872 # :command.fixed_flags_filter
2827 while [[ $# -gt 0 ]]; do
2873 while [[ $# -gt 0 ]]; do
2828 case "${1:-}" in
2874 case "${1:-}" in
2829 --help | -h)
2875 --help | -h)
2830 long_usage=yes
2876 long_usage=yes
2831 dev_tools_svn_usage
2877 dev_tools_svn_usage
2832 exit
2878 exit
2833 ;;
2879 ;;
2834
2880
2835 *)
2881 *)
2836 break
2882 break
2837 ;;
2883 ;;
2838
2884
2839 esac
2885 esac
2840 done
2886 done
2841
2887
2842 # :command.command_filter
2888 # :command.command_filter
2843 action="svn"
2889 action="svn"
2844
2890
2845 # :command.parse_requirements_while
2891 # :command.parse_requirements_while
2846 while [[ $# -gt 0 ]]; do
2892 while [[ $# -gt 0 ]]; do
2847 key="$1"
2893 key="$1"
2848 case "$key" in
2894 case "$key" in
2849 # :flag.case
2895 # :flag.case
2850 --workdir)
2896 --workdir)
2851
2897
2852 # :flag.case_arg
2898 # :flag.case_arg
2853 if [[ -n ${2+x} ]]; then
2899 if [[ -n ${2+x} ]]; then
2854
2900
2855 args['--workdir']="$2"
2901 args['--workdir']="$2"
2856 shift
2902 shift
2857 shift
2903 shift
2858 else
2904 else
2859 printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2
2905 printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2
2860 exit 1
2906 exit 1
2861 fi
2907 fi
2862 ;;
2908 ;;
2863
2909
2864 # :flag.case
2910 # :flag.case
2865 --cmd)
2911 --cmd)
2866
2912
2867 # :flag.case_arg
2913 # :flag.case_arg
2868 if [[ -n ${2+x} ]]; then
2914 if [[ -n ${2+x} ]]; then
2869
2915
2870 args['--cmd']="$2"
2916 args['--cmd']="$2"
2871 shift
2917 shift
2872 shift
2918 shift
2873 else
2919 else
2874 printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2
2920 printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2
2875 exit 1
2921 exit 1
2876 fi
2922 fi
2877 ;;
2923 ;;
2878
2924
2879 -?*)
2925 -?*)
2880 printf "invalid option: %s\n" "$key" >&2
2926 printf "invalid option: %s\n" "$key" >&2
2881 exit 1
2927 exit 1
2882 ;;
2928 ;;
2883
2929
2884 *)
2930 *)
2885 # :command.parse_requirements_case
2931 # :command.parse_requirements_case
2886 # :command.parse_requirements_case_simple
2932 # :command.parse_requirements_case_simple
2887 printf "invalid argument: %s\n" "$key" >&2
2933 printf "invalid argument: %s\n" "$key" >&2
2888 exit 1
2934 exit 1
2889
2935
2890 ;;
2936 ;;
2891
2937
2892 esac
2938 esac
2893 done
2939 done
2894
2940
2895 # :command.default_assignments
2941 # :command.default_assignments
2896 [[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce"
2942 [[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce"
2897 [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-svn.sh"
2943 [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-svn.sh"
2898
2944
2899 }
2945 }
2900
2946
2901 # :command.parse_requirements
2947 # :command.parse_requirements
2902 dev_tools_svnd_parse_requirements() {
2948 dev_tools_svnd_parse_requirements() {
2903 # :command.fixed_flags_filter
2949 # :command.fixed_flags_filter
2904 while [[ $# -gt 0 ]]; do
2950 while [[ $# -gt 0 ]]; do
2905 case "${1:-}" in
2951 case "${1:-}" in
2906 --help | -h)
2952 --help | -h)
2907 long_usage=yes
2953 long_usage=yes
2908 dev_tools_svnd_usage
2954 dev_tools_svnd_usage
2909 exit
2955 exit
2910 ;;
2956 ;;
2911
2957
2912 *)
2958 *)
2913 break
2959 break
2914 ;;
2960 ;;
2915
2961
2916 esac
2962 esac
2917 done
2963 done
2918
2964
2919 # :command.command_filter
2965 # :command.command_filter
2920 action="svnd"
2966 action="svnd"
2921
2967
2922 # :command.parse_requirements_while
2968 # :command.parse_requirements_while
2923 while [[ $# -gt 0 ]]; do
2969 while [[ $# -gt 0 ]]; do
2924 key="$1"
2970 key="$1"
2925 case "$key" in
2971 case "$key" in
2926 # :flag.case
2972 # :flag.case
2927 --workdir)
2973 --workdir)
2928
2974
2929 # :flag.case_arg
2975 # :flag.case_arg
2930 if [[ -n ${2+x} ]]; then
2976 if [[ -n ${2+x} ]]; then
2931
2977
2932 args['--workdir']="$2"
2978 args['--workdir']="$2"
2933 shift
2979 shift
2934 shift
2980 shift
2935 else
2981 else
2936 printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2
2982 printf "%s\n" "--workdir requires an argument: --workdir WORKDIR" >&2
2937 exit 1
2983 exit 1
2938 fi
2984 fi
2939 ;;
2985 ;;
2940
2986
2941 # :flag.case
2987 # :flag.case
2942 --cmd)
2988 --cmd)
2943
2989
2944 # :flag.case_arg
2990 # :flag.case_arg
2945 if [[ -n ${2+x} ]]; then
2991 if [[ -n ${2+x} ]]; then
2946
2992
2947 args['--cmd']="$2"
2993 args['--cmd']="$2"
2948 shift
2994 shift
2949 shift
2995 shift
2950 else
2996 else
2951 printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2
2997 printf "%s\n" "--cmd requires an argument: --cmd CMD" >&2
2952 exit 1
2998 exit 1
2953 fi
2999 fi
2954 ;;
3000 ;;
2955
3001
3002 # :flag.case
3003 --force-cmd)
3004
3005 # :flag.case_no_arg
3006 args['--force-cmd']=1
3007 shift
3008 ;;
3009
2956 -?*)
3010 -?*)
2957 printf "invalid option: %s\n" "$key" >&2
3011 printf "invalid option: %s\n" "$key" >&2
2958 exit 1
3012 exit 1
2959 ;;
3013 ;;
2960
3014
2961 *)
3015 *)
2962 # :command.parse_requirements_case
3016 # :command.parse_requirements_case
2963 # :command.parse_requirements_case_simple
3017 # :command.parse_requirements_case_simple
2964 printf "invalid argument: %s\n" "$key" >&2
3018 printf "invalid argument: %s\n" "$key" >&2
2965 exit 1
3019 exit 1
2966
3020
2967 ;;
3021 ;;
2968
3022
2969 esac
3023 esac
2970 done
3024 done
2971
3025
2972 # :command.default_assignments
3026 # :command.default_assignments
2973 [[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce"
3027 [[ -n ${args['--workdir']:-} ]] || args['--workdir']="/home/rhodecode/rhodecode-enterprise-ce"
2974 [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-svnd.sh"
3028 [[ -n ${args['--cmd']:-} ]] || args['--cmd']=".dev-env/cmd-svnd.sh"
2975
3029
2976 }
3030 }
2977
3031
2978 # :command.parse_requirements
3032 # :command.parse_requirements
2979 dev_tools_tools_parse_requirements() {
3033 dev_tools_tools_parse_requirements() {
2980 # :command.fixed_flags_filter
3034 # :command.fixed_flags_filter
2981 while [[ $# -gt 0 ]]; do
3035 while [[ $# -gt 0 ]]; do
2982 case "${1:-}" in
3036 case "${1:-}" in
2983 --help | -h)
3037 --help | -h)
2984 long_usage=yes
3038 long_usage=yes
2985 dev_tools_tools_usage
3039 dev_tools_tools_usage
2986 exit
3040 exit
2987 ;;
3041 ;;
2988
3042
2989 *)
3043 *)
2990 break
3044 break
2991 ;;
3045 ;;
2992
3046
2993 esac
3047 esac
2994 done
3048 done
2995
3049
2996 # :command.command_filter
3050 # :command.command_filter
2997 action="tools"
3051 action="tools"
2998
3052
2999 # :command.parse_requirements_while
3053 # :command.parse_requirements_while
3000 while [[ $# -gt 0 ]]; do
3054 while [[ $# -gt 0 ]]; do
3001 key="$1"
3055 key="$1"
3002 case "$key" in
3056 case "$key" in
3003
3057
3004 -?*)
3058 -?*)
3005 printf "invalid option: %s\n" "$key" >&2
3059 printf "invalid option: %s\n" "$key" >&2
3006 exit 1
3060 exit 1
3007 ;;
3061 ;;
3008
3062
3009 *)
3063 *)
3010 # :command.parse_requirements_case
3064 # :command.parse_requirements_case
3011 # :command.parse_requirements_case_simple
3065 # :command.parse_requirements_case_simple
3012 printf "invalid argument: %s\n" "$key" >&2
3066 printf "invalid argument: %s\n" "$key" >&2
3013 exit 1
3067 exit 1
3014
3068
3015 ;;
3069 ;;
3016
3070
3017 esac
3071 esac
3018 done
3072 done
3019
3073
3020 }
3074 }
3021
3075
3022 # :command.parse_requirements
3076 # :command.parse_requirements
3023 dev_tools_dev_env_parse_requirements() {
3077 dev_tools_dev_env_parse_requirements() {
3024 # :command.fixed_flags_filter
3078 # :command.fixed_flags_filter
3025 while [[ $# -gt 0 ]]; do
3079 while [[ $# -gt 0 ]]; do
3026 case "${1:-}" in
3080 case "${1:-}" in
3027 --help | -h)
3081 --help | -h)
3028 long_usage=yes
3082 long_usage=yes
3029 dev_tools_dev_env_usage
3083 dev_tools_dev_env_usage
3030 exit
3084 exit
3031 ;;
3085 ;;
3032
3086
3033 *)
3087 *)
3034 break
3088 break
3035 ;;
3089 ;;
3036
3090
3037 esac
3091 esac
3038 done
3092 done
3039
3093
3040 # :command.command_filter
3094 # :command.command_filter
3041 action="dev-env"
3095 action="dev-env"
3042
3096
3043 # :command.parse_requirements_while
3097 # :command.parse_requirements_while
3044 while [[ $# -gt 0 ]]; do
3098 while [[ $# -gt 0 ]]; do
3045 key="$1"
3099 key="$1"
3046 case "$key" in
3100 case "$key" in
3047
3101
3048 -?*)
3102 -?*)
3049 printf "invalid option: %s\n" "$key" >&2
3103 printf "invalid option: %s\n" "$key" >&2
3050 exit 1
3104 exit 1
3051 ;;
3105 ;;
3052
3106
3053 *)
3107 *)
3054 # :command.parse_requirements_case
3108 # :command.parse_requirements_case
3055 # :command.parse_requirements_case_simple
3109 # :command.parse_requirements_case_simple
3056 printf "invalid argument: %s\n" "$key" >&2
3110 printf "invalid argument: %s\n" "$key" >&2
3057 exit 1
3111 exit 1
3058
3112
3059 ;;
3113 ;;
3060
3114
3061 esac
3115 esac
3062 done
3116 done
3063
3117
3064 }
3118 }
3065
3119
3066 # :command.parse_requirements
3120 # :command.parse_requirements
3067 dev_tools_dev_env_stop_parse_requirements() {
3121 dev_tools_dev_env_stop_parse_requirements() {
3068 # :command.fixed_flags_filter
3122 # :command.fixed_flags_filter
3069 while [[ $# -gt 0 ]]; do
3123 while [[ $# -gt 0 ]]; do
3070 case "${1:-}" in
3124 case "${1:-}" in
3071 --help | -h)
3125 --help | -h)
3072 long_usage=yes
3126 long_usage=yes
3073 dev_tools_dev_env_stop_usage
3127 dev_tools_dev_env_stop_usage
3074 exit
3128 exit
3075 ;;
3129 ;;
3076
3130
3077 *)
3131 *)
3078 break
3132 break
3079 ;;
3133 ;;
3080
3134
3081 esac
3135 esac
3082 done
3136 done
3083
3137
3084 # :command.command_filter
3138 # :command.command_filter
3085 action="dev-env-stop"
3139 action="dev-env-stop"
3086
3140
3087 # :command.parse_requirements_while
3141 # :command.parse_requirements_while
3088 while [[ $# -gt 0 ]]; do
3142 while [[ $# -gt 0 ]]; do
3089 key="$1"
3143 key="$1"
3090 case "$key" in
3144 case "$key" in
3091
3145
3092 -?*)
3146 -?*)
3093 printf "invalid option: %s\n" "$key" >&2
3147 printf "invalid option: %s\n" "$key" >&2
3094 exit 1
3148 exit 1
3095 ;;
3149 ;;
3096
3150
3097 *)
3151 *)
3098 # :command.parse_requirements_case
3152 # :command.parse_requirements_case
3099 # :command.parse_requirements_case_simple
3153 # :command.parse_requirements_case_simple
3100 printf "invalid argument: %s\n" "$key" >&2
3154 printf "invalid argument: %s\n" "$key" >&2
3101 exit 1
3155 exit 1
3102
3156
3103 ;;
3157 ;;
3104
3158
3105 esac
3159 esac
3106 done
3160 done
3107
3161
3108 }
3162 }
3109
3163
3110 # :command.parse_requirements
3164 # :command.parse_requirements
3111 dev_tools_prune_parse_requirements() {
3165 dev_tools_prune_parse_requirements() {
3112 # :command.fixed_flags_filter
3166 # :command.fixed_flags_filter
3113 while [[ $# -gt 0 ]]; do
3167 while [[ $# -gt 0 ]]; do
3114 case "${1:-}" in
3168 case "${1:-}" in
3115 --help | -h)
3169 --help | -h)
3116 long_usage=yes
3170 long_usage=yes
3117 dev_tools_prune_usage
3171 dev_tools_prune_usage
3118 exit
3172 exit
3119 ;;
3173 ;;
3120
3174
3121 *)
3175 *)
3122 break
3176 break
3123 ;;
3177 ;;
3124
3178
3125 esac
3179 esac
3126 done
3180 done
3127
3181
3128 # :command.command_filter
3182 # :command.command_filter
3129 action="prune"
3183 action="prune"
3130
3184
3131 # :command.parse_requirements_while
3185 # :command.parse_requirements_while
3132 while [[ $# -gt 0 ]]; do
3186 while [[ $# -gt 0 ]]; do
3133 key="$1"
3187 key="$1"
3134 case "$key" in
3188 case "$key" in
3135
3189
3136 -?*)
3190 -?*)
3137 printf "invalid option: %s\n" "$key" >&2
3191 printf "invalid option: %s\n" "$key" >&2
3138 exit 1
3192 exit 1
3139 ;;
3193 ;;
3140
3194
3141 *)
3195 *)
3142 # :command.parse_requirements_case
3196 # :command.parse_requirements_case
3143 # :command.parse_requirements_case_simple
3197 # :command.parse_requirements_case_simple
3144 printf "invalid argument: %s\n" "$key" >&2
3198 printf "invalid argument: %s\n" "$key" >&2
3145 exit 1
3199 exit 1
3146
3200
3147 ;;
3201 ;;
3148
3202
3149 esac
3203 esac
3150 done
3204 done
3151
3205
3152 }
3206 }
3153
3207
3154 # :command.parse_requirements
3208 # :command.parse_requirements
3155 dev_tools_prune_all_parse_requirements() {
3209 dev_tools_prune_all_parse_requirements() {
3156 # :command.fixed_flags_filter
3210 # :command.fixed_flags_filter
3157 while [[ $# -gt 0 ]]; do
3211 while [[ $# -gt 0 ]]; do
3158 case "${1:-}" in
3212 case "${1:-}" in
3159 --help | -h)
3213 --help | -h)
3160 long_usage=yes
3214 long_usage=yes
3161 dev_tools_prune_all_usage
3215 dev_tools_prune_all_usage
3162 exit
3216 exit
3163 ;;
3217 ;;
3164
3218
3165 *)
3219 *)
3166 break
3220 break
3167 ;;
3221 ;;
3168
3222
3169 esac
3223 esac
3170 done
3224 done
3171
3225
3172 # :command.command_filter
3226 # :command.command_filter
3173 action="prune-all"
3227 action="prune-all"
3174
3228
3175 # :command.parse_requirements_while
3229 # :command.parse_requirements_while
3176 while [[ $# -gt 0 ]]; do
3230 while [[ $# -gt 0 ]]; do
3177 key="$1"
3231 key="$1"
3178 case "$key" in
3232 case "$key" in
3179
3233
3180 -?*)
3234 -?*)
3181 printf "invalid option: %s\n" "$key" >&2
3235 printf "invalid option: %s\n" "$key" >&2
3182 exit 1
3236 exit 1
3183 ;;
3237 ;;
3184
3238
3185 *)
3239 *)
3186 # :command.parse_requirements_case
3240 # :command.parse_requirements_case
3187 # :command.parse_requirements_case_simple
3241 # :command.parse_requirements_case_simple
3188 printf "invalid argument: %s\n" "$key" >&2
3242 printf "invalid argument: %s\n" "$key" >&2
3189 exit 1
3243 exit 1
3190
3244
3191 ;;
3245 ;;
3192
3246
3193 esac
3247 esac
3194 done
3248 done
3195
3249
3196 }
3250 }
3197
3251
3198 # :command.parse_requirements
3252 # :command.parse_requirements
3199 dev_tools_cli_generate_pull_parse_requirements() {
3253 dev_tools_cli_generate_pull_parse_requirements() {
3200 # :command.fixed_flags_filter
3254 # :command.fixed_flags_filter
3201 while [[ $# -gt 0 ]]; do
3255 while [[ $# -gt 0 ]]; do
3202 case "${1:-}" in
3256 case "${1:-}" in
3203 --help | -h)
3257 --help | -h)
3204 long_usage=yes
3258 long_usage=yes
3205 dev_tools_cli_generate_pull_usage
3259 dev_tools_cli_generate_pull_usage
3206 exit
3260 exit
3207 ;;
3261 ;;
3208
3262
3209 *)
3263 *)
3210 break
3264 break
3211 ;;
3265 ;;
3212
3266
3213 esac
3267 esac
3214 done
3268 done
3215
3269
3216 # :command.command_filter
3270 # :command.command_filter
3217 action="cli-generate-pull"
3271 action="cli-generate-pull"
3218
3272
3219 # :command.parse_requirements_while
3273 # :command.parse_requirements_while
3220 while [[ $# -gt 0 ]]; do
3274 while [[ $# -gt 0 ]]; do
3221 key="$1"
3275 key="$1"
3222 case "$key" in
3276 case "$key" in
3223
3277
3224 -?*)
3278 -?*)
3225 printf "invalid option: %s\n" "$key" >&2
3279 printf "invalid option: %s\n" "$key" >&2
3226 exit 1
3280 exit 1
3227 ;;
3281 ;;
3228
3282
3229 *)
3283 *)
3230 # :command.parse_requirements_case
3284 # :command.parse_requirements_case
3231 # :command.parse_requirements_case_simple
3285 # :command.parse_requirements_case_simple
3232 printf "invalid argument: %s\n" "$key" >&2
3286 printf "invalid argument: %s\n" "$key" >&2
3233 exit 1
3287 exit 1
3234
3288
3235 ;;
3289 ;;
3236
3290
3237 esac
3291 esac
3238 done
3292 done
3239
3293
3240 }
3294 }
3241
3295
3242 # :command.parse_requirements
3296 # :command.parse_requirements
3243 dev_tools_cli_generate_help_parse_requirements() {
3297 dev_tools_cli_generate_help_parse_requirements() {
3244 # :command.fixed_flags_filter
3298 # :command.fixed_flags_filter
3245 while [[ $# -gt 0 ]]; do
3299 while [[ $# -gt 0 ]]; do
3246 case "${1:-}" in
3300 case "${1:-}" in
3247 --help | -h)
3301 --help | -h)
3248 long_usage=yes
3302 long_usage=yes
3249 dev_tools_cli_generate_help_usage
3303 dev_tools_cli_generate_help_usage
3250 exit
3304 exit
3251 ;;
3305 ;;
3252
3306
3253 *)
3307 *)
3254 break
3308 break
3255 ;;
3309 ;;
3256
3310
3257 esac
3311 esac
3258 done
3312 done
3259
3313
3260 # :command.command_filter
3314 # :command.command_filter
3261 action="cli-generate-help"
3315 action="cli-generate-help"
3262
3316
3263 # :command.parse_requirements_while
3317 # :command.parse_requirements_while
3264 while [[ $# -gt 0 ]]; do
3318 while [[ $# -gt 0 ]]; do
3265 key="$1"
3319 key="$1"
3266 case "$key" in
3320 case "$key" in
3267
3321
3268 -?*)
3322 -?*)
3269 printf "invalid option: %s\n" "$key" >&2
3323 printf "invalid option: %s\n" "$key" >&2
3270 exit 1
3324 exit 1
3271 ;;
3325 ;;
3272
3326
3273 *)
3327 *)
3274 # :command.parse_requirements_case
3328 # :command.parse_requirements_case
3275 # :command.parse_requirements_case_simple
3329 # :command.parse_requirements_case_simple
3276 printf "invalid argument: %s\n" "$key" >&2
3330 printf "invalid argument: %s\n" "$key" >&2
3277 exit 1
3331 exit 1
3278
3332
3279 ;;
3333 ;;
3280
3334
3281 esac
3335 esac
3282 done
3336 done
3283
3337
3284 }
3338 }
3285
3339
3286 # :command.parse_requirements
3340 # :command.parse_requirements
3287 dev_tools_stack_cli_version_parse_requirements() {
3341 dev_tools_stack_cli_version_parse_requirements() {
3288 # :command.fixed_flags_filter
3342 # :command.fixed_flags_filter
3289 while [[ $# -gt 0 ]]; do
3343 while [[ $# -gt 0 ]]; do
3290 case "${1:-}" in
3344 case "${1:-}" in
3291 --help | -h)
3345 --help | -h)
3292 long_usage=yes
3346 long_usage=yes
3293 dev_tools_stack_cli_version_usage
3347 dev_tools_stack_cli_version_usage
3294 exit
3348 exit
3295 ;;
3349 ;;
3296
3350
3297 *)
3351 *)
3298 break
3352 break
3299 ;;
3353 ;;
3300
3354
3301 esac
3355 esac
3302 done
3356 done
3303
3357
3304 # :command.command_filter
3358 # :command.command_filter
3305 action="stack-cli-version"
3359 action="stack-cli-version"
3306
3360
3307 # :command.parse_requirements_while
3361 # :command.parse_requirements_while
3308 while [[ $# -gt 0 ]]; do
3362 while [[ $# -gt 0 ]]; do
3309 key="$1"
3363 key="$1"
3310 case "$key" in
3364 case "$key" in
3311
3365
3312 -?*)
3366 -?*)
3313 printf "invalid option: %s\n" "$key" >&2
3367 printf "invalid option: %s\n" "$key" >&2
3314 exit 1
3368 exit 1
3315 ;;
3369 ;;
3316
3370
3317 *)
3371 *)
3318 # :command.parse_requirements_case
3372 # :command.parse_requirements_case
3319 # :command.parse_requirements_case_simple
3373 # :command.parse_requirements_case_simple
3320 if [[ -z ${args['version']+x} ]]; then
3374 if [[ -z ${args['version']+x} ]]; then
3321
3375
3322 args['version']=$1
3376 args['version']=$1
3323 shift
3377 shift
3324 else
3378 else
3325 printf "invalid argument: %s\n" "$key" >&2
3379 printf "invalid argument: %s\n" "$key" >&2
3326 exit 1
3380 exit 1
3327 fi
3381 fi
3328
3382
3329 ;;
3383 ;;
3330
3384
3331 esac
3385 esac
3332 done
3386 done
3333
3387
3334 # :command.required_args_filter
3388 # :command.required_args_filter
3335 if [[ -z ${args['version']+x} ]]; then
3389 if [[ -z ${args['version']+x} ]]; then
3336 printf "missing required argument: VERSION\nusage: dev-tools stack-cli-version VERSION\n" >&2
3390 printf "missing required argument: VERSION\nusage: dev-tools stack-cli-version VERSION\n" >&2
3337 exit 1
3391 exit 1
3338 fi
3392 fi
3339
3393
3340 }
3394 }
3341
3395
3342 # :command.parse_requirements
3396 # :command.parse_requirements
3343 dev_tools_stack_image_version_parse_requirements() {
3397 dev_tools_stack_image_version_parse_requirements() {
3344 # :command.fixed_flags_filter
3398 # :command.fixed_flags_filter
3345 while [[ $# -gt 0 ]]; do
3399 while [[ $# -gt 0 ]]; do
3346 case "${1:-}" in
3400 case "${1:-}" in
3347 --help | -h)
3401 --help | -h)
3348 long_usage=yes
3402 long_usage=yes
3349 dev_tools_stack_image_version_usage
3403 dev_tools_stack_image_version_usage
3350 exit
3404 exit
3351 ;;
3405 ;;
3352
3406
3353 *)
3407 *)
3354 break
3408 break
3355 ;;
3409 ;;
3356
3410
3357 esac
3411 esac
3358 done
3412 done
3359
3413
3360 # :command.command_filter
3414 # :command.command_filter
3361 action="stack-image-version"
3415 action="stack-image-version"
3362
3416
3363 # :command.parse_requirements_while
3417 # :command.parse_requirements_while
3364 while [[ $# -gt 0 ]]; do
3418 while [[ $# -gt 0 ]]; do
3365 key="$1"
3419 key="$1"
3366 case "$key" in
3420 case "$key" in
3367
3421
3368 -?*)
3422 -?*)
3369 printf "invalid option: %s\n" "$key" >&2
3423 printf "invalid option: %s\n" "$key" >&2
3370 exit 1
3424 exit 1
3371 ;;
3425 ;;
3372
3426
3373 *)
3427 *)
3374 # :command.parse_requirements_case
3428 # :command.parse_requirements_case
3375 # :command.parse_requirements_case_simple
3429 # :command.parse_requirements_case_simple
3376 if [[ -z ${args['version']+x} ]]; then
3430 if [[ -z ${args['version']+x} ]]; then
3377
3431
3378 args['version']=$1
3432 args['version']=$1
3379 shift
3433 shift
3380 else
3434 else
3381 printf "invalid argument: %s\n" "$key" >&2
3435 printf "invalid argument: %s\n" "$key" >&2
3382 exit 1
3436 exit 1
3383 fi
3437 fi
3384
3438
3385 ;;
3439 ;;
3386
3440
3387 esac
3441 esac
3388 done
3442 done
3389
3443
3390 # :command.required_args_filter
3444 # :command.required_args_filter
3391 if [[ -z ${args['version']+x} ]]; then
3445 if [[ -z ${args['version']+x} ]]; then
3392 printf "missing required argument: VERSION\nusage: dev-tools stack-image-version VERSION\n" >&2
3446 printf "missing required argument: VERSION\nusage: dev-tools stack-image-version VERSION\n" >&2
3393 exit 1
3447 exit 1
3394 fi
3448 fi
3395
3449
3396 }
3450 }
3397
3451
3398 # :command.parse_requirements
3452 # :command.parse_requirements
3399 dev_tools_cli_generate_rc_parse_requirements() {
3453 dev_tools_cli_generate_rc_parse_requirements() {
3400 # :command.fixed_flags_filter
3454 # :command.fixed_flags_filter
3401 while [[ $# -gt 0 ]]; do
3455 while [[ $# -gt 0 ]]; do
3402 case "${1:-}" in
3456 case "${1:-}" in
3403 --help | -h)
3457 --help | -h)
3404 long_usage=yes
3458 long_usage=yes
3405 dev_tools_cli_generate_rc_usage
3459 dev_tools_cli_generate_rc_usage
3406 exit
3460 exit
3407 ;;
3461 ;;
3408
3462
3409 *)
3463 *)
3410 break
3464 break
3411 ;;
3465 ;;
3412
3466
3413 esac
3467 esac
3414 done
3468 done
3415
3469
3416 # :command.command_filter
3470 # :command.command_filter
3417 action="cli-generate-rc"
3471 action="cli-generate-rc"
3418
3472
3419 # :command.parse_requirements_while
3473 # :command.parse_requirements_while
3420 while [[ $# -gt 0 ]]; do
3474 while [[ $# -gt 0 ]]; do
3421 key="$1"
3475 key="$1"
3422 case "$key" in
3476 case "$key" in
3423 # :flag.case
3477 # :flag.case
3424 --one-time | -o)
3478 --one-time | -o)
3425
3479
3426 # :flag.case_no_arg
3480 # :flag.case_no_arg
3427 args['--one-time']=1
3481 args['--one-time']=1
3428 shift
3482 shift
3429 ;;
3483 ;;
3430
3484
3431 -?*)
3485 -?*)
3432 printf "invalid option: %s\n" "$key" >&2
3486 printf "invalid option: %s\n" "$key" >&2
3433 exit 1
3487 exit 1
3434 ;;
3488 ;;
3435
3489
3436 *)
3490 *)
3437 # :command.parse_requirements_case
3491 # :command.parse_requirements_case
3438 # :command.parse_requirements_case_simple
3492 # :command.parse_requirements_case_simple
3439 printf "invalid argument: %s\n" "$key" >&2
3493 printf "invalid argument: %s\n" "$key" >&2
3440 exit 1
3494 exit 1
3441
3495
3442 ;;
3496 ;;
3443
3497
3444 esac
3498 esac
3445 done
3499 done
3446
3500
3447 }
3501 }
3448
3502
3449 # :command.parse_requirements
3503 # :command.parse_requirements
3450 dev_tools_cli_generate_dev_parse_requirements() {
3504 dev_tools_cli_generate_dev_parse_requirements() {
3451 # :command.fixed_flags_filter
3505 # :command.fixed_flags_filter
3452 while [[ $# -gt 0 ]]; do
3506 while [[ $# -gt 0 ]]; do
3453 case "${1:-}" in
3507 case "${1:-}" in
3454 --help | -h)
3508 --help | -h)
3455 long_usage=yes
3509 long_usage=yes
3456 dev_tools_cli_generate_dev_usage
3510 dev_tools_cli_generate_dev_usage
3457 exit
3511 exit
3458 ;;
3512 ;;
3459
3513
3460 *)
3514 *)
3461 break
3515 break
3462 ;;
3516 ;;
3463
3517
3464 esac
3518 esac
3465 done
3519 done
3466
3520
3467 # :command.command_filter
3521 # :command.command_filter
3468 action="cli-generate-dev"
3522 action="cli-generate-dev"
3469
3523
3470 # :command.parse_requirements_while
3524 # :command.parse_requirements_while
3471 while [[ $# -gt 0 ]]; do
3525 while [[ $# -gt 0 ]]; do
3472 key="$1"
3526 key="$1"
3473 case "$key" in
3527 case "$key" in
3474 # :flag.case
3528 # :flag.case
3475 --one-time | -o)
3529 --one-time | -o)
3476
3530
3477 # :flag.case_no_arg
3531 # :flag.case_no_arg
3478 args['--one-time']=1
3532 args['--one-time']=1
3479 shift
3533 shift
3480 ;;
3534 ;;
3481
3535
3482 -?*)
3536 -?*)
3483 printf "invalid option: %s\n" "$key" >&2
3537 printf "invalid option: %s\n" "$key" >&2
3484 exit 1
3538 exit 1
3485 ;;
3539 ;;
3486
3540
3487 *)
3541 *)
3488 # :command.parse_requirements_case
3542 # :command.parse_requirements_case
3489 # :command.parse_requirements_case_simple
3543 # :command.parse_requirements_case_simple
3490 printf "invalid argument: %s\n" "$key" >&2
3544 printf "invalid argument: %s\n" "$key" >&2
3491 exit 1
3545 exit 1
3492
3546
3493 ;;
3547 ;;
3494
3548
3495 esac
3549 esac
3496 done
3550 done
3497
3551
3498 }
3552 }
3499
3553
3500 # :command.parse_requirements
3554 # :command.parse_requirements
3501 dev_tools_get_build_artifacts_parse_requirements() {
3555 dev_tools_get_build_artifacts_parse_requirements() {
3502 # :command.fixed_flags_filter
3556 # :command.fixed_flags_filter
3503 while [[ $# -gt 0 ]]; do
3557 while [[ $# -gt 0 ]]; do
3504 case "${1:-}" in
3558 case "${1:-}" in
3505 --help | -h)
3559 --help | -h)
3506 long_usage=yes
3560 long_usage=yes
3507 dev_tools_get_build_artifacts_usage
3561 dev_tools_get_build_artifacts_usage
3508 exit
3562 exit
3509 ;;
3563 ;;
3510
3564
3511 *)
3565 *)
3512 break
3566 break
3513 ;;
3567 ;;
3514
3568
3515 esac
3569 esac
3516 done
3570 done
3517
3571
3518 # :command.command_filter
3572 # :command.command_filter
3519 action="get-build-artifacts"
3573 action="get-build-artifacts"
3520
3574
3521 # :command.parse_requirements_while
3575 # :command.parse_requirements_while
3522 while [[ $# -gt 0 ]]; do
3576 while [[ $# -gt 0 ]]; do
3523 key="$1"
3577 key="$1"
3524 case "$key" in
3578 case "$key" in
3525 # :flag.case
3579 # :flag.case
3526 --auth)
3580 --auth)
3527
3581
3528 # :flag.case_arg
3582 # :flag.case_arg
3529 if [[ -n ${2+x} ]]; then
3583 if [[ -n ${2+x} ]]; then
3530
3584
3531 args['--auth']="$2"
3585 args['--auth']="$2"
3532 shift
3586 shift
3533 shift
3587 shift
3534 else
3588 else
3535 printf "%s\n" "--auth requires an argument: --auth AUTH" >&2
3589 printf "%s\n" "--auth requires an argument: --auth AUTH" >&2
3536 exit 1
3590 exit 1
3537 fi
3591 fi
3538 ;;
3592 ;;
3539
3593
3540 # :flag.case
3594 # :flag.case
3541 --installer-url)
3595 --installer-url)
3542
3596
3543 # :flag.case_arg
3597 # :flag.case_arg
3544 if [[ -n ${2+x} ]]; then
3598 if [[ -n ${2+x} ]]; then
3545
3599
3546 args['--installer-url']="$2"
3600 args['--installer-url']="$2"
3547 shift
3601 shift
3548 shift
3602 shift
3549 else
3603 else
3550 printf "%s\n" "--installer-url requires an argument: --installer-url INSTALLER_URL" >&2
3604 printf "%s\n" "--installer-url requires an argument: --installer-url INSTALLER_URL" >&2
3551 exit 1
3605 exit 1
3552 fi
3606 fi
3553 ;;
3607 ;;
3554
3608
3555 # :flag.case
3609 # :flag.case
3556 --manifest-url)
3610 --manifest-url)
3557
3611
3558 # :flag.case_arg
3612 # :flag.case_arg
3559 if [[ -n ${2+x} ]]; then
3613 if [[ -n ${2+x} ]]; then
3560
3614
3561 args['--manifest-url']="$2"
3615 args['--manifest-url']="$2"
3562 shift
3616 shift
3563 shift
3617 shift
3564 else
3618 else
3565 printf "%s\n" "--manifest-url requires an argument: --manifest-url MANIFEST_URL" >&2
3619 printf "%s\n" "--manifest-url requires an argument: --manifest-url MANIFEST_URL" >&2
3566 exit 1
3620 exit 1
3567 fi
3621 fi
3568 ;;
3622 ;;
3569
3623
3570 # :flag.case
3624 # :flag.case
3571 --version-name)
3625 --version-name)
3572
3626
3573 # :flag.case_arg
3627 # :flag.case_arg
3574 if [[ -n ${2+x} ]]; then
3628 if [[ -n ${2+x} ]]; then
3575
3629
3576 args['--version-name']="$2"
3630 args['--version-name']="$2"
3577 shift
3631 shift
3578 shift
3632 shift
3579 else
3633 else
3580 printf "%s\n" "--version-name requires an argument: --version-name VERSION_NAME" >&2
3634 printf "%s\n" "--version-name requires an argument: --version-name VERSION_NAME" >&2
3581 exit 1
3635 exit 1
3582 fi
3636 fi
3583 ;;
3637 ;;
3584
3638
3585 -?*)
3639 -?*)
3586 printf "invalid option: %s\n" "$key" >&2
3640 printf "invalid option: %s\n" "$key" >&2
3587 exit 1
3641 exit 1
3588 ;;
3642 ;;
3589
3643
3590 *)
3644 *)
3591 # :command.parse_requirements_case
3645 # :command.parse_requirements_case
3592 # :command.parse_requirements_case_simple
3646 # :command.parse_requirements_case_simple
3593 printf "invalid argument: %s\n" "$key" >&2
3647 printf "invalid argument: %s\n" "$key" >&2
3594 exit 1
3648 exit 1
3595
3649
3596 ;;
3650 ;;
3597
3651
3598 esac
3652 esac
3599 done
3653 done
3600
3654
3601 # :command.default_assignments
3655 # :command.default_assignments
3602 [[ -n ${args['--auth']:-} ]] || args['--auth']=""
3656 [[ -n ${args['--auth']:-} ]] || args['--auth']=""
3603 [[ -n ${args['--installer-url']:-} ]] || args['--installer-url']="https://dls.rhodecode.com/dls/N2E2ZTY1NzA3NjYxNDA2NTc1NjI3MTcyNzA2MjcxNzIyZTcwNjI3YQ==/rhodecode-control/latest-linux-ee"
3657 [[ -n ${args['--installer-url']:-} ]] || args['--installer-url']="https://dls.rhodecode.com/dls/N2E2ZTY1NzA3NjYxNDA2NTc1NjI3MTcyNzA2MjcxNzIyZTcwNjI3YQ==/rhodecode-control/latest-linux-ee"
3604 [[ -n ${args['--manifest-url']:-} ]] || args['--manifest-url']="https://dls.rhodecode.com/linux/MANIFEST"
3658 [[ -n ${args['--manifest-url']:-} ]] || args['--manifest-url']="https://dls.rhodecode.com/linux/MANIFEST"
3605 [[ -n ${args['--version-name']:-} ]] || args['--version-name']="$RC_CLI_VERSION_NAME"
3659 [[ -n ${args['--version-name']:-} ]] || args['--version-name']="$RC_CLI_VERSION_NAME"
3606
3660
3607 }
3661 }
3608
3662
3609 # :command.parse_requirements
3663 # :command.parse_requirements
3610 dev_tools_build_installer_parse_requirements() {
3664 dev_tools_build_installer_parse_requirements() {
3611 # :command.fixed_flags_filter
3665 # :command.fixed_flags_filter
3612 while [[ $# -gt 0 ]]; do
3666 while [[ $# -gt 0 ]]; do
3613 case "${1:-}" in
3667 case "${1:-}" in
3614 --help | -h)
3668 --help | -h)
3615 long_usage=yes
3669 long_usage=yes
3616 dev_tools_build_installer_usage
3670 dev_tools_build_installer_usage
3617 exit
3671 exit
3618 ;;
3672 ;;
3619
3673
3620 *)
3674 *)
3621 break
3675 break
3622 ;;
3676 ;;
3623
3677
3624 esac
3678 esac
3625 done
3679 done
3626
3680
3627 # :command.command_filter
3681 # :command.command_filter
3628 action="build-installer"
3682 action="build-installer"
3629
3683
3630 # :command.parse_requirements_while
3684 # :command.parse_requirements_while
3631 while [[ $# -gt 0 ]]; do
3685 while [[ $# -gt 0 ]]; do
3632 key="$1"
3686 key="$1"
3633 case "$key" in
3687 case "$key" in
3634 # :flag.case
3688 # :flag.case
3635 --version-name)
3689 --version-name)
3636
3690
3637 # :flag.case_arg
3691 # :flag.case_arg
3638 if [[ -n ${2+x} ]]; then
3692 if [[ -n ${2+x} ]]; then
3639
3693
3640 args['--version-name']="$2"
3694 args['--version-name']="$2"
3641 shift
3695 shift
3642 shift
3696 shift
3643 else
3697 else
3644 printf "%s\n" "--version-name requires an argument: --version-name VERSION_NAME" >&2
3698 printf "%s\n" "--version-name requires an argument: --version-name VERSION_NAME" >&2
3645 exit 1
3699 exit 1
3646 fi
3700 fi
3647 ;;
3701 ;;
3648
3702
3649 -?*)
3703 -?*)
3650 printf "invalid option: %s\n" "$key" >&2
3704 printf "invalid option: %s\n" "$key" >&2
3651 exit 1
3705 exit 1
3652 ;;
3706 ;;
3653
3707
3654 *)
3708 *)
3655 # :command.parse_requirements_case
3709 # :command.parse_requirements_case
3656 # :command.parse_requirements_case_simple
3710 # :command.parse_requirements_case_simple
3657 printf "invalid argument: %s\n" "$key" >&2
3711 printf "invalid argument: %s\n" "$key" >&2
3658 exit 1
3712 exit 1
3659
3713
3660 ;;
3714 ;;
3661
3715
3662 esac
3716 esac
3663 done
3717 done
3664
3718
3665 # :command.default_assignments
3719 # :command.default_assignments
3666 [[ -n ${args['--version-name']:-} ]] || args['--version-name']="$RC_CLI_VERSION_NAME"
3720 [[ -n ${args['--version-name']:-} ]] || args['--version-name']="$RC_CLI_VERSION_NAME"
3667
3721
3668 }
3722 }
3669
3723
3670 # :command.parse_requirements
3724 # :command.parse_requirements
3671 dev_tools_get_build_source_parse_requirements() {
3725 dev_tools_get_build_source_parse_requirements() {
3672 # :command.fixed_flags_filter
3726 # :command.fixed_flags_filter
3673 while [[ $# -gt 0 ]]; do
3727 while [[ $# -gt 0 ]]; do
3674 case "${1:-}" in
3728 case "${1:-}" in
3675 --help | -h)
3729 --help | -h)
3676 long_usage=yes
3730 long_usage=yes
3677 dev_tools_get_build_source_usage
3731 dev_tools_get_build_source_usage
3678 exit
3732 exit
3679 ;;
3733 ;;
3680
3734
3681 *)
3735 *)
3682 break
3736 break
3683 ;;
3737 ;;
3684
3738
3685 esac
3739 esac
3686 done
3740 done
3687
3741
3688 # :command.dependencies_filter
3742 # :command.dependencies_filter
3689 if command -v curl >/dev/null 2>&1; then
3743 if command -v curl >/dev/null 2>&1; then
3690 deps['curl']="$(command -v curl | head -n1)"
3744 deps['curl']="$(command -v curl | head -n1)"
3691 else
3745 else
3692 printf "missing dependency: curl\n" >&2
3746 printf "missing dependency: curl\n" >&2
3693 exit 1
3747 exit 1
3694 fi
3748 fi
3695
3749
3696 if command -v tar >/dev/null 2>&1; then
3750 if command -v tar >/dev/null 2>&1; then
3697 deps['tar']="$(command -v tar | head -n1)"
3751 deps['tar']="$(command -v tar | head -n1)"
3698 else
3752 else
3699 printf "missing dependency: tar\n" >&2
3753 printf "missing dependency: tar\n" >&2
3700 exit 1
3754 exit 1
3701 fi
3755 fi
3702
3756
3703 # :command.command_filter
3757 # :command.command_filter
3704 action="get-build-source"
3758 action="get-build-source"
3705
3759
3706 # :command.parse_requirements_while
3760 # :command.parse_requirements_while
3707 while [[ $# -gt 0 ]]; do
3761 while [[ $# -gt 0 ]]; do
3708 key="$1"
3762 key="$1"
3709 case "$key" in
3763 case "$key" in
3710 # :flag.case
3764 # :flag.case
3711 --revision)
3765 --revision)
3712
3766
3713 # :flag.case_arg
3767 # :flag.case_arg
3714 if [[ -n ${2+x} ]]; then
3768 if [[ -n ${2+x} ]]; then
3715
3769
3716 args['--revision']="$2"
3770 args['--revision']="$2"
3717 shift
3771 shift
3718 shift
3772 shift
3719 else
3773 else
3720 printf "%s\n" "--revision requires an argument: --revision REVISION" >&2
3774 printf "%s\n" "--revision requires an argument: --revision REVISION" >&2
3721 exit 1
3775 exit 1
3722 fi
3776 fi
3723 ;;
3777 ;;
3724
3778
3725 # :flag.case
3779 # :flag.case
3726 --source-dir)
3780 --source-dir)
3727
3781
3728 # :flag.case_arg
3782 # :flag.case_arg
3729 if [[ -n ${2+x} ]]; then
3783 if [[ -n ${2+x} ]]; then
3730
3784
3731 args['--source-dir']="$2"
3785 args['--source-dir']="$2"
3732 shift
3786 shift
3733 shift
3787 shift
3734 else
3788 else
3735 printf "%s\n" "--source-dir requires an argument: --source-dir SOURCE_DIR" >&2
3789 printf "%s\n" "--source-dir requires an argument: --source-dir SOURCE_DIR" >&2
3736 exit 1
3790 exit 1
3737 fi
3791 fi
3738 ;;
3792 ;;
3739
3793
3740 # :flag.case
3794 # :flag.case
3741 --auth-token)
3795 --auth-token)
3742
3796
3743 # :flag.case_arg
3797 # :flag.case_arg
3744 if [[ -n ${2+x} ]]; then
3798 if [[ -n ${2+x} ]]; then
3745
3799
3746 args['--auth-token']="$2"
3800 args['--auth-token']="$2"
3747 shift
3801 shift
3748 shift
3802 shift
3749 else
3803 else
3750 printf "%s\n" "--auth-token requires an argument: --auth-token AUTH_TOKEN" >&2
3804 printf "%s\n" "--auth-token requires an argument: --auth-token AUTH_TOKEN" >&2
3751 exit 1
3805 exit 1
3752 fi
3806 fi
3753 ;;
3807 ;;
3754
3808
3755 # :flag.case
3809 # :flag.case
3756 --server-url)
3810 --server-url)
3757
3811
3758 # :flag.case_arg
3812 # :flag.case_arg
3759 if [[ -n ${2+x} ]]; then
3813 if [[ -n ${2+x} ]]; then
3760
3814
3761 args['--server-url']="$2"
3815 args['--server-url']="$2"
3762 shift
3816 shift
3763 shift
3817 shift
3764 else
3818 else
3765 printf "%s\n" "--server-url requires an argument: --server-url SERVER_URL" >&2
3819 printf "%s\n" "--server-url requires an argument: --server-url SERVER_URL" >&2
3766 exit 1
3820 exit 1
3767 fi
3821 fi
3768 ;;
3822 ;;
3769
3823
3770 -?*)
3824 -?*)
3771 printf "invalid option: %s\n" "$key" >&2
3825 printf "invalid option: %s\n" "$key" >&2
3772 exit 1
3826 exit 1
3773 ;;
3827 ;;
3774
3828
3775 *)
3829 *)
3776 # :command.parse_requirements_case
3830 # :command.parse_requirements_case
3777 # :command.parse_requirements_case_simple
3831 # :command.parse_requirements_case_simple
3778 printf "invalid argument: %s\n" "$key" >&2
3832 printf "invalid argument: %s\n" "$key" >&2
3779 exit 1
3833 exit 1
3780
3834
3781 ;;
3835 ;;
3782
3836
3783 esac
3837 esac
3784 done
3838 done
3785
3839
3786 # :command.default_assignments
3840 # :command.default_assignments
3787 [[ -n ${args['--revision']:-} ]] || args['--revision']="default"
3841 [[ -n ${args['--revision']:-} ]] || args['--revision']="default"
3788 [[ -n ${args['--source-dir']:-} ]] || args['--source-dir']="$PWD/.source"
3842 [[ -n ${args['--source-dir']:-} ]] || args['--source-dir']="$PWD/.source"
3789 [[ -n ${args['--server-url']:-} ]] || args['--server-url']="https://code.rhodecode.com"
3843 [[ -n ${args['--server-url']:-} ]] || args['--server-url']="https://code.rhodecode.com"
3790
3844
3791 }
3845 }
3792
3846
3793 # :command.parse_requirements
3847 # :command.parse_requirements
3794 dev_tools_build_source_parse_requirements() {
3848 dev_tools_build_source_parse_requirements() {
3795 # :command.fixed_flags_filter
3849 # :command.fixed_flags_filter
3796 while [[ $# -gt 0 ]]; do
3850 while [[ $# -gt 0 ]]; do
3797 case "${1:-}" in
3851 case "${1:-}" in
3798 --help | -h)
3852 --help | -h)
3799 long_usage=yes
3853 long_usage=yes
3800 dev_tools_build_source_usage
3854 dev_tools_build_source_usage
3801 exit
3855 exit
3802 ;;
3856 ;;
3803
3857
3804 *)
3858 *)
3805 break
3859 break
3806 ;;
3860 ;;
3807
3861
3808 esac
3862 esac
3809 done
3863 done
3810
3864
3811 # :command.command_filter
3865 # :command.command_filter
3812 action="build-source"
3866 action="build-source"
3813
3867
3814 # :command.parse_requirements_while
3868 # :command.parse_requirements_while
3815 while [[ $# -gt 0 ]]; do
3869 while [[ $# -gt 0 ]]; do
3816 key="$1"
3870 key="$1"
3817 case "$key" in
3871 case "$key" in
3818 # :flag.case
3872 # :flag.case
3819 --version-name)
3873 --version-name)
3820
3874
3821 # :flag.case_arg
3875 # :flag.case_arg
3822 if [[ -n ${2+x} ]]; then
3876 if [[ -n ${2+x} ]]; then
3823
3877
3824 args['--version-name']="$2"
3878 args['--version-name']="$2"
3825 shift
3879 shift
3826 shift
3880 shift
3827 else
3881 else
3828 printf "%s\n" "--version-name requires an argument: --version-name VERSION_NAME" >&2
3882 printf "%s\n" "--version-name requires an argument: --version-name VERSION_NAME" >&2
3829 exit 1
3883 exit 1
3830 fi
3884 fi
3831 ;;
3885 ;;
3832
3886
3833 # :flag.case
3887 # :flag.case
3834 --source-build-yaml)
3888 --source-build-yaml)
3835
3889
3836 # :flag.case_arg
3890 # :flag.case_arg
3837 if [[ -n ${2+x} ]]; then
3891 if [[ -n ${2+x} ]]; then
3838
3892
3839 args['--source-build-yaml']="$2"
3893 args['--source-build-yaml']="$2"
3840 shift
3894 shift
3841 shift
3895 shift
3842 else
3896 else
3843 printf "%s\n" "--source-build-yaml requires an argument: --source-build-yaml BUILD_SOURCE_YAML" >&2
3897 printf "%s\n" "--source-build-yaml requires an argument: --source-build-yaml BUILD_SOURCE_YAML" >&2
3844 exit 1
3898 exit 1
3845 fi
3899 fi
3846 ;;
3900 ;;
3847
3901
3848 # :flag.case
3902 # :flag.case
3849 --tag)
3903 --tag)
3850
3904
3851 # :flag.case_arg
3905 # :flag.case_arg
3852 if [[ -n ${2+x} ]]; then
3906 if [[ -n ${2+x} ]]; then
3853
3907
3854 if [[ -z ${args['--tag']+x} ]]; then
3908 if [[ -z ${args['--tag']+x} ]]; then
3855 args['--tag']="\"$2\""
3909 args['--tag']="\"$2\""
3856 else
3910 else
3857 args['--tag']="${args[--tag]} \"$2\""
3911 args['--tag']="${args[--tag]} \"$2\""
3858 fi
3912 fi
3859 shift
3913 shift
3860 shift
3914 shift
3861 else
3915 else
3862 printf "%s\n" "--tag requires an argument: --tag TAG" >&2
3916 printf "%s\n" "--tag requires an argument: --tag TAG" >&2
3863 exit 1
3917 exit 1
3864 fi
3918 fi
3865 ;;
3919 ;;
3866
3920
3867 -?*)
3921 -?*)
3868 printf "invalid option: %s\n" "$key" >&2
3922 printf "invalid option: %s\n" "$key" >&2
3869 exit 1
3923 exit 1
3870 ;;
3924 ;;
3871
3925
3872 *)
3926 *)
3873 # :command.parse_requirements_case
3927 # :command.parse_requirements_case
3874 # :command.parse_requirements_case_simple
3928 # :command.parse_requirements_case_simple
3875 printf "invalid argument: %s\n" "$key" >&2
3929 printf "invalid argument: %s\n" "$key" >&2
3876 exit 1
3930 exit 1
3877
3931
3878 ;;
3932 ;;
3879
3933
3880 esac
3934 esac
3881 done
3935 done
3882
3936
3883 # :command.default_assignments
3937 # :command.default_assignments
3884 [[ -n ${args['--version-name']:-} ]] || args['--version-name']="$RC_CLI_VERSION_NAME"
3938 [[ -n ${args['--version-name']:-} ]] || args['--version-name']="$RC_CLI_VERSION_NAME"
3885 [[ -n ${args['--source-build-yaml']:-} ]] || args['--source-build-yaml']="build_yaml/docker-compose-apps.5.yaml"
3939 [[ -n ${args['--source-build-yaml']:-} ]] || args['--source-build-yaml']="build_yaml/docker-compose-apps.5.yaml"
3886
3940
3887 }
3941 }
3888
3942
3889 # :command.initialize
3943 # :command.initialize
3890 initialize() {
3944 initialize() {
3891 version="1.2.0"
3945 version="1.2.0"
3892 long_usage=''
3946 long_usage=''
3893 set -e
3947 set -e
3894
3948
3895 # src/initialize.sh
3949 # src/initialize.sh
3896
3950
3897 bashly_image="dannyben/bashly:1.0.8"
3951 bashly_image="dannyben/bashly:1.0.8"
3898
3952
3899 METRICS_DEV_ENV_TMPL=" \
3953 METRICS_DEV_ENV_TMPL=" \
3900 ./rcstack stack metrics {{DEV_ENV_CMD}} statsd-exporter && \
3954 ./rcstack stack metrics {{DEV_ENV_CMD}} statsd-exporter && \
3901 ./rcstack stack services {{DEV_ENV_CMD}} && \
3955 ./rcstack stack services {{DEV_ENV_CMD}} && \
3902 ./rcstack stack services {{DEV_ENV_CMD}} httpbin && \
3956 ./rcstack stack services {{DEV_ENV_CMD}} httpbin && \
3903 ./rcstack stack services {{DEV_ENV_CMD}} ldap-server && \
3957 ./rcstack stack services {{DEV_ENV_CMD}} ldap-server && \
3904 ./rcstack stack services {{DEV_ENV_CMD}} s3-minio \
3958 ./rcstack stack services {{DEV_ENV_CMD}} s3-minio \
3905 "
3959 "
3906
3960
3907 RC_DEV_ENV_TMPL=" \
3961 RC_DEV_ENV_TMPL=" \
3908 ./rcstack stack rhodecode -f docker-compose-apps.dev.yaml {{DEV_ENV_CMD}} svn && \
3962 ./rcstack stack rhodecode -f docker-compose-apps.dev.yaml {{DEV_ENV_CMD}} svn && \
3909 ./rcstack stack rhodecode -f docker-compose-apps.dev.yaml {{DEV_ENV_CMD}} celery && \
3963 ./rcstack stack rhodecode -f docker-compose-apps.dev.yaml {{DEV_ENV_CMD}} celery && \
3910 ./rcstack stack rhodecode -f docker-compose-apps.dev.yaml {{DEV_ENV_CMD}} celery-beat && \
3964 ./rcstack stack rhodecode -f docker-compose-apps.dev.yaml {{DEV_ENV_CMD}} celery-beat && \
3911 ./rcstack stack rhodecode -f docker-compose-apps.dev.yaml {{DEV_ENV_CMD}} sshd \
3965 ./rcstack stack rhodecode -f docker-compose-apps.dev.yaml {{DEV_ENV_CMD}} sshd \
3912 "
3966 "
3913 }
3967 }
3914
3968
3915 # :command.run
3969 # :command.run
3916 run() {
3970 run() {
3917 declare -A args=()
3971 declare -A args=()
3918 declare -A deps=()
3972 declare -A deps=()
3919 declare -a other_args=()
3973 declare -a other_args=()
3920 declare -a input=()
3974 declare -a input=()
3921 normalize_input "$@"
3975 normalize_input "$@"
3922 parse_requirements "${input[@]}"
3976 parse_requirements "${input[@]}"
3923
3977
3924 case "$action" in
3978 case "$action" in
3925 "vcs") dev_tools_vcs_command ;;
3979 "vcs") dev_tools_vcs_command ;;
3926 "ce") dev_tools_ce_command ;;
3980 "ce") dev_tools_ce_command ;;
3927 "ee") dev_tools_ee_command ;;
3981 "ee") dev_tools_ee_command ;;
3928 "celery") dev_tools_celery_command ;;
3982 "celery") dev_tools_celery_command ;;
3929 "celeryd") dev_tools_celeryd_command ;;
3983 "celeryd") dev_tools_celeryd_command ;;
3930 "ssh") dev_tools_ssh_command ;;
3984 "ssh") dev_tools_ssh_command ;;
3931 "sshd") dev_tools_sshd_command ;;
3985 "sshd") dev_tools_sshd_command ;;
3932 "svn") dev_tools_svn_command ;;
3986 "svn") dev_tools_svn_command ;;
3933 "svnd") dev_tools_svnd_command ;;
3987 "svnd") dev_tools_svnd_command ;;
3934 "tools") dev_tools_tools_command ;;
3988 "tools") dev_tools_tools_command ;;
3935 "dev-env") dev_tools_dev_env_command ;;
3989 "dev-env") dev_tools_dev_env_command ;;
3936 "dev-env-stop") dev_tools_dev_env_stop_command ;;
3990 "dev-env-stop") dev_tools_dev_env_stop_command ;;
3937 "prune") dev_tools_prune_command ;;
3991 "prune") dev_tools_prune_command ;;
3938 "prune-all") dev_tools_prune_all_command ;;
3992 "prune-all") dev_tools_prune_all_command ;;
3939 "cli-generate-pull") dev_tools_cli_generate_pull_command ;;
3993 "cli-generate-pull") dev_tools_cli_generate_pull_command ;;
3940 "cli-generate-help") dev_tools_cli_generate_help_command ;;
3994 "cli-generate-help") dev_tools_cli_generate_help_command ;;
3941 "stack-cli-version") dev_tools_stack_cli_version_command ;;
3995 "stack-cli-version") dev_tools_stack_cli_version_command ;;
3942 "stack-image-version") dev_tools_stack_image_version_command ;;
3996 "stack-image-version") dev_tools_stack_image_version_command ;;
3943 "cli-generate-rc") dev_tools_cli_generate_rc_command ;;
3997 "cli-generate-rc") dev_tools_cli_generate_rc_command ;;
3944 "cli-generate-dev") dev_tools_cli_generate_dev_command ;;
3998 "cli-generate-dev") dev_tools_cli_generate_dev_command ;;
3945 "get-build-artifacts") dev_tools_get_build_artifacts_command ;;
3999 "get-build-artifacts") dev_tools_get_build_artifacts_command ;;
3946 "build-installer") dev_tools_build_installer_command ;;
4000 "build-installer") dev_tools_build_installer_command ;;
3947 "get-build-source") dev_tools_get_build_source_command ;;
4001 "get-build-source") dev_tools_get_build_source_command ;;
3948 "build-source") dev_tools_build_source_command ;;
4002 "build-source") dev_tools_build_source_command ;;
3949 esac
4003 esac
3950 }
4004 }
3951
4005
3952 initialize
4006 initialize
3953 run "$@"
4007 run "$@"
General Comments 0
You need to be logged in to leave comments. Login now