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