Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Job templates should be tested by creating jobs in the Jenkins sandbox, then executing the jobs against a branch of the repository, the master branch or any change set (review) branch can be used.  Jobs can be created in one of two ways:

...

Let Jenkins create jobs

...

Post a comment "jjb-deploy" on your change set submitted to the ci-management repo. This creates a request for the primary Jenkins server to create new jobs in the sandbox. Be patient if you choose this route. The comment takes this form:

Code Block
jjb-deploy your-job-name*

The argument is a simple shell-style globbing pattern to limit the scope.  This example should create all jobs that start with the prefix "your-job-name".


Create jobs directly

You can create jobs directly at the Sandbox from a personal computer. This allows rapid edit/test cycles. To do this:

  • Request username and password at the Jenkins sandbox
  • Install the Python package jenkins-job-builder (version 3.2.0 as of this writing)
  • Create a jenkins.ini configuration file with credentials
  • Test the templates locally: jenkins-jobs test -r jjb > /dev/null
  • Create jobs: jenkins-jobs --conf jenkins.ini update -r jjb

...

You can create jobs directly at the Sandbox from a personal computer. This allows rapid edit/test cycles. To do this:

  • Install the Python package jenkins-job-builder (version 3.2.0 as of this writing)
  • Create a configuration file with credentials
  • Test the templates locally: jenkins-jobs test -r jjb > /dev/null
  • Create jobs: jenkins-jobs --conf jenkins.ini update -r jjb YOUR_JOB_NAME > /dev/null

Let Jenkins create jobs

Alternately, post a special comment in the change set for ci-management to request the primary Jenkins server create new jobs in the sandbox. Be patient if you choose this route. The comment takes this form:

Code Block
jjb-deploy your-job-name*

...

Sample jenkins.ini file:

Code Block
[job_builder]
ignore_cache=True
keep_descriptions=False
recursive=True
update=jobs

[jenkins]
query_plugins_info=False
url=https://jenkins.o-ran-sc.org/sandbox
user=your-sandbox-user-name
password=your-sandbox-api-token