##// END OF EJS Templates
fix(docs): fixed cli usage docs
super-admin -
r5644:09e63857 default
parent child Browse files
Show More
@@ -1,578 +1,582
1 .. _tools-cli:
1 .. _tools-cli:
2
2
3 |RCT| CLI
3 |RCT| CLI
4 ---------
4 ---------
5
5
6 The commands available with |RCT| can be split into three categories:
6 The commands available with |RCT| can be split into three categories:
7
7
8 - Remotely executable commands that can be run from your local machine once you
8 - Remotely executable commands that can be run from your local machine once you
9 have your connection details to |RCE| configured.
9 have your connection details to |RCE| configured.
10 - Locally executable commands the can be run on the server to carry out
10 - Locally executable commands the can be run on the server to carry out
11 general maintenance.
11 general maintenance.
12 - Local configuration commands used to help set up your |RCT| configuration.
12 - Local configuration commands used to help set up your |RCT| configuration.
13
13
14
14
15 .. _tools-rhodecode-list-instance:
16
17 rhodecode-list-instances
18 ------------------------
19
20 Use this command to list the instance details configured in the
21 :file:`/etc/rhodecode/conf/.rhoderc` file.
22
23 .. code-block:: bash
24
25 $ ./rcstack cli cmd rhodecode-list-instances --config=/etc/rhodecode/conf/.rhoderc
26 [instance:production] - Config only
27 API-HOST: https://some.url.com
28 API-KEY: some.auth.token
29
30 [instance:development] - Config only
31 API-HOST: http://some.ip.address
32 API-KEY: some.auth.token
33
34
15 rhodecode-tools
35 rhodecode-tools
16 ---------------
36 ---------------
17
37
18 Use |RCT| to setup automation, run the indexer, and install extensions for
38 Use |RCT| to setup automation, run the indexer, and install extensions for
19 your |RCE| instances. Options:
39 your |RCE| instances. Options:
20
40
21 .. rst-class:: dl-horizontal
41 .. rst-class:: dl-horizontal
22
42
23 \ - -apihost <api_host>
43 \ - -apihost <api_host>
24 Set the API host value.
44 Set the API host value.
25
45
26 \ - -apikey <apikey_value>
46 \ - -apikey <apikey_value>
27 Set the API key value.
47 Set the API key value.
28
48
29 \-c, - -config <config_file>
49 \-c, - -config <config_file>
30 Create a configuration file. The default file is created
50 Create a configuration file. The default file is created
31 in ``~/.rhoderc``
51 in ``~/.rhoderc``
32
52
33 \ - -save-config
53 \ - -save-config
34 Save the configuration file.
54 Save the configuration file.
35
55
36 \ - -show-config
56 \ - -show-config
37 Show the current configuration values.
57 Show the current configuration values.
38
58
39 \ - -format {json,pretty}
59 \ - -format {json,pretty}
40 Set the formatted representation.
60 Set the formatted representation.
41
61
42 Example usage:
62 Example usage:
43
63
44 .. code-block:: bash
64 .. code-block:: bash
45
65
46 $ rhodecode-tools --apikey=key --apihost=http://rhodecode.server \
66 $ rhodecode-tools --apikey=key --apihost=http://rhodecode.server \
47 --save-config
67 --save-config
48
68
49 rhodecode-api
69 rhodecode-api
50 -------------
70 -------------
51
71
52 The RhodeCode API lets you connect to |RCE| and carry out management tasks from a
72 The RhodeCode API lets you connect to |RCE| and carry out management tasks from a
53 remote machine, for more information about the API, see the :ref:`api`. To
73 remote machine, for more information about the API, see the :ref:`api`. To
54 pass arguments on the command-line use the ``method:option`` syntax.
74 pass arguments on the command-line use the ``method:option`` syntax.
55
75
56 Example usage:
76 Example usage:
57
77
58 .. code-block:: bash
78 .. code-block:: bash
59
79
60 # Run the get_repos API call and sample output
80 # Run the get_repos API call and sample output
61 $ rhodecode-api --instance-name=enterprise-1 create_repo \
81 $ rhodecode-api --instance-name=enterprise-1 create_repo \
62 repo_name:brand-new repo_type:hg description:repo-desc
82 repo_name:brand-new repo_type:hg description:repo-desc
63
83
64 {
84 {
65 "error": null,
85 "error": null,
66 "id": 1110,
86 "id": 1110,
67 "result": {
87 "result": {
68 "msg": "Created new repository `brand-new`",
88 "msg": "Created new repository `brand-new`",
69 "success": true,
89 "success": true,
70 "task": null
90 "task": null
71 }
91 }
72 }
92 }
73
93
74 Options:
94 Options:
75
95
76 .. rst-class:: dl-horizontal
96 .. rst-class:: dl-horizontal
77
97
78 \ - -api-cache-only
98 \ - -api-cache-only
79 Requires a cache to be present when running this call
99 Requires a cache to be present when running this call
80
100
81 \ - -api-cache-rebuild
101 \ - -api-cache-rebuild
82 Replaces existing cached values with new ones from server
102 Replaces existing cached values with new ones from server
83
103
84 \ - -api-cache <PATH>
104 \ - -api-cache <PATH>
85 Use a special cache dir to read responses from instead of the server
105 Use a special cache dir to read responses from instead of the server
86
106
87 \ - -api-cert-verify
107 \ - -api-cert-verify
88 Verify the endpoint ssl certificate
108 Verify the endpoint ssl certificate
89
109
90 \ - -api-cert <PATH>
110 \ - -api-cert <PATH>
91 Path to alternate CA bundle.
111 Path to alternate CA bundle.
92
112
93 \ - -apihost <api_host>
113 \ - -apihost <api_host>
94 Set the API host value.
114 Set the API host value.
95
115
96 \ - -apikey <apikey_value>
116 \ - -apikey <apikey_value>
97 Set the API key value.
117 Set the API key value.
98
118
99 \ - -instance-name <instance-id>
119 \ - -instance-name <instance-id>
100 Set the instance name
120 Set the instance name
101
121
102 \-I, - -install-dir <DIR>
122 \-I, - -install-dir <DIR>
103 Location of application instances
123 Location of application instances
104
124
105 \-c, - -config <.rhoderc-file>
125 \-c, - -config <.rhoderc-file>
106 Location of the :file:`.rhoderc`
126 Location of the :file:`.rhoderc`
107
127
108 \-F, - -format {json,pretty}
128 \-F, - -format {json,pretty}
109 Set the formatted representation.
129 Set the formatted representation.
110
130
111 \-h, - -help
131 \-h, - -help
112 Show help messages.
132 Show help messages.
113
133
114 \-v, - -verbose
134 \-v, - -verbose
115 Enable verbose messaging
135 Enable verbose messaging
116
136
117 rhodecode-cleanup-gists
137 rhodecode-cleanup-gists
118 -----------------------
138 -----------------------
119
139
120 Use this to delete gists within |RCE|. Options:
140 Use this to delete gists within |RCE|. Options:
121
141
122 .. rst-class:: dl-horizontal
142 .. rst-class:: dl-horizontal
123
143
124 \-c, - -config <config_file>
144 \-c, - -config <config_file>
125 Set the file path to the configuration file. The default file is
145 Set the file path to the configuration file. The default file is
126 :file:`/home/{user}/.rhoderc`
146 :file:`/home/{user}/.rhoderc`
127
147
128 \ - -corrupted
148 \ - -corrupted
129 Remove gists with corrupted metadata.
149 Remove gists with corrupted metadata.
130
150
131 \ - -dont-ask
151 \ - -dont-ask
132 Remove gists without asking for confirmation.
152 Remove gists without asking for confirmation.
133
153
134 \-h, - -help
154 \-h, - -help
135 Show help messages. current configuration values.
155 Show help messages. current configuration values.
136
156
137 \ - -instance-name <instance-id>
157 \ - -instance-name <instance-id>
138 Set the instance name.
158 Set the instance name.
139
159
140 \-R, - -repo-dir
160 \-R, - -repo-dir
141 Set the repository file path.
161 Set the repository file path.
142
162
143 \ - -version
163 \ - -version
144 Display your |RCT| version.
164 Display your |RCT| version.
145
165
146 Example usage:
166 Example usage:
147
167
148 .. code-block:: bash
168 .. code-block:: bash
149
169
150 # Clean up gists related to an instance
170 # Clean up gists related to an instance
151 $ rhodecode-cleanup-gists --instance-name=enterprise-1
171 $ rhodecode-cleanup-gists --instance-name=enterprise-1
152 Scanning for gists in /home/brian/repos/.rc_gist_store...
172 Scanning for gists in /home/brian/repos/.rc_gist_store...
153 preparing to remove [3] found gists
173 preparing to remove [3] found gists
154
174
155 # Clean up corrupted gists in an instance
175 # Clean up corrupted gists in an instance
156 $ rhodecode-cleanup-gists --instance-name=enterprise-1 --corrupted
176 $ rhodecode-cleanup-gists --instance-name=enterprise-1 --corrupted
157 Scanning for gists in /home/brian/repos/.rc_gist_store...
177 Scanning for gists in /home/brian/repos/.rc_gist_store...
158 preparing to remove [2] found gists
178 preparing to remove [2] found gists
159 the following gists will be archived:
179 the following gists will be archived:
160 * EXPIRED: BAD METADATA | /home/brian/repos/.rc_gist_store/5
180 * EXPIRED: BAD METADATA | /home/brian/repos/.rc_gist_store/5
161 * EXPIRED: BAD METADATA | /home/brian/repos/.rc_gist_store/8FtC
181 * EXPIRED: BAD METADATA | /home/brian/repos/.rc_gist_store/8FtC
162 are you sure you want to archive them? [y/N]: y
182 are you sure you want to archive them? [y/N]: y
163 removing gist /home/brian/repos/.rc_gist_store/5
183 removing gist /home/brian/repos/.rc_gist_store/5
164 removing gist /home/brian/repos/.rc_gist_store/8FtCKdcbRKmEvRzTVsEt
184 removing gist /home/brian/repos/.rc_gist_store/8FtCKdcbRKmEvRzTVsEt
165
185
186
166 rhodecode-cleanup-repos
187 rhodecode-cleanup-repos
167 -----------------------
188 -----------------------
168
189
169 Use this to manage |repos| and |repo| groups within |RCE|. Options:
190 Use this to manage |repos| and |repo| groups within |RCE|. Options:
170
191
171 .. rst-class:: dl-horizontal
192 .. rst-class:: dl-horizontal
172
193
173 \-c, - -config <config_file>
194 \-c, - -config <config_file>
174 Set the file path to the configuration file. The default file is
195 Set the file path to the configuration file. The default file is
175 :file:`/home/{user}/.rhoderc`.
196 :file:`/home/{user}/.rhoderc`.
176
197
177 \-h, - -help
198 \-h, - -help
178 Show help messages. current configuration values.
199 Show help messages. current configuration values.
179
200
180 \ - -interactive
201 \ - -interactive
181 Enable an interactive prompt for each repository when deleting.
202 Enable an interactive prompt for each repository when deleting.
182
203
183 \ - -include-groups
204 \ - -include-groups
184 Remove repository groups.
205 Remove repository groups.
185
206
186 \ - -instance-name <instance-id>
207 \ - -instance-name <instance-id>
187 Set the instance name.
208 Set the instance name.
188
209
189 \ - -list-only
210 \ - -list-only
190 Display repositories selected for deletion.
211 Display repositories selected for deletion.
191
212
192 \ - -older-than <str>
213 \ - -older-than <str>
193 Delete repositories older that a specified time.
214 Delete repositories older that a specified time.
194 You can use the following suffixes; d for days, h for hours,
215 You can use the following suffixes; d for days, h for hours,
195 m for minutes, s for seconds.
216 m for minutes, s for seconds.
196
217
197 \-R, - -repo-dir
218 \-R, - -repo-dir
198 Set the repository file path
219 Set the repository file path
199
220
200 Example usage:
221 Example usage:
201
222
202 .. code-block:: bash
223 .. code-block:: bash
203
224
204 # Cleaning up repos using tools installed with RCE 350 and above
225
205 $ ~/.rccontrol/enterprise-4/profile/bin/rhodecode-cleanup-repos \
226 # create a .rhoderc file in your host config directory (in :file:`config/_shared/.rhoderc`):
206 --instance-name=enterprise-4 --older-than=1d
227
207 Scanning for repositories in /home/brian/repos...
228 [instance:rcstack-instance]
208 preparing to remove [2] found repositories older than 1 day, 0:00:00 (1d)
229 api_host = http://rhodecode:10020
230 api_key = <API_KEY>
231 repo_dir = /var/opt/rhodecode_repo_store
232
233 # Run rcstack cli
234 ./rcstack cli cmd rhodecode-cleanup-repos --instance-name=rcstack-instance --config=/etc/rhodecode/conf/.rhoderc
235
236 checking if config files needs bootstrapping
237 Scanning for repositories in /var/opt/rhodecode_repo_store...
209
238
210 the following repositories will be deleted completely:
239 the following repositories will be deleted completely:
211 * REMOVED: 2015-08-05 00:23:18 | /home/brian/repos/rm__20150805_002318_831
240 * REMOVED: 2015-08-05 00:23:18 | /var/opt/rhodecode_repo_store/rm__20150805_002318_831
212 * REMOVED: 2015-08-04 01:22:10 | /home/brian/repos/rm__20150804_012210_336
241 * REMOVED: 2015-08-04 01:22:10 | /var/opt/rhodecode_repo_store/rm__20150804_012210_336
213 are you sure you want to remove them? [y/N]:
242 are you sure you want to remove them? [y/N]:
214
243
215 # Clean up repos older than 1 year
244 # Clean up repos older than 1 year
216 # If using virtualenv and pre RCE 350 tools installation
245 ./rcstack cli cmd rhodecode-cleanup-repos --instance-name=rcstack-instance --config=/etc/rhodecode/conf/.rhoderc --older-than=365d
217 (venv)$ rhodecode-cleanup-repos --instance-name=enterprise-1 \
218 --older-than=365d
219
246
220 Scanning for repositories in /home/brian/repos...
247 checking if config files needs bootstrapping
248 Scanning for repositories in /var/opt/rhodecode_repo_store...
221 preparing to remove [343] found repositories older than 365 days
249 preparing to remove [343] found repositories older than 365 days
222
250
223 # clean up repos older than 3 days
251 # clean up repos older than 3 days
224 # If using virtualenv and pre RCE 350 tools installation
252 ./rcstack cli cmd rhodecode-cleanup-repos --instance-name=rcstack-instance --config=/etc/rhodecode/conf/.rhoderc --older-than=3d
225 (venv)$ rhodecode-cleanup-repos --instance-name=enterprise-1 \
253
226 --older-than=3d
254 checking if config files needs bootstrapping
227 Scanning for repositories in /home/brian/repos...
255 Scanning for repositories in /var/opt/rhodecode_repo_store...
228 preparing to remove [3] found repositories older than 3 days
256 preparing to remove [3] found repositories older than 3 days
229
257
230 .. _tools-config:
258 .. _tools-config:
231
259
232 rhodecode-config
260 rhodecode-config
233 ----------------
261 ----------------
234
262
235 Use this to create or update a |RCE| configuration file on the local machine.
263 Use this to create or update a |RCE| configuration file on the local machine.
236
264
237 .. rst-class:: dl-horizontal
265 .. rst-class:: dl-horizontal
238
266
239 \- -filename </path/to/config_file>
267 \- -filename </path/to/config_file>
240 Set the file path to the |RCE| configuration file.
268 Set the file path to the |RCE| configuration file.
241
269
242 \- -show-defaults
270 \- -show-defaults
243 Display the defaults set in the |RCE| configuration file.
271 Display the defaults set in the |RCE| configuration file.
244
272
245 \- -update
273 \- -update
246 Update the configuration with the new settings passed on the command
274 Update the configuration with the new settings passed on the command
247 line.
275 line.
248
276
249 .. code-block:: bash
277 .. code-block:: bash
250
278
251 # Create a new config file
279 # Create a new config file
252 $ rhodecode-config --filename=dev.ini
280 $ rhodecode-config --filename=dev.ini
253 Wrote new config file in /Users/user/dev.ini
281 Wrote new config file in /Users/user/dev.ini
254
282
255 # Update config value for given section:
283 # Update config value for given section:
256 $ rhodecode-config --update --filename=prod.ini [handler_console]level=INFO
284 $ rhodecode-config --update --filename=prod.ini [handler_console]level=INFO
257
285
258 $ rhodecode-config --filename=dev.ini --show-defaults
286 $ rhodecode-config --filename=dev.ini --show-defaults
259 lang=en
287 lang=en
260 cpu_number=4
288 cpu_number=4
261 uuid=<function <lambda> at 0x10d86ac08>
289 uuid=<function <lambda> at 0x10d86ac08>
262 license_token=ff1e-aa9c-bb66-11e5
290 license_token=ff1e-aa9c-bb66-11e5
263 host=127.0.0.1
291 host=127.0.0.1
264 here=/Users/brian
292 here=/Users/brian
265 error_aggregation_service=None
293 error_aggregation_service=None
266 database_url=sqlite:///%(here)s/rhodecode.db?timeout=30
294 database_url=sqlite:///%(here)s/rhodecode.db?timeout=30
267 git_path=git
295 git_path=git
268 http_server=waitress
296 http_server=waitress
269 port=5000
297 port=5000
270
298
271 .. _tools-rhodecode-extensions:
299 .. _tools-rhodecode-extensions:
272
300
273 rhodecode-extensions
301 rhodecode-extensions
274 --------------------
302 --------------------
275
303
276 The `rcextensions` since version 4.14 are now shipped together with |RCE| please check
304 The `rcextensions` since version 4.14 are now shipped together with |RCE| please check
277 the using :ref:`integrations-rcextensions` section.
305 the using :ref:`integrations-rcextensions` section.
278
306
279
307
280 rhodecode-gist
308 rhodecode-gist
281 --------------
309 --------------
282
310
283 Use this to create, list, show, or delete gists within |RCE|. Options:
311 Use this to create, list, show, or delete gists within |RCE|. Options:
284
312
285 .. rst-class:: dl-horizontal
313 .. rst-class:: dl-horizontal
286
314
287 \ - -api-cache-only
315 \ - -api-cache-only
288 Requires a cache to be present when running this call
316 Requires a cache to be present when running this call
289
317
290 \ - -api-cache-rebuild
318 \ - -api-cache-rebuild
291 Replaces existing cached values with new ones from server
319 Replaces existing cached values with new ones from server
292
320
293 \ - -api-cache PATH
321 \ - -api-cache PATH
294 Use a special cache dir to read responses from instead of the server
322 Use a special cache dir to read responses from instead of the server
295
323
296 \ - -api-cert-verify
324 \ - -api-cert-verify
297 Verify the endpoint ssl certificate
325 Verify the endpoint ssl certificate
298
326
299 \ - -api-cert PATH
327 \ - -api-cert PATH
300 Path to alternate CA bundle.
328 Path to alternate CA bundle.
301
329
302 \ - -apihost <api_host>
330 \ - -apihost <api_host>
303 Set the API host value.
331 Set the API host value.
304
332
305 \ - -apikey <apikey_value>
333 \ - -apikey <apikey_value>
306 Set the API key value.
334 Set the API key value.
307
335
308 \-c, - -config <config_file>
336 \-c, - -config <config_file>
309 Create a configuration file.
337 Create a configuration file.
310 The default file is created in :file:`~/.rhoderc`
338 The default file is created in :file:`~/.rhoderc`
311
339
312 \ - -create <gistname>
340 \ - -create <gistname>
313 create the gist
341 create the gist
314
342
315 \-d, - -description <str>
343 \-d, - -description <str>
316 Set gist description
344 Set gist description
317
345
318 \ - -delete <gistid>
346 \ - -delete <gistid>
319 Delete the gist
347 Delete the gist
320
348
321 \-f, - -file
349 \-f, - -file
322 Specify the filename The file extension will enable syntax highlighting.
350 Specify the filename The file extension will enable syntax highlighting.
323
351
324 \-F, - -format {json,pretty}
352 \-F, - -format {json,pretty}
325 Set the formatted representation.
353 Set the formatted representation.
326
354
327 \ - -help
355 \ - -help
328 Show help messages.
356 Show help messages.
329
357
330 \-I, - -install-dir <DIR>
358 \-I, - -install-dir <DIR>
331 Location of application instances
359 Location of application instances
332
360
333 \ - -instance-name <instance-id>
361 \ - -instance-name <instance-id>
334 Set the instance name.
362 Set the instance name.
335
363
336 \ - -list
364 \ - -list
337 Display instance gists.
365 Display instance gists.
338
366
339 \-l, --lifetime <minutes>
367 \-l, --lifetime <minutes>
340 Set the gist lifetime. The default value is (-1) forever
368 Set the gist lifetime. The default value is (-1) forever
341
369
342 \ - -show <gistname>
370 \ - -show <gistname>
343 Show the content of the gist
371 Show the content of the gist
344
372
345 \-o, - -open
373 \-o, - -open
346 After creating Gist open it in browser
374 After creating Gist open it in browser
347
375
348 \-p, - -private
376 \-p, - -private
349 Create a private gist
377 Create a private gist
350
378
351 \ - -version
379 \ - -version
352 Display your |RCT| version.
380 Display your |RCT| version.
353
381
354 Example usage:
382 Example usage:
355
383
356 .. code-block:: bash
384 .. code-block:: bash
357
385
358 # List the gists in an instance
386 # List the gists in an instance
359 (venv)brian@ubuntu:~$ rhodecode-gist --instance-name=enterprise-1 list
387 (venv)brian@ubuntu:~$ rhodecode-gist --instance-name=enterprise-1 list
360 {
388 {
361 "error": null,
389 "error": null,
362 "id": 7102,
390 "id": 7102,
363 "result": [
391 "result": [
364 {
392 {
365 "access_id": "2",
393 "access_id": "2",
366 "content": null,
394 "content": null,
367 "created_on": "2015-01-19T12:52:26.494",
395 "created_on": "2015-01-19T12:52:26.494",
368 "description": "A public gust",
396 "description": "A public gust",
369 "expires": -1.0,
397 "expires": -1.0,
370 "gist_id": 2,
398 "gist_id": 2,
371 "type": "public",
399 "type": "public",
372 "url": "http://127.0.0.1:10003/_admin/gists/2"
400 "url": "http://127.0.0.1:10003/_admin/gists/2"
373 },
401 },
374 {
402 {
375 "access_id": "7gs6BsSEC4pKUEPLz5AB",
403 "access_id": "7gs6BsSEC4pKUEPLz5AB",
376 "content": null,
404 "content": null,
377 "created_on": "2015-01-19T11:27:40.812",
405 "created_on": "2015-01-19T11:27:40.812",
378 "description": "Gist testing API",
406 "description": "Gist testing API",
379 "expires": -1.0,
407 "expires": -1.0,
380 "gist_id": 1,
408 "gist_id": 1,
381 "type": "private",
409 "type": "private",
382 "url": "http://127.0.0.1:10003/_admin/gists/7gs6BsSEC4pKUEPLz5AB"
410 "url": "http://127.0.0.1:10003/_admin/gists/7gs6BsSEC4pKUEPLz5AB"
383 }
411 }
384 ]
412 ]
385 }
413 }
386
414
387 # delete a particular gist
415 # delete a particular gist
388 # You use the access_id to specify the gist to delete
416 # You use the access_id to specify the gist to delete
389 (venv)brian@ubuntu:~$ rhodecode-gist delete 2 --instance-name=enterprise-1
417 (venv)brian@ubuntu:~$ rhodecode-gist delete 2 --instance-name=enterprise-1
390 {
418 {
391 "error": null,
419 "error": null,
392 "id": 6284,
420 "id": 6284,
393 "result": {
421 "result": {
394 "gist": null,
422 "gist": null,
395 "msg": "deleted gist ID:2"
423 "msg": "deleted gist ID:2"
396 }
424 }
397 }
425 }
398
426
399 # cat a file and pipe to new gist
427 # cat a file and pipe to new gist
400 # This is if you are using virtualenv
428 # This is if you are using virtualenv
401 (venv)$ cat ~/.rhoderc | rhodecode-gist --instance-name=enterprise-1 \
429 (venv)$ cat ~/.rhoderc | rhodecode-gist --instance-name=enterprise-1 \
402 -d '.rhoderc copy' create
430 -d '.rhoderc copy' create
403
431
404 {
432 {
405 "error": null,
433 "error": null,
406 "id": 5374,
434 "id": 5374,
407 "result": {
435 "result": {
408 "gist": {
436 "gist": {
409 "access_id": "7",
437 "access_id": "7",
410 "content": null,
438 "content": null,
411 "created_on": "2015-01-26T11:31:58.774",
439 "created_on": "2015-01-26T11:31:58.774",
412 "description": ".rhoderc copy",
440 "description": ".rhoderc copy",
413 "expires": -1.0,
441 "expires": -1.0,
414 "gist_id": 7,
442 "gist_id": 7,
415 "type": "public",
443 "type": "public",
416 "url": "http://127.0.0.1:10003/_admin/gists/7"
444 "url": "http://127.0.0.1:10003/_admin/gists/7"
417 },
445 },
418 "msg": "created new gist"
446 "msg": "created new gist"
419 }
447 }
420 }
448 }
421
449
422 # Cat a file and pipe to gist
450 # Cat a file and pipe to gist
423 # in RCE 3.5.0 tools and above
451
424 $ cat ~/.rhoderc | ~/.rccontrol/{instance-id}/profile/bin/rhodecode-gist \
452 $ cat ~/.rhoderc | ./rcstack cli cmd rhodecode-gist --instance-name=rcstack-instance --config=/etc/rhodecode/conf/.rhoderc -d '.rhoderc copy' create
425 --instance-name=enterprise-4 -d '.rhoderc copy' create
426 {
453 {
427 "error": null,
454 "error": null,
428 "id": 9253,
455 "id": 9253,
429 "result": {
456 "result": {
430 "gist": {
457 "gist": {
431 "access_id": "4",
458 "access_id": "4",
432 "acl_level": "acl_public",
459 "acl_level": "acl_public",
433 "content": null,
460 "content": null,
434 "created_on": "2015-08-20T05:54:11.250",
461 "created_on": "2015-08-20T05:54:11.250",
435 "description": ".rhoderc copy",
462 "description": ".rhoderc copy",
436 "expires": -1.0,
463 "expires": -1.0,
437 "gist_id": 4,
464 "gist_id": 4,
438 "modified_at": "2015-08-20T05:54:11.250",
465 "modified_at": "2015-08-20T05:54:11.250",
439 "type": "public",
466 "type": "public",
440 "url": "http://127.0.0.1:10000/_admin/gists/4"
467 "url": "http://127.0.0.1:10000/_admin/gists/4"
441 },
468 },
442 "msg": "created new gist"
469 "msg": "created new gist"
443 }
470 }
444 }
471 }
445
472
446
473
447 rhodecode-index
474 rhodecode-index
448 ---------------
475 ---------------
449
476
450 More detailed information regarding setting up the indexer is available in
477 More detailed information regarding setting up the indexer is available in
451 the :ref:`indexing-ref` section. Options:
478 the :ref:`indexing-ref` section. Options:
452
479
453 .. rst-class:: dl-horizontal
480 .. rst-class:: dl-horizontal
454
481
455 \ - -api-cache-only
482 \ - -api-cache-only
456 Requires a cache to be present when running this call
483 Requires a cache to be present when running this call
457
484
458 \ - -api-cache-rebuild
485 \ - -api-cache-rebuild
459 Replaces existing cached values with new ones from server
486 Replaces existing cached values with new ones from server
460
487
461 \ - -api-cache PATH
488 \ - -api-cache PATH
462 Use a special cache dir to read responses from instead of the server
489 Use a special cache dir to read responses from instead of the server
463
490
464 \ - -api-cert-verify
491 \ - -api-cert-verify
465 Verify the endpoint ssl certificate
492 Verify the endpoint ssl certificate
466
493
467 \ - -api-cert PATH
494 \ - -api-cert PATH
468 Path to alternate CA bundle.
495 Path to alternate CA bundle.
469
496
470 \ - -apihost <api_host>
497 \ - -apihost <api_host>
471 Set the API host value.
498 Set the API host value.
472
499
473 \ - -apikey <apikey_value>
500 \ - -apikey <apikey_value>
474 Set the API key value.
501 Set the API key value.
475
502
476 \-c, --config <config_file>
503 \-c, --config <config_file>
477 Create a configuration file.
504 Create a configuration file.
478 The default file is created in :file:`~/.rhoderc`
505 The default file is created in :file:`~/.rhoderc`
479
506
480 \ - -create-mapping <PATH>
507 \ - -create-mapping <PATH>
481 Creates an example mapping configuration for indexer.
508 Creates an example mapping configuration for indexer.
482
509
483 \-F, - -format {json,pretty}
510 \-F, - -format {json,pretty}
484 Set the formatted representation.
511 Set the formatted representation.
485
512
486 \-h, - -help
513 \-h, - -help
487 Show help messages.
514 Show help messages.
488
515
489 \ - -instance-name <instance-id>
516 \ - -instance-name <instance-id>
490 Set the instance name
517 Set the instance name
491
518
492 \-I, - -install-dir <DIR>
519 \-I, - -install-dir <DIR>
493 Location of application instances
520 Location of application instances
494
521
495 \-m, - -mapping <file_name>
522 \-m, - -mapping <file_name>
496 Parse the output to the .ini mapping file.
523 Parse the output to the .ini mapping file.
497
524
498 \ - -optimize
525 \ - -optimize
499 Optimize index for performance by amalgamating multiple index files
526 Optimize index for performance by amalgamating multiple index files
500 into one. Greatly increases incremental indexing speed.
527 into one. Greatly increases incremental indexing speed.
501
528
502 \-R, - -repo-dir <DIRECTORY>
529 \-R, - -repo-dir <DIRECTORY>
503 Location of repositories
530 Location of repositories
504
531
505 \ - -source <PATH>
532 \ - -source <PATH>
506 Use a special source JSON file to feed the indexer
533 Use a special source JSON file to feed the indexer
507
534
508 \ - -version
535 \ - -version
509 Display your |RCT| version.
536 Display your |RCT| version.
510
537
511 Example usage:
538 Example usage:
512
539
513 .. code-block:: bash
540 .. code-block:: bash
514
541
515 # Run the indexer
542 # Create the indexing mapping file
516 $ ~/.rccontrol/enterprise-4/profile/bin/rhodecode-index \
543 $ ./rcstack cli cmd rhodecode-index --instance-name=rcstack-instance --config=/etc/rhodecode/conf/.rhoderc --create-mapping search_mapping.ini
517 --instance-name=enterprise-4
518
544
519 # Run indexer based on search_mapping.ini file
545 # Run the indexer
520 # This is using pre-350 virtualenv
546 $ ./rcstack cli cmd rhodecode-index --instance-name=rcstack-instance --config=/etc/rhodecode/conf/.rhoderc
521 (venv)$ rhodecode-index --instance-name=enterprise-1
547
548 # Run indexer based on search_mapping.ini file using rhodecode-tools virtualenv
549 (venv)$ rhodecode-index --instance-name=rcstack-instance
522
550
523 # Index from the command line without creating
551 # Index from the command line without creating
524 # the .rhoderc file
552 # the .rhoderc file
525 $ rhodecode-index --apikey=key --apihost=http://rhodecode.server \
553 $ rhodecode-index --apikey=key --apihost=http://rhodecode.server --instance-name=rcstack-instance --save-config
526 --instance-name=enterprise-2 --save-config
527
528 # Create the indexing mapping file
529 $ ~/.rccontrol/enterprise-4/profile/bin/rhodecode-index \
530 --create-mapping search_mapping.ini --instance-name=enterprise-4
531
532 .. _tools-rhodecode-list-instance:
533
534 rhodecode-list-instances
535 ------------------------
536
537 Use this command to list the instance details configured in the
538 :file:`~/.rhoderc` file.
539
540 .. code-block:: bash
541
542 $ .rccontrol/enterprise-1/profile/bin/rhodecode-list-instances
543 [instance:production] - Config only
544 API-HOST: https://some.url.com
545 API-KEY: some.auth.token
546
547 [instance:development] - Config only
548 API-HOST: http://some.ip.address
549 API-KEY: some.auth.token
550
554
551
555
552 .. _tools-setup-config:
556 .. _tools-setup-config:
553
557
554 rhodecode-setup-config
558 rhodecode-setup-config
555 ----------------------
559 ----------------------
556
560
557 Use this command to create the ``~.rhoderc`` file required by |RCT| to access
561 Use this command to create the ``~.rhoderc`` file required by |RCT| to access
558 remote instances.
562 remote instances.
559
563
560 .. rst-class:: dl-horizontal
564 .. rst-class:: dl-horizontal
561
565
562 \- -instance-name <name>
566 \- -instance-name <name>
563 Specify the instance name in the :file:`~/.rhoderc`
567 Specify the instance name in the :file:`~/.rhoderc`
564
568
565 \api_host <hostname>
569 \api_host <hostname>
566 Create a configuration file. The default file is created
570 Create a configuration file. The default file is created
567 in ``~/.rhoderc``
571 in ``~/.rhoderc``
568
572
569 \api_key <auth-token>
573 \api_key <auth-token>
570 Create a configuration file. The default file is created
574 Create a configuration file. The default file is created
571 in ``~/.rhoderc``
575 in ``~/.rhoderc``
572
576
573
577
574 .. code-block:: bash
578 .. code-block:: bash
575
579
576 (venv)$ rhodecode-setup-config --instance-name=tea api_host=URL api_key=xyz
580 (venv)$ rhodecode-setup-config --instance-name=tea api_host=URL api_key=xyz
577 Config not found under /Users/username/.rhoderc, creating a new one
581 Config not found under /Users/username/.rhoderc, creating a new one
578 Wrote new configuration into /Users/username/.rhoderc
582 Wrote new configuration into /Users/username/.rhoderc
General Comments 0
You need to be logged in to leave comments. Login now