TestEngineering/Web/Automation/Add Project to Jenkins

From MozillaWiki
Jump to: navigation, search

Adding a new project to Jenkins

• Adding a new project to Jenkins should always be done on Stage first, to test the process.

• Each project will have unique configurations

• Suggestion: Clone an existing repo that is similar to the one you are adding

• The following is an overview of the steps used when adding Treeherder as a project


1. Choose existing job > Clone it

- There is a difference between regular jobs and Saucelabs jobs

2. Click New Item

- Create a new name with the repo name and the test area

⁃ use all lowercase

⁃ ex: “treeherder.stage”

3. Select Copy existing item

⁃ Suggest: No need to add a description, select “discard old build”, select “100 builds”

⁃ Rarely select “concurrent builds”

4. Under “Source Code Management” > Git Repo > Add the URL of the GitHub repo

5. Build = Master

6. Additional Build = Wipe out repo + force clone

7. Build Triggers

⁃ To trigger periodically, once per day = “HH***”

⁃ Poll SCM = Polls for a change in the test repo, will run within 1 hour of a change

⁃ URL Trigger - Checks for a new deploy, different from a repo change

⁃ Build Environment - Config files with username and password, add to Jenkins

⁃ Check “Add timestamps”

⁃ Check “Inject environment variable” - setting path to VM to be default variable

8. Build

⁃ Ex: manage script - create VM

⁃ Ex: Managed - install infrastructure requirements

⁃ Ex: Shell - Check “VNS Bash, repository specifics, Base URL, and path to tests

⁃ Radio button Variable = only needed if tests have a subfolder [ex: desktop/mobile subfolders]

9. Post Build

⁃ Archive the artifacts

⁃ Publish HTML reports

⁃ Select “Keep past HTML”

⁃ Select “Always link to last build on job page”

⁃ Publish JUnit Test result report

⁃ Email Notification

10. IRC notification

⁃ Jenkins dashboard

⁃ Jenkins config

⁃ Configure system

⁃ Add IRC channel to list

⁃ ** Must have IRC channel in top level Jenkins configurations, can add this after creating a project

⁃ ** Adding a new IRC channel and saving often causes Jenkins to crash, and may need to be restarted

11. Allow Broken Build claiming

12. Create new tab [view]

⁃ View tabs > click the “+” on the right hand side of window > add repo name > select List View radio button

⁃ The View Config

⁃ Select “use regular expressions”

⁃ repo_name\..*

13. Add to Supported Projects list

⁃ Support Project Tab > Edit View > add job filter, all defaults