##// END OF EJS Templates
docs: updated docs for integrations, fixes #4137...
dan -
r552:9a0f45b0 default
parent child Browse files
Show More
@@ -0,0 +1,25 b''
1 .. _extensions-hooks-ref:
2
3 Extensions & Hooks
4 ==================
5
6 The extensions & hooks section references three concepts regularly,
7 so to clarify what is meant each time, read the following definitions:
8
9 * **Plugin**: A Plugin is software that adds a specific feature to
10 an existing software application.
11 * **Extension**: An extension extends the capabilities of,
12 or the data available to, an existing software application.
13 * **Hook**: A hook intercepts function calls, messages, or events passed
14 between software components and can be used to trigger plugins, or their
15 extensions.
16
17 .. toctree::
18
19 rcx
20 install-ext
21 config-ext
22 extensions
23 hooks
24 full-blown-example
25 int-slack
@@ -0,0 +1,19 b''
1 .. _integrations-hipchat:
2
3 Hipchat integration
4 ===================
5
6 In order to set a hipchat integration up it is necessary to obtain the Hipchat
7 service url by:
8
9 1. Login to Hipchat (https://www.hipchat.com/)
10 2. Goto `Integrations` -> `Build your own`
11 3. Select a room to post notifications to and save it
12
13 Once the integration is setup on hipchat you should have a url of the
14 form: `
15 which can be used in :ref:`creating-integrations`
16
17 Once you have set up a Hipchat webhook integrations url of the form:
18 ``https://yourapp.hipchat.com/v2/room/123456/notification?auth_token=...``,
19 create a ``hipchat`` integration in :ref:`creating-integrations`.
@@ -0,0 +1,26 b''
1 .. _integrations-jira:
2
3 JIRA integration
4 ================
5
6 .. important::
7
8 In order to make issue numbers clickable in commit messages see the
9 :ref:`rhodecode-issue-trackers-ref` section. The JIRA integration
10 only deals with altering JIRA issues.
11
12 .. important::
13
14 JIRA integration is only available in |RCEE|.
15
16
17 The JIRA integration allows you to reference and change issue statuses in
18 JIRA directly from commit messages using commit message patterns such as
19 ``fixes #JIRA-235`` in order to change the status of issue JIRA-235 to
20 eg. ``Resolved``.
21
22 In order to apply a status to a JIRA issue it is necessary to find out the
23 transition status id which can be found in the Workflow section of JIRA.
24
25 Once you have the transition status id, create a ``jira`` integration in
26 :ref:`creating-integrations`.
@@ -0,0 +1,25 b''
1 .. _integrations-redmine:
2
3 Redmine integration
4 ===================
5
6 .. important::
7
8 In order to make issue numbers clickable in commit messages see the
9 :ref:`rhodecode-issue-trackers-ref` section. The Redmine integration
10 only deals with altering Redmine issues.
11
12 .. important::
13
14 Redmine integration is only available in |RCEE|.
15
16 The Redmine integration allows you to reference and change issue statuses in
17 Redmine directly from commit messages using commit message patterns such as
18 ``fixes #235`` in order to change the status of issue 235 to eg. ``Resolved``
19
20 To set a Redmine integration up it is first necessary to obtain a Redmine api
21 key. This can be found in ``My Account`` in the Redmine application.
22 If it is not there, you may have to enable API Access in Redmine settings.
23
24 Once you have the api key, create a ``redmine`` integration in
25 :ref:`creating-integrations`.
@@ -0,0 +1,13 b''
1 .. _integrations-slack:
2
3 Slack integration
4 =================
5
6 To set a Slack integration up it is first necessary to set up a Slack webhook api
7 endpoint for your slack channel, this can be done at:
8
9 https://my.slack.com/services/new/incoming-webhook/
10
11 Once you have set up a Slack webhook integrations url of the
12 form: ``https://hooks.slack.com/services/...``, create a ``slack`` integration
13 in :ref:`creating-integrations`.
@@ -0,0 +1,10 b''
1 .. _integrations-webhook:
2
3 Webhook integration
4 ===================
5
6 The Webhook integration allows you to POST events such as repository pushes
7 or pull requests to a custom http endpoint as a json dict with details of the
8 event.
9
10 To create a webhook integration select ``webhook`` in :ref:`creating-integrations`.
@@ -1,127 +1,127 b''
1 1 .. _backup-ref:
2 2
3 3 Backup and Restore
4 4 ==================
5 5
6 6 *β€œThe condition of any backup is unknown until a restore is attempted.”*
7 7 `SchrΓΆdinger's Backup`_
8 8
9 9 To snapshot an instance of |RCE|, and save its settings, you need to backup the
10 10 following parts of the system at the same time.
11 11
12 12 * The |repos| managed by the instance.
13 13 * The |RCE| database.
14 14 * Any configuration files or extensions that you've configured.
15 15
16 16 .. important::
17 17
18 18 Ideally you should script all of these functions so that it creates a
19 19 backup snapshot of your system at a particular timestamp and then run that
20 20 script regularly.
21 21
22 22 Backup Details
23 23 --------------
24 24
25 25 To backup the relevant parts of |RCE| required to restore your system, use
26 26 the information in this section to identify what is important to you.
27 27
28 28 Repository Backup
29 29 ^^^^^^^^^^^^^^^^^
30 30
31 31 To back up your |repos|, use the API to get a list of all |repos| managed,
32 32 and then clone them to your backup location.
33 33
34 34 Use the ``get_repos`` method to list all your managed |repos|,
35 35 and use the ``clone_uri`` information that is returned. See the :ref:`api`
36 36 for more information.
37 37
38 38 .. important::
39 39
40 40 This will not work for |svn| |repos|. Currently the only way to back up
41 41 your |svn| |repos| is to make a copy of them.
42 42
43 43 It is also important to note, that you can only restore the |svn| |repos|
44 44 using the same version as they were saved with.
45 45
46 46 Database Backup
47 47 ^^^^^^^^^^^^^^^
48 48
49 49 The instance database contains all the |RCE| permissions settings,
50 50 and user management information. To backup your database,
51 51 export it using the following appropriate example, and then move it to your
52 52 backup location:
53 53
54 54 .. code-block:: bash
55 55
56 56 # For MySQL DBs
57 57 $ mysqldump -u <uname> -p <pass> db_name > mysql-db-backup
58 58
59 59 # For PostgreSQL DBs
60 60 $ pg_dump dbname > postgresql-db-backup
61 61
62 62 # For SQLlite
63 63 $ sqlite3 rhodecode.db β€˜.dump’ > sqlite-db-backup
64 64
65 65
66 66 The default |RCE| SQLite database location is
67 67 :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.db`
68 68
69 69 If running MySQL or PostgreSQL databases, you will have configured these
70 70 separately, for more information see :ref:`rhodecode-database-ref`
71 71
72 72 Configuration File Backup
73 73 ^^^^^^^^^^^^^^^^^^^^^^^^^
74 74
75 75 Depending on your setup, you could have a number of configuration files that
76 76 should be backed up. You may have some, or all of the configuration files
77 77 listed in the :ref:`config-rce-files` section. Ideally you should back these
78 78 up at the same time as the database and |repos|.
79 79
80 80 Gist Backup
81 81 ^^^^^^^^^^^
82 82
83 83 To backup the gists on your |RCE| instance you can use the ``get_users`` and
84 84 ``get_gists`` API methods to fetch the gists for each user on the instance.
85 85
86 86 Extension Backups
87 87 ^^^^^^^^^^^^^^^^^
88 88
89 89 You should also backup any extensions added in the
90 90 :file:`home/{user}/.rccontrol/{instance-id}/rcextensions` directory.
91 91
92 92 Full-text Search Backup
93 93 ^^^^^^^^^^^^^^^^^^^^^^^
94 94
95 95 You may also have full text search set up, but the index can be rebuild from
96 96 re-imported |repos| if necessary. You will most likely want to backup your
97 97 :file:`mapping.ini` file if you've configured that. For more information, see
98 98 the :ref:`indexing-ref` section.
99 99
100 100 Restoration Steps
101 101 -----------------
102 102
103 103 To restore an instance of |RCE| from its backed up components, use the
104 104 following steps.
105 105
106 106 1. Install a new instance of |RCE|.
107 107 2. Once installed, configure the instance to use the backed up
108 108 :file:`rhodecode.ini` file. Ensure this file points to the backed up
109 109 database, see the :ref:`config-database` section.
110 110 3. Restart |RCE| and remap and rescan your |repos|, see the
111 111 :ref:`remap-rescan` section.
112 112
113 113 Post Restoration Steps
114 114 ^^^^^^^^^^^^^^^^^^^^^^
115 115
116 116 Once you have restored your |RCE| instance to basic functionality, you can
117 117 then work on restoring any specific setup changes you had made.
118 118
119 119 * To recreate the |RCE| index, use the backed up :file:`mapping.ini` file if
120 120 you had made changes and rerun the indexer. See the
121 121 :ref:`indexing-ref` section for details.
122 122 * To reconfigure any extensions, copy the backed up extensions into the
123 123 :file:`/home/{user}/.rccontrol/{instance-id}/rcextensions` and also specify
124 any custom hooks if necessary. See the :ref:`integrations-ref` section for
124 any custom hooks if necessary. See the :ref:`extensions-hooks-ref` section for
125 125 details.
126 126
127 127 .. _SchrΓΆdinger's Backup: http://novabackup.novastor.com/blog/schrodingers-backup-good-bad-backup/
@@ -1,68 +1,68 b''
1 1 .. _repo-xtra:
2 2
3 3 Repository Extra Fields
4 4 =======================
5 5
6 6 Extra fields attached to a |repo| allow you to configure additional actions for
7 7 |RCX|. To install and read more about |RCX|, see the :ref:`install-rcx` section.
8 8
9 9 Enabling Extra Fields
10 10 ---------------------
11 11
12 12 To enable extra fields on |repos|, use the following steps:
13 13
14 14 1. Go to the :menuselection:`Admin --> Settings --> Visual` page.
15 15 2. Check the :guilabel:`Use repository extra fields` box.
16 16 3. Save your changes.
17 17
18 18
19 19 Configuring Extra Fields
20 20 ------------------------
21 21
22 22 To configure extra fields per repository, use the following steps:
23 23
24 24 1. Go to :menuselection:`Admin --> Repositories` and select :guilabel:`Edit`
25 25 beside the |repo| to which you wish to add extra fields.
26 26 2. On the |repo| settings page, select the :guilabel:`Extra fields` tab.
27 27
28 28 .. image:: ../images/extra-repo-fields.png
29 29
30 30
31 31 Example Usage
32 32 -------------
33 33
34 34 To use the extra fields in an extension, see the example below. For more
35 information and examples, see the :ref:`integrations-ref` section.
35 information and examples, see the :ref:`extensions-hooks-ref` section.
36 36
37 37 .. code-block:: python
38 38
39 39 call = load_extension('http_notify.py')
40 40 if call:
41 41 url = 'http://default.url' # <url for post data>
42 42
43 43 # possibly extract the URL from extra fields
44 44 call = load_extension('extra_fields.py')
45 45 if call:
46 46 repo_extra_fields = call(**kwargs)
47 47 # now update if we have extra fields, they have precedence
48 48 # this way users can store any configuration inside the database per
49 49 # repo
50 50 for key, data in repo_extra_fields.items():
51 51 kwargs[key] = data['field_value']
52 52
53 53 # an endpoint url data will be sent to, fetched from extra fields
54 54 # if exists, or fallback to default
55 55 kwargs['URL'] = kwargs.pop('webhook_url', None) or url
56 56
57 57 # fetch pushed commits, from commit_ids list
58 58 call = load_extension('extract_commits.py')
59 59 extracted_commits = {}
60 60 if call:
61 61 extracted_commits = call(**kwargs)
62 62 # store the commits for the next call chain
63 63 kwargs['COMMITS'] = extracted_commits
64 64
65 65 # set additional keys and values to be sent via POST to given URL
66 66 kwargs['caller_type'] = 'rhodecode'
67 67 kwargs['date'] = time.time() # import time before
68 68 call(**kwargs)
@@ -1,27 +1,27 b''
1 1 .. _code-review-ref:
2 2
3 3 Code Review
4 4 ===========
5 5
6 6 |RCM| provides two ways in which you can review code. You can review |prs| or
7 7 commits. To better understand |prs|, see the :ref:`pull-requests-ref`
8 8 and :ref:`collaborate-ref` sections. For more information about why
9 9 code review matters, see these posts on the topic:
10 10
11 11 * `Code Review - Fix Bugs Early and Often`_
12 12 * `Code Review - How to Convince a Skeptic`_
13 13 * `Code Review - Learn How NASA Codes`_
14 14
15 15 You can also use the |RCE| API set up continuous integration servers to leave
16 16 comments from a test suite. See the :ref:`api` and
17 :ref:`integrations-ref` sections for examples on how to set this up.
17 :ref:`extensions-hooks-ref` sections for examples on how to set this up.
18 18
19 19 .. toctree::
20 20
21 21 review-diffs
22 22 approve-changes
23 23 reviewing-best-practices
24 24
25 25 .. _Code Review - Fix Bugs Early and Often: https://rhodecode.com/blog/code-review-fix-bugs-early-often/
26 26 .. _Code Review - How to Convince a Skeptic: https://rhodecode.com/blog/code-review-convince-skeptic/
27 27 .. _Code Review - Learn How NASA Codes: https://rhodecode.com/blog/code-review-learn-nasa-codes/
@@ -1,34 +1,36 b''
1 1 # Try and keep this list alphabetical
2 2 # ui is for user interface elements and messages
3 3 # button - that's obvious
4 4
5 5 rst_epilog = '''
6 6 .. |AE| replace:: Appenlight
7 7 .. |authtoken| replace:: Authentication Token
8 8 .. |authtokens| replace:: **Auth Tokens**
9 .. |RCCEshort| replace:: Community
10 .. |RCEEshort| replace:: Enterprise
9 11 .. |git| replace:: Git
10 12 .. |hg| replace:: Mercurial
11 13 .. |svn| replace:: Subversion
12 14 .. |LDAP| replace:: LDAP / Active Directory
13 15 .. |os| replace:: operating system
14 16 .. |OS| replace:: Operating System
15 17 .. |PY| replace:: Python
16 18 .. |pr| replace:: pull request
17 19 .. |prs| replace:: pull requests
18 20 .. |psf| replace:: Python Software Foundation
19 21 .. |repo| replace:: repository
20 22 .. |repos| replace:: repositories
21 23 .. |RCI| replace:: RhodeCode Control
22 24 .. |RCC| replace:: RhodeCode Control
23 25 .. |RCV| replace:: RhodeCode Enterprise
24 26 .. |RCM| replace:: RhodeCode Enterprise
25 27 .. |RCE| replace:: RhodeCode Enterprise
26 28 .. |RCCE| replace:: RhodeCode Community
27 29 .. |RCEE| replace:: RhodeCode Enterprise
28 30 .. |RCX| replace:: RhodeCode Extensions
29 31 .. |RCT| replace:: RhodeCode Tools
30 32 .. |RCEBOLD| replace:: **RhodeCode Enterprise**
31 33 .. |RCEITALICS| replace:: `RhodeCode Enterprise`
32 34 .. |RC| replace:: RhodeCode
33 35 .. |RNS| replace:: Release Notes
34 36 '''
1 NO CONTENT: file renamed from docs/integrations/config-ext.rst to docs/extensions/config-ext.rst
1 NO CONTENT: file renamed from docs/integrations/example-ext.py to docs/extensions/example-ext.py
1 NO CONTENT: file renamed from docs/integrations/extensions.rst to docs/extensions/extensions.rst
1 NO CONTENT: file renamed from docs/integrations/full-blown-example.rst to docs/extensions/full-blown-example.rst
1 NO CONTENT: file renamed from docs/integrations/hooks.rst to docs/extensions/hooks.rst
1 NO CONTENT: file renamed from docs/integrations/install-ext.rst to docs/extensions/install-ext.rst
1 NO CONTENT: file renamed from docs/integrations/int-slack.rst to docs/extensions/int-slack.rst
1 NO CONTENT: file renamed from docs/integrations/rcx.rst to docs/extensions/rcx.rst
@@ -1,84 +1,85 b''
1 1 |RCM|
2 2 =====
3 3
4 4 |RCM| is a high-performance source code management and collaboration system.
5 5 It enables you to develop projects securely behind the firewall while
6 6 providing collaboration tools that work with |git|, |hg|,
7 7 and |svn| |repos|. The user interface allows you to create, edit,
8 8 and commit files and |repos| while managing their security permissions.
9 9
10 10 |RCM| provides the following features:
11 11
12 12 * Source code management.
13 13 * Extended permissions management.
14 14 * Integrated code collaboration tools.
15 15 * Integrated code review and notifications.
16 16 * Scalability provided by multi-node setup.
17 17 * Fully programmable automation API.
18 18 * Web-based hook management.
19 19 * Native |svn| support.
20 20 * Migration from existing databases.
21 21 * |RCM| SDK.
22 22 * Built-in analytics
23 23 * Pluggable authentication system.
24 24 * Support for |LDAP|, Crowd, CAS, PAM.
25 25 * Debug modes of operation.
26 26 * Private and public gists.
27 27 * Gists with limited lifetimes and within instance only sharing.
28 28 * Fully integrated code search function.
29 29 * Always on SSL connectivity.
30 30
31 31 .. only:: html
32 32
33 33 Table of Contents
34 34 -----------------
35 35
36 36 .. toctree::
37 37 :maxdepth: 1
38 38 :caption: Admin Documentation
39 39
40 40 install/quick-start
41 41 install/install-database
42 42 install/install-steps
43 43 admin/system-overview
44 44 nix/default-env
45 45 admin/system-admin
46 46 admin/user-admin
47 47 admin/setting-repo-perms
48 48 admin/security-tips
49 49 auth/auth
50 50 issue-trackers/issue-trackers
51 51 admin/lab-settings
52 52
53 53 .. toctree::
54 54 :maxdepth: 1
55 55 :caption: Feature Documentation
56 56
57 57 collaboration/collaboration
58 58 collaboration/review-notifications
59 59 collaboration/pull-requests
60 60 code-review/code-review
61 integrations/integrations
61 62
62 63 .. toctree::
63 64 :maxdepth: 1
64 65 :caption: Developer Documentation
65 66
66 67 api/api
67 68 tools/rhodecode-tools
68 integrations/integrations
69 extensions/extensions-hooks
69 70 contributing/contributing
70 71
71 72 .. toctree::
72 73 :maxdepth: 1
73 74 :caption: User Documentation
74 75
75 76 usage/basic-usage
76 77 tutorials/tutorials
77 78
78 79 .. toctree::
79 80 :maxdepth: 1
80 81 :caption: About
81 82
82 83 known-issues/known-issues
83 84 release-notes/release-notes
84 85 admin/glossary
@@ -1,25 +1,49 b''
1 .. _integrations-ref:
1 .. _integrations:
2
3 Integrations
4 ------------
2 5
3 Integrations and Extensions
4 ===========================
6 Rhodecode supports integrations with external services for various events
7 such as commit pushes and pull requests. Multiple integrations of the same type
8 (eg. slack) can be added at the same time which is useful for example to post
9 different events to different slack channels.
5 10
6 The integrations section references three concepts regularly,
7 so to clarify what is meant each time, read the following definitions:
11 Supported integrations
12 ^^^^^^^^^^^^^^^^^^^^^^
8 13
9 * **Plugin**: A Plugin is software that adds a specific feature to
10 an existing software application.
11 * **Extension**: An extension extends the capabilities of,
12 or the data available to, an existing software application.
13 * **Hook**: A hook intercepts function calls, messages, or events passed
14 between software components and can be used to trigger plugins, or their
15 extensions.
14 ============================ ============ =====================================
15 Type/Name |RC| Edition Description
16 ============================ ============ =====================================
17 :ref:`integrations-slack` |RCCEshort| https://slack.com/
18 :ref:`integrations-hipchat` |RCCEshort| https://www.hipchat.com/
19 :ref:`integrations-webhook` |RCCEshort| POST events as `json` to a custom url
20 :ref:`integrations-redmine` |RCEEshort| Close/Resolve/Reference redmine issues
21 :ref:`integrations-jira` |RCEEshort| Close/Resolve/Reference JIRA issues
22 ============================ ============ =====================================
23
24 .. _creating-integrations:
25
26 Creating an integration
27 ^^^^^^^^^^^^^^^^^^^^^^^
28
29 Integrations can be added globally via the admin UI:
30
31 :menuselection:`Admin --> Integrations`
32
33 or per repository in the repository settings:
34
35 :menuselection:`Admin --> Repositories --> Edit --> Integrations`
36
37 To create an integration, select the type from the list of types in the
38 `Create an integration` section.
39
40 The `Current integrations` section shows existing integrations that have been
41 created along with their type (eg. slack) and enabled status.
16 42
17 43 .. toctree::
18 44
19 rcx
20 install-ext
21 config-ext
22 extensions
23 hooks
24 full-blown-example
25 int-slack
45 slack
46 hipchat
47 redmine
48 jira
49 webhook
@@ -1,677 +1,677 b''
1 1 .. _tools-cli:
2 2
3 3 |RCT| CLI
4 4 ---------
5 5
6 6 The commands available with |RCT| can be split into three categories:
7 7
8 8 - Remotely executable commands that can be run from your local machine once you
9 9 have your connection details to |RCE| configured.
10 10 - Locally executable commands the can be run on the server to carry out
11 11 general maintenance.
12 12 - Local configuration commands used to help set up your |RCT| configuration.
13 13
14 14
15 15 rhodecode-tools
16 16 ---------------
17 17
18 18 Use |RCT| to setup automation, run the indexer, and install extensions for
19 19 your |RCM| instances. Options:
20 20
21 21 .. rst-class:: dl-horizontal
22 22
23 23 \ - -apihost <api_host>
24 24 Set the API host value.
25 25
26 26 \ - -apikey <apikey_value>
27 27 Set the API key value.
28 28
29 29 \-c, - -config <config_file>
30 30 Create a configuration file. The default file is created
31 31 in ``~/.rhoderc``
32 32
33 33 \ - -save-config
34 34 Save the configuration file.
35 35
36 36 \ - -show-config
37 37 Show the current configuration values.
38 38
39 39 \ - -format {json,pretty}
40 40 Set the formatted representation.
41 41
42 42 Example usage:
43 43
44 44 .. code-block:: bash
45 45
46 46 $ rhodecode-tools --apikey=key --apihost=http://rhodecode.server \
47 47 --save-config
48 48
49 49 rhodecode-api
50 50 -------------
51 51
52 52 The |RC| API lets you connect to |RCE| and carry out management tasks from a
53 53 remote machine, for more information about the API, see the :ref:`api`. To
54 54 pass arguments on the command-line use the ``method:option`` syntax.
55 55
56 56 Example usage:
57 57
58 58 .. code-block:: bash
59 59
60 60 # Run the get_repos API call and sample output
61 61 $ rhodecode-api --instance-name=enterprise-1 create_repo \
62 62 repo_name:brand-new repo_type:hg description:repo-desc
63 63
64 64 {
65 65 "error": null,
66 66 "id": 1110,
67 67 "result": {
68 68 "msg": "Created new repository `brand-new`",
69 69 "success": true,
70 70 "task": null
71 71 }
72 72 }
73 73
74 74 Options:
75 75
76 76 .. rst-class:: dl-horizontal
77 77
78 78 \ - -api-cache-only
79 79 Requires a cache to be present when running this call
80 80
81 81 \ - -api-cache-rebuild
82 82 Replaces existing cached values with new ones from server
83 83
84 84 \ - -api-cache <PATH>
85 85 Use a special cache dir to read responses from instead of the server
86 86
87 87 \ - -api-cert-verify
88 88 Verify the endpoint ssl certificate
89 89
90 90 \ - -api-cert <PATH>
91 91 Path to alternate CA bundle.
92 92
93 93 \ - -apihost <api_host>
94 94 Set the API host value.
95 95
96 96 \ - -apikey <apikey_value>
97 97 Set the API key value.
98 98
99 99 \ - -instance-name <instance-id>
100 100 Set the instance name
101 101
102 102 \-I, - -install-dir <DIR>
103 103 Location of application instances
104 104
105 105 \-c, - -config <.rhoderc-file>
106 106 Location of the :file:`.rhoderc`
107 107
108 108 \-F, - -format {json,pretty}
109 109 Set the formatted representation.
110 110
111 111 \-h, - -help
112 112 Show help messages.
113 113
114 114 \-v, - -verbose
115 115 Enable verbose messaging
116 116
117 117 rhodecode-cleanup-gists
118 118 -----------------------
119 119
120 120 Use this to delete gists within |RCM|. Options:
121 121
122 122 .. rst-class:: dl-horizontal
123 123
124 124 \-c, - -config <config_file>
125 125 Set the file path to the configuration file. The default file is
126 126 :file:`/home/{user}/.rhoderc`
127 127
128 128 \ - -corrupted
129 129 Remove gists with corrupted metadata.
130 130
131 131 \ - -dont-ask
132 132 Remove gists without asking for confirmation.
133 133
134 134 \-h, - -help
135 135 Show help messages. current configuration values.
136 136
137 137 \ - -instance-name <instance-id>
138 138 Set the instance name.
139 139
140 140 \-R, - -repo-dir
141 141 Set the repository file path.
142 142
143 143 \ - -version
144 144 Display your |RCT| version.
145 145
146 146 Example usage:
147 147
148 148 .. code-block:: bash
149 149
150 150 # Clean up gists related to an instance
151 151 $ rhodecode-cleanup-gists --instance-name=enterprise-1
152 152 Scanning for gists in /home/brian/repos/.rc_gist_store...
153 153 preparing to remove [3] found gists
154 154
155 155 # Clean up corrupted gists in an instance
156 156 $ rhodecode-cleanup-gists --instance-name=enterprise-1 --corrupted
157 157 Scanning for gists in /home/brian/repos/.rc_gist_store...
158 158 preparing to remove [2] found gists
159 159 the following gists will be archived:
160 160 * EXPIRED: BAD METADATA | /home/brian/repos/.rc_gist_store/5
161 161 * EXPIRED: BAD METADATA | /home/brian/repos/.rc_gist_store/8FtC
162 162 are you sure you want to archive them? [y/N]: y
163 163 removing gist /home/brian/repos/.rc_gist_store/5
164 164 removing gist /home/brian/repos/.rc_gist_store/8FtCKdcbRKmEvRzTVsEt
165 165
166 166 rhodecode-cleanup-repos
167 167 -----------------------
168 168
169 169 Use this to manage |repos| and |repo| groups within |RCM|. Options:
170 170
171 171 .. rst-class:: dl-horizontal
172 172
173 173 \-c, - -config <config_file>
174 174 Set the file path to the configuration file. The default file is
175 175 :file:`/home/{user}/.rhoderc`.
176 176
177 177 \-h, - -help
178 178 Show help messages. current configuration values.
179 179
180 180 \ - -interactive
181 181 Enable an interactive prompt for each repository when deleting.
182 182
183 183 \ - -include-groups
184 184 Remove repository groups.
185 185
186 186 \ - -instance-name <instance-id>
187 187 Set the instance name.
188 188
189 189 \ - -list-only
190 190 Display repositories selected for deletion.
191 191
192 192 \ - -older-than <str>
193 193 Delete repositories older that a specified time.
194 194 You can use the following suffixes; d for days, h for hours,
195 195 m for minutes, s for seconds.
196 196
197 197 \-R, - -repo-dir
198 198 Set the repository file path
199 199
200 200 Example usage:
201 201
202 202 .. code-block:: bash
203 203
204 204 # Cleaning up repos using tools installed with RCE 350 and above
205 205 $ ~/.rccontrol/enterprise-4/profile/bin/rhodecode-cleanup-repos \
206 206 --instance-name=enterprise-4 --older-than=1d
207 207 Scanning for repositories in /home/brian/repos...
208 208 preparing to remove [2] found repositories older than 1 day, 0:00:00 (1d)
209 209
210 210 the following repositories will be deleted completely:
211 211 * REMOVED: 2015-08-05 00:23:18 | /home/brian/repos/rm__20150805_002318_831
212 212 * REMOVED: 2015-08-04 01:22:10 | /home/brian/repos/rm__20150804_012210_336
213 213 are you sure you want to remove them? [y/N]:
214 214
215 215 # Clean up repos older than 1 year
216 216 # If using virtualenv and pre RCE 350 tools installation
217 217 (venv)$ rhodecode-cleanup-repos --instance-name=enterprise-1 \
218 218 --older-than=365d
219 219
220 220 Scanning for repositories in /home/brian/repos...
221 221 preparing to remove [343] found repositories older than 365 days
222 222
223 223 # clean up repos older than 3 days
224 224 # If using virtualenv and pre RCE 350 tools installation
225 225 (venv)$ rhodecode-cleanup-repos --instance-name=enterprise-1 \
226 226 --older-than=3d
227 227 Scanning for repositories in /home/brian/repos...
228 228 preparing to remove [3] found repositories older than 3 days
229 229
230 230 .. _tools-config:
231 231
232 232 rhodecode-config
233 233 ----------------
234 234
235 235 Use this to create or update a |RCE| configuration file on the local machine.
236 236
237 237 .. rst-class:: dl-horizontal
238 238
239 239 \- -filename </path/to/config_file>
240 240 Set the file path to the |RCE| configuration file.
241 241
242 242 \- -show-defaults
243 243 Display the defaults set in the |RCE| configuration file.
244 244
245 245 \- -update
246 246 Update the configuration with the new settings passed on the command
247 247 line.
248 248
249 249 .. code-block:: bash
250 250
251 251 # Create a new config file
252 252 $ rhodecode-config --filename=dev.ini
253 253 Wrote new config file in /Users/user/dev.ini
254 254
255 255 # Update config value for given section:
256 256 $ rhodecode-config --update --filename=prod.ini [handler_console]level=INFO
257 257
258 258 $ rhodecode-config --filename=dev.ini --show-defaults
259 259 lang=en
260 260 cpu_number=4
261 261 uuid=<function <lambda> at 0x10d86ac08>
262 262 license_token=ff1e-aa9c-bb66-11e5
263 263 host=127.0.0.1
264 264 here=/Users/brian
265 265 error_aggregation_service=None
266 266 database_url=sqlite:///%(here)s/rhodecode.db?timeout=30
267 267 git_path=git
268 268 http_server=waitress
269 269 port=5000
270 270
271 271 .. _tools-rhodecode-extensions:
272 272
273 273 rhodecode-extensions
274 274 --------------------
275 275
276 276 |RCT| adds additional mapping for :ref:`indexing-ref`, statistics, and adds
277 277 additional code for push/pull/create/delete |repo| hooks. These hooks can be
278 278 used to send signals to build-bots such as jenkins. Options:
279 279
280 280 .. rst-class:: dl-horizontal
281 281
282 282 \-c, - -config <config_file>
283 283 Create a configuration file. The default file is created
284 284 in ``~/.rhoderc``
285 285
286 286 \-h, - -help
287 287 Show help messages.
288 288
289 289 \-F, - -format {json,pretty}
290 290 Set the formatted representation.
291 291
292 292 \-I, - -install-dir <str>
293 293 Set the location of the |RCE| installation. The default location is
294 294 :file:`/home/{user}/.rccontrol/`.
295 295
296 296 \ - -ini-file <str>
297 297 Path to the :file:`rhodecode.ini` file for that instance.
298 298
299 299 \ - -instance-name <instance-id>
300 300 Set the instance name.
301 301
302 302 \ - -plugins
303 303 Add plugins to your |RCE| installation. See the
304 :ref:`integrations-ref` section for more details.
304 :ref:`extensions-hooks-ref` section for more details.
305 305
306 306 \ - -version
307 307 Display your |RCT| version.
308 308
309 309
310 310 Once installed, you will see a :file:`rcextensions` folder in the instance
311 311 directory, for example :file:`home/{user}/.rccontrol/{instance-id}/rcextensions`
312 312
313 313 To install ``rcextensions``, use the following example:
314 314
315 315 .. code-block:: bash
316 316
317 317 # install extensions on the given instance
318 318 # If using virtualenv prior to RCE 350
319 319 (venv)$ rhodecode-extensions --instance-name=enterprise-1 \
320 320 --ini-file=rhodecode.ini
321 321 Writen new extensions file to rcextensions
322 322
323 323 # install extensions with additional plugins on the given instance
324 324 (venv)$ rhodecode-extensions --instance-name=enterprise-1 \
325 325 --ini-file=rhodecode.ini --plugins
326 326 Writen new extensions file to rcextensions
327 327
328 328 # installing extensions from 350 onwards
329 329 # as they are packaged with RCE
330 330 $ .rccontrol/enterprise-4/profile/bin/rhodecode-extensions --plugins \
331 331 --instance-name=enterprise-4 --ini-file=rhodecode.ini
332 332
333 333 Writen new extensions file to rcextensions
334 334
335 335 See the new extensions inside this directory for more details about the
336 336 additional hooks available, for example see the ``push_post.py`` file.
337 337
338 338 .. code-block:: python
339 339
340 340 import urllib
341 341 import urllib2
342 342
343 343 def run(*args, **kwargs):
344 344 """
345 345 Extra params
346 346
347 347 :param URL: url to send the data to
348 348 """
349 349
350 350 url = kwargs.pop('URL', None)
351 351 if url:
352 352 from rhodecode.lib.compat import json
353 353 from rhodecode.model.db import Repository
354 354
355 355 repo = Repository.get_by_repo_name(kwargs['repository'])
356 356 changesets = []
357 357 vcs_repo = repo.scm_instance_no_cache()
358 358 for r in kwargs['pushed_revs']:
359 359 cs = vcs_repo.get_changeset(r)
360 360 changesets.append(json.dumps(cs))
361 361
362 362 kwargs['pushed_revs'] = changesets
363 363 headers = {
364 364 'User-Agent': 'RhodeCode-SCM web hook',
365 365 'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
366 366 'Accept': 'text/javascript, text/html, application/xml, '
367 367 'text/xml, */*',
368 368 'Accept-Encoding': 'gzip,deflate,sdch',
369 369 }
370 370
371 371 data = kwargs
372 372 data = urllib.urlencode(data)
373 373 req = urllib2.Request(url, data, headers)
374 374 response = urllib2.urlopen(req)
375 375 response.read()
376 376 return 0
377 377
378 378
379 379 rhodecode-gist
380 380 --------------
381 381
382 382 Use this to create, list, show, or delete gists within |RCM|. Options:
383 383
384 384 .. rst-class:: dl-horizontal
385 385
386 386 \ - -api-cache-only
387 387 Requires a cache to be present when running this call
388 388
389 389 \ - -api-cache-rebuild
390 390 Replaces existing cached values with new ones from server
391 391
392 392 \ - -api-cache PATH
393 393 Use a special cache dir to read responses from instead of the server
394 394
395 395 \ - -api-cert-verify
396 396 Verify the endpoint ssl certificate
397 397
398 398 \ - -api-cert PATH
399 399 Path to alternate CA bundle.
400 400
401 401 \ - -apihost <api_host>
402 402 Set the API host value.
403 403
404 404 \ - -apikey <apikey_value>
405 405 Set the API key value.
406 406
407 407 \-c, - -config <config_file>
408 408 Create a configuration file.
409 409 The default file is created in :file:`~/.rhoderc`
410 410
411 411 \ - -create <gistname>
412 412 create the gist
413 413
414 414 \-d, - -description <str>
415 415 Set gist description
416 416
417 417 \ - -delete <gistid>
418 418 Delete the gist
419 419
420 420 \-f, - -file
421 421 Specify the filename The file extension will enable syntax highlighting.
422 422
423 423 \-F, - -format {json,pretty}
424 424 Set the formatted representation.
425 425
426 426 \ - -help
427 427 Show help messages.
428 428
429 429 \-I, - -install-dir <DIR>
430 430 Location of application instances
431 431
432 432 \ - -instance-name <instance-id>
433 433 Set the instance name.
434 434
435 435 \ - -list
436 436 Display instance gists.
437 437
438 438 \-l, --lifetime <minutes>
439 439 Set the gist lifetime. The default value is (-1) forever
440 440
441 441 \ - -show <gistname>
442 442 Show the content of the gist
443 443
444 444 \-o, - -open
445 445 After creating Gist open it in browser
446 446
447 447 \-p, - -private
448 448 Create a private gist
449 449
450 450 \ - -version
451 451 Display your |RCT| version.
452 452
453 453 Example usage:
454 454
455 455 .. code-block:: bash
456 456
457 457 # List the gists in an instance
458 458 (venv)brian@ubuntu:~$ rhodecode-gist --instance-name=enterprise-1 list
459 459 {
460 460 "error": null,
461 461 "id": 7102,
462 462 "result": [
463 463 {
464 464 "access_id": "2",
465 465 "content": null,
466 466 "created_on": "2015-01-19T12:52:26.494",
467 467 "description": "A public gust",
468 468 "expires": -1.0,
469 469 "gist_id": 2,
470 470 "type": "public",
471 471 "url": "http://127.0.0.1:10003/_admin/gists/2"
472 472 },
473 473 {
474 474 "access_id": "7gs6BsSEC4pKUEPLz5AB",
475 475 "content": null,
476 476 "created_on": "2015-01-19T11:27:40.812",
477 477 "description": "Gist testing API",
478 478 "expires": -1.0,
479 479 "gist_id": 1,
480 480 "type": "private",
481 481 "url": "http://127.0.0.1:10003/_admin/gists/7gs6BsSEC4pKUEPLz5AB"
482 482 }
483 483 ]
484 484 }
485 485
486 486 # delete a particular gist
487 487 # You use the access_id to specify the gist to delete
488 488 (venv)brian@ubuntu:~$ rhodecode-gist delete 2 --instance-name=enterprise-1
489 489 {
490 490 "error": null,
491 491 "id": 6284,
492 492 "result": {
493 493 "gist": null,
494 494 "msg": "deleted gist ID:2"
495 495 }
496 496 }
497 497
498 498 # cat a file and pipe to new gist
499 499 # This is if you are using virtualenv
500 500 (venv)$ cat ~/.rhoderc | rhodecode-gist --instance-name=enterprise-1 \
501 501 -d '.rhoderc copy' create
502 502
503 503 {
504 504 "error": null,
505 505 "id": 5374,
506 506 "result": {
507 507 "gist": {
508 508 "access_id": "7",
509 509 "content": null,
510 510 "created_on": "2015-01-26T11:31:58.774",
511 511 "description": ".rhoderc copy",
512 512 "expires": -1.0,
513 513 "gist_id": 7,
514 514 "type": "public",
515 515 "url": "http://127.0.0.1:10003/_admin/gists/7"
516 516 },
517 517 "msg": "created new gist"
518 518 }
519 519 }
520 520
521 521 # Cat a file and pipe to gist
522 522 # in RCE 3.5.0 tools and above
523 523 $ cat ~/.rhoderc | ~/.rccontrol/{instance-id}/profile/bin/rhodecode-gist \
524 524 --instance-name=enterprise-4 -d '.rhoderc copy' create
525 525 {
526 526 "error": null,
527 527 "id": 9253,
528 528 "result": {
529 529 "gist": {
530 530 "access_id": "4",
531 531 "acl_level": "acl_public",
532 532 "content": null,
533 533 "created_on": "2015-08-20T05:54:11.250",
534 534 "description": ".rhoderc copy",
535 535 "expires": -1.0,
536 536 "gist_id": 4,
537 537 "modified_at": "2015-08-20T05:54:11.250",
538 538 "type": "public",
539 539 "url": "http://127.0.0.1:10000/_admin/gists/4"
540 540 },
541 541 "msg": "created new gist"
542 542 }
543 543 }
544 544
545 545
546 546 rhodecode-index
547 547 ---------------
548 548
549 549 More detailed information regarding setting up the indexer is available in
550 550 the :ref:`indexing-ref` section. Options:
551 551
552 552 .. rst-class:: dl-horizontal
553 553
554 554 \ - -api-cache-only
555 555 Requires a cache to be present when running this call
556 556
557 557 \ - -api-cache-rebuild
558 558 Replaces existing cached values with new ones from server
559 559
560 560 \ - -api-cache PATH
561 561 Use a special cache dir to read responses from instead of the server
562 562
563 563 \ - -api-cert-verify
564 564 Verify the endpoint ssl certificate
565 565
566 566 \ - -api-cert PATH
567 567 Path to alternate CA bundle.
568 568
569 569 \ - -apihost <api_host>
570 570 Set the API host value.
571 571
572 572 \ - -apikey <apikey_value>
573 573 Set the API key value.
574 574
575 575 \-c, --config <config_file>
576 576 Create a configuration file.
577 577 The default file is created in :file:`~/.rhoderc`
578 578
579 579 \ - -create-mapping <PATH>
580 580 Creates an example mapping configuration for indexer.
581 581
582 582 \-F, - -format {json,pretty}
583 583 Set the formatted representation.
584 584
585 585 \-h, - -help
586 586 Show help messages.
587 587
588 588 \ - -instance-name <instance-id>
589 589 Set the instance name
590 590
591 591 \-I, - -install-dir <DIR>
592 592 Location of application instances
593 593
594 594 \-m, - -mapping <file_name>
595 595 Parse the output to the .ini mapping file.
596 596
597 597 \ - -optimize
598 598 Optimize index for performance by amalgamating multiple index files
599 599 into one. Greatly increases incremental indexing speed.
600 600
601 601 \-R, - -repo-dir <DIRECTORY>
602 602 Location of repositories
603 603
604 604 \ - -source <PATH>
605 605 Use a special source JSON file to feed the indexer
606 606
607 607 \ - -version
608 608 Display your |RCT| version.
609 609
610 610 Example usage:
611 611
612 612 .. code-block:: bash
613 613
614 614 # Run the indexer
615 615 $ ~/.rccontrol/enterprise-4/profile/bin/rhodecode-index \
616 616 --instance-name=enterprise-4
617 617
618 618 # Run indexer based on mapping.ini file
619 619 # This is using pre-350 virtualenv
620 620 (venv)$ rhodecode-index --instance-name=enterprise-1
621 621
622 622 # Index from the command line without creating
623 623 # the .rhoderc file
624 624 $ rhodecode-index --apikey=key --apihost=http://rhodecode.server \
625 625 --instance-name=enterprise-2 --save-config
626 626
627 627 # Create the indexing mapping file
628 628 $ ~/.rccontrol/enterprise-4/profile/bin/rhodecode-index \
629 629 --create-mapping mapping.ini --instance-name=enterprise-4
630 630
631 631 .. _tools-rhodecode-list-instance:
632 632
633 633 rhodecode-list-instances
634 634 ------------------------
635 635
636 636 Use this command to list the instance details configured in the
637 637 :file:`~/.rhoderc` file.
638 638
639 639 .. code-block:: bash
640 640
641 641 $ .rccontrol/enterprise-1/profile/bin/rhodecode-list-instances
642 642 [instance:production] - Config only
643 643 API-HOST: https://some.url.com
644 644 API-KEY: some.auth.token
645 645
646 646 [instance:development] - Config only
647 647 API-HOST: http://some.ip.address
648 648 API-KEY: some.auth.token
649 649
650 650
651 651 .. _tools-setup-config:
652 652
653 653 rhodecode-setup-config
654 654 ----------------------
655 655
656 656 Use this command to create the ``~.rhoderc`` file required by |RCT| to access
657 657 remote instances.
658 658
659 659 .. rst-class:: dl-horizontal
660 660
661 661 \- -instance-name <name>
662 662 Specify the instance name in the :file:`~/.rhoderc`
663 663
664 664 \api_host <hostname>
665 665 Create a configuration file. The default file is created
666 666 in ``~/.rhoderc``
667 667
668 668 \api_key <auth-token>
669 669 Create a configuration file. The default file is created
670 670 in ``~/.rhoderc``
671 671
672 672
673 673 .. code-block:: bash
674 674
675 675 (venv)$ rhodecode-setup-config --instance-name=tea api_host=URL api_key=xyz
676 676 Config not found under /Users/username/.rhoderc, creating a new one
677 677 Wrote new configuration into /Users/username/.rhoderc
General Comments 0
You need to be logged in to leave comments. Login now