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