Difference between revisions of "Jenkins Sandbox"

From fd.io
Jump to: navigation, search
(Jenkins Sandbox)
 
(8 intermediate revisions by one other user not shown)
Line 1: Line 1:
'''Jenkins Sandbox'''
+
=Jenkins Sandbox=
  
The purpose of the [https://jenkins.fd.io/sandbox/ jenkins-sandbox] is to allow projects to test their JJB setups before merging. It is configured similarly to the master instance, although it cannot publish artifacts or vote in Gerrit.
+
The purpose of the Jenkins sandbox is to allow projects to test their JJB setups before merging. It is configured similarly to production, although it cannot publish artifacts or vote in Gerrit
  
To request access to the sandbox please open a ticket at support.linuxfoundation.org. Please provide your LFID and email address.
+
'''Jenkins Sandbox URL'''
 +
https://jenkins.fd.io/sandbox/
  
'''Notes Regarding the Sandbox'''
+
'''Jenkins Sandbox Documentation URL'''
 +
https://docs.releng.linuxfoundation.org/en/latest/jenkins-sandbox.htm
 +
 
 +
To request access to the sandbox please open a ticket at support.linuxfoundation.org. Please provide your LFID and email address
 +
 
 +
===Notes Regarding the Sandbox===
 
*Jobs are automatically deleted every Saturday at 08:00 UTC<br>
 
*Jobs are automatically deleted every Saturday at 08:00 UTC<br>
 
*Committers can log in and configure Jenkins jobs in the sandbox directly<br>
 
*Committers can log in and configure Jenkins jobs in the sandbox directly<br>
 
*The Sandbox configuration mirrors production wherever possible<br>
 
*The Sandbox configuration mirrors production wherever possible<br>
 
*Sandbox jobs can NOT be trigged via Gerrit<br>
 
*Sandbox jobs can NOT be trigged via Gerrit<br>
*Sandbox verify jobs need the Refspec configured<br>
+
*Verify jobs need the Refspec configured<br>
 
*Sandbox jobs can NOT upload artifacts to Nexus<br>
 
*Sandbox jobs can NOT upload artifacts to Nexus<br>
 
*Sandbox jobs can NOT vote on Gerrit<br>
 
*Sandbox jobs can NOT vote on Gerrit<br>
  
'''Configuration'''
+
==Support==
Make sure you have the correct version of JJB installed.
+
For issues with the sandbox please open a ticket at support.linuxfoundation.org
  
JJB reads user-specific configuration from a jenkins.ini in the top-level ci-management directory.
+
==Configuration==
 +
Make sure you have the correct version of JJB installed
  
 +
JJB reads user-specific configuration from a jenkins.ini in the top-level ci-management directory
  
 
  [job_builder]
 
  [job_builder]
Line 27: Line 35:
 
  [jenkins]
 
  [jenkins]
 
  user=<LFID>
 
  user=<LFID>
  password=<Jenkins token>
+
  password=<Jenkins API token>
 
  url=https://jenkins.fd.io/sandbox
 
  url=https://jenkins.fd.io/sandbox
 
  query_plugins_info=False
 
  query_plugins_info=False
 +
 +
===API token===
 +
*Log into Jenkins '''sandbox'''
 +
*Click the arrow next to your username then click Configure
 +
*Click Add new Token
 +
 +
==Testing Jobs==
 +
It’s good practice to use the test command to validate your JJB files before pushing them
 +
 +
jenkins-jobs --conf jenkins.ini target jjb/ <job-name>
 +
 +
Successful tests output the XML description of the Jenkins job described by the specified JJB job name
 +
 +
==Pushing jobs==
 +
Once you’ve verified your JJB jobs produce valid XML descriptions of Jenkins jobs you can push them to the Jenkins sandbox.
 +
 +
When pushing with jenkins-jobs, a log message with the number of jobs you’re pushing will be issued, typically to stdout. If the number is greater than 1 (or greater than the number of jobs you passed to the command to push) then you are pushing too many jobs and should `ctrl+c` to cancel the upload.
 +
 +
INFO:jenkins_jobs.builder:Number of jobs generated:  1
 +
 +
'''To push specific jobs to the sandbox run'''
 +
jenkins-jobs --conf jenkins.ini update jjb/ <job-name>
 +
 +
'''Failing to provide the final `<job-name>` param will push all jobs'''
 +
 +
==Running jobs==
 +
To run a job on the sandbox
 +
*Click the job name
 +
*Click Build with Parameters
 +
*Click Build

Latest revision as of 19:01, 9 June 2020

Jenkins Sandbox

The purpose of the Jenkins sandbox is to allow projects to test their JJB setups before merging. It is configured similarly to production, although it cannot publish artifacts or vote in Gerrit

Jenkins Sandbox URL https://jenkins.fd.io/sandbox/

Jenkins Sandbox Documentation URL https://docs.releng.linuxfoundation.org/en/latest/jenkins-sandbox.htm

To request access to the sandbox please open a ticket at support.linuxfoundation.org. Please provide your LFID and email address

Notes Regarding the Sandbox

  • Jobs are automatically deleted every Saturday at 08:00 UTC
  • Committers can log in and configure Jenkins jobs in the sandbox directly
  • The Sandbox configuration mirrors production wherever possible
  • Sandbox jobs can NOT be trigged via Gerrit
  • Verify jobs need the Refspec configured
  • Sandbox jobs can NOT upload artifacts to Nexus
  • Sandbox jobs can NOT vote on Gerrit

Support

For issues with the sandbox please open a ticket at support.linuxfoundation.org

Configuration

Make sure you have the correct version of JJB installed

JJB reads user-specific configuration from a jenkins.ini in the top-level ci-management directory

[job_builder]
ignore_cache=True
keep_descriptions=False
include_path=.
recursive=True
[jenkins]
user=<LFID>
password=<Jenkins API token>
url=https://jenkins.fd.io/sandbox
query_plugins_info=False

API token

  • Log into Jenkins sandbox
  • Click the arrow next to your username then click Configure
  • Click Add new Token

Testing Jobs

It’s good practice to use the test command to validate your JJB files before pushing them

jenkins-jobs --conf jenkins.ini target jjb/ <job-name>

Successful tests output the XML description of the Jenkins job described by the specified JJB job name

Pushing jobs

Once you’ve verified your JJB jobs produce valid XML descriptions of Jenkins jobs you can push them to the Jenkins sandbox.

When pushing with jenkins-jobs, a log message with the number of jobs you’re pushing will be issued, typically to stdout. If the number is greater than 1 (or greater than the number of jobs you passed to the command to push) then you are pushing too many jobs and should `ctrl+c` to cancel the upload.

INFO:jenkins_jobs.builder:Number of jobs generated:  1

To push specific jobs to the sandbox run

jenkins-jobs --conf jenkins.ini update jjb/ <job-name>

Failing to provide the final `<job-name>` param will push all jobs

Running jobs

To run a job on the sandbox

  • Click the job name
  • Click Build with Parameters
  • Click Build