Use this configuration if you prefer to use the JJB tool locally on your system.
-After getting access to the Sandbox group, configure the following.
+Configure the file ``~/.config/jenkins_jobs/jenkins_jobs.ini`` as follows:
-Create a jenkins.ini with the following contents modifying the relevant data:
-
-Example::
-
- ;<jenkins.ini contents>
+.. code-block:: none
+ :caption: ~/.config/jenkins_jobs/jenkins_jobs.ini
[job_builder]
ignore_cache=True
retain_anchors=True
[jenkins]
- user-id=<Provide your Jenkins Sandbox user-id (LFID)>
+ user=<Provide your Jenkins Sandbox user-id (LFID)>
password= <Refer below steps to get API token>
- url=https://jenkins.<project-domain>/sandbox
- ignore_cache=True
+ url=https://jenkins.example.org/sandbox
+
+.. note::
+
+ The [jenkins] section is the default configuration section that JJB will
+ refer to when calling ``jenkins-jobs`` without passing the ``-s | --server``
+ option. If you work on more than one Jenkins system then configure sections
+ like [odl], [opnfv], [onap], etc... and pass ``jenkins-jobs -s odl`` to make
+ it convenient to switch projects.
How to retrieve API token?
-Login to the Jenkins Sandbox using your LFID, go to the user page by clicking on
-your username. Click Configure and then click Show API Token.
+
+#. Login to the Jenkins Sandbox using your LFID
+#. Go to the user page by clicking on your username on the top right
+#. Click ``Configure``
+#. Click ``Show API Token``
To start using the Sandbox, we must do a clone of ci-management or releng/builder
(in case of ODL) repo for the project.
.. code-block:: bash
- jenkins-jobs --conf jenkins.ini test jjb/ <job-name>
+ jenkins-jobs test jjb/ <job-name>
For Example:
.. code-block:: bash
- jenkins-jobs --conf jenkins.ini test jjb/ ci-management-jjb-merge
+ jenkins-jobs test jjb/ ci-management-jjb-merge
If the job you would like to test is a template with variables in its name, it
must be manually expanded before use. For example, the commonly used template
.. code-block:: bash
- jenkins-jobs --conf jenkins.ini update jjb/ <job-name>
+ jenkins-jobs update jjb/ <job-name>
For Example:
.. code-block:: bash
- jenkins-jobs --conf jenkins.ini update jjb/ ci-management-jjb-merge
+ jenkins-jobs update jjb/ ci-management-jjb-merge
Delete a Job
^^^^^^^^^^^^
.. code-block:: bash
- jenkins-jobs --conf jenkins.ini delete jjb/ <job-name>
+ jenkins-jobs delete jjb/ <job-name>
For Example:
.. code-block:: bash
- jenkins-jobs --conf jenkins.ini delete jjb/ ci-management-jjb-merge
+ jenkins-jobs delete jjb/ ci-management-jjb-merge
You can also delete the job from the UI options in Jenkins Sandbox.