This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
octopus:jenkins_wow [2015/02/20 19:50] Aric Gardner |
octopus:jenkins_wow [2015/04/21 09:16] (current) Ulrich Kleber Switch to use generated document |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== How to Work With Jenkins ====== | + | {{scrape>http://artifacts.opnfv.org/octopus/docs/opnfv-jjb-usage.html}} |
| - | + | ||
| - | ===== Creating/Configuring/Verifying Jenkins Jobs ===== | + | |
| - | + | ||
| - | Clone the repo | + | |
| - | git clone ssh://YOU@gerrit.opnfv.org:29418/releng | + | |
| - | make changes | + | |
| - | git commit -sv | + | |
| - | git review | + | |
| - | if the changes pass the verify job https://build.opnfv.org/ci/view/builder/job/builder-verify-jjb/ | + | |
| - | email Aric and ask him to "submit" your patch -> opnfv-helpdesk@rt.linuxfoundation.org | + | |
| - | + | ||
| - | Examples: | + | |
| - | + | ||
| - | <code> | + | |
| - | - project: | + | |
| - | name: genesis | + | |
| - | jobs: | + | |
| - | - 'genesis-test' | + | |
| - | - 'genesis-daily-master' | + | |
| - | - 'genesis-merge' | + | |
| - | - 'genesis-verify' | + | |
| - | + | ||
| - | # stream: branch with - in place of / (eg. stable-helium) | + | |
| - | # branch: branch (eg. stable/helium) | + | |
| - | stream: | + | |
| - | - master: | + | |
| - | branch: 'master' | + | |
| - | + | ||
| - | project: 'genesis' | + | |
| - | somevar: 'foo' | + | |
| - | + | ||
| - | - job-template: | + | |
| - | name: genesis-test | + | |
| - | + | ||
| - | project-type: freestyle | + | |
| - | + | ||
| - | logrotate: | + | |
| - | daysToKeep: 30 | + | |
| - | numToKeep: 10 | + | |
| - | artifactDaysToKeep: -1 | + | |
| - | artifactNumToKeep: -1 | + | |
| - | + | ||
| - | builders: | + | |
| - | - shell: | | + | |
| - | echo "Hello world from genesis" | + | |
| - | + | ||
| - | - job-template: | + | |
| - | name: 'genesis-daily-master' | + | |
| - | + | ||
| - | # Job template for daily builders | + | |
| - | # | + | |
| - | # Required Variables: | + | |
| - | # stream: branch with - in place of / (eg. stable) | + | |
| - | # branch: branch (eg. stable) | + | |
| - | + | ||
| - | project-type: freestyle | + | |
| - | varsetabove: '{somevar}' | + | |
| - | + | ||
| - | logrotate: | + | |
| - | daysToKeep: '{build-days-to-keep}' | + | |
| - | numToKeep: '{build-num-to-keep}' | + | |
| - | artifactDaysToKeep: '{build-artifact-days-to-keep}' | + | |
| - | artifactNumToKeep: '{build-artifact-num-to-keep}' | + | |
| - | + | ||
| - | wrappers: | + | |
| - | - ssh-agent-credentials: | + | |
| - | user: '{ssh-credentials}' | + | |
| - | + | ||
| - | triggers: | + | |
| - | - timed: 'H H * * *' | + | |
| - | + | ||
| - | prebuilders: | + | |
| - | - test-macro | + | |
| - | + | ||
| - | builders: | + | |
| - | - shell: | | + | |
| - | echo "Hello world from genesis {somevar} daily" | + | |
| - | - test-macro | + | |
| - | + | ||
| - | postbuilders: | + | |
| - | - test-macro | + | |
| - | + | ||
| - | - job-template: | + | |
| - | name: 'genesis-verify' | + | |
| - | + | ||
| - | project-type: freestyle | + | |
| - | node: fuel | + | |
| - | + | ||
| - | logrotate: | + | |
| - | daysToKeep: 30 | + | |
| - | numToKeep: 10 | + | |
| - | artifactDaysToKeep: -1 | + | |
| - | artifactNumToKeep: -1 | + | |
| - | + | ||
| - | parameters: | + | |
| - | - project-parameter: | + | |
| - | project: '{project}' | + | |
| - | - gerrit-parameter: | + | |
| - | branch: 'master' | + | |
| - | scm: | + | |
| - | - gerrit-trigger-scm: | + | |
| - | credentials-id: '{ssh-credentials}' | + | |
| - | refspec: '$GERRIT_REFSPEC' | + | |
| - | choosing-strategy: 'gerrit' | + | |
| - | + | ||
| - | wrappers: | + | |
| - | - ssh-agent-credentials: | + | |
| - | user: '{ssh-credentials}' | + | |
| - | + | ||
| - | triggers: | + | |
| - | - gerrit: | + | |
| - | trigger-on: | + | |
| - | - patchset-created-event: | + | |
| - | exclude-drafts: 'false' | + | |
| - | exclude-trivial-rebase: 'false' | + | |
| - | exclude-no-code-change: 'false' | + | |
| - | - draft-published-event | + | |
| - | - comment-added-contains-event: | + | |
| - | comment-contains-value: 'recheck' | + | |
| - | projects: | + | |
| - | - project-compare-type: 'ANT' | + | |
| - | project-pattern: 'genesis' | + | |
| - | branches: | + | |
| - | - branch-compare-type: 'ANT' | + | |
| - | branch-pattern: '**/master' | + | |
| - | file-paths: | + | |
| - | - compare-type: ANT | + | |
| - | pattern: jjb/** | + | |
| - | - compare-type: ANT | + | |
| - | pattern: jjb-templates/** | + | |
| - | + | ||
| - | builders: | + | |
| - | - shell: | | + | |
| - | verifyscript.foo | + | |
| - | + | ||
| - | + | ||
| - | - job-template: | + | |
| - | name: 'genesis-merge' | + | |
| - | + | ||
| - | # builder-merge job to run JJB update | + | |
| - | # | + | |
| - | # This job's purpose is to update all the JJB | + | |
| - | + | ||
| - | project-type: freestyle | + | |
| - | node: fuel | + | |
| - | + | ||
| - | logrotate: | + | |
| - | daysToKeep: 30 | + | |
| - | numToKeep: 40 | + | |
| - | artifactDaysToKeep: -1 | + | |
| - | artifactNumToKeep: 5 | + | |
| - | + | ||
| - | parameters: | + | |
| - | - project-parameter: | + | |
| - | project: '{project}' | + | |
| - | - gerrit-parameter: | + | |
| - | branch: 'master' | + | |
| - | + | ||
| - | scm: | + | |
| - | - gerrit-trigger-scm: | + | |
| - | credentials-id: '{ssh-credentials}' | + | |
| - | refspec: '' | + | |
| - | choosing-strategy: 'default' | + | |
| - | + | ||
| - | wrappers: | + | |
| - | - ssh-agent-credentials: | + | |
| - | user: '{ssh-credentials}' | + | |
| - | + | ||
| - | triggers: | + | |
| - | - gerrit: | + | |
| - | trigger-on: | + | |
| - | - change-merged-event | + | |
| - | - comment-added-contains-event: | + | |
| - | comment-contains-value: 'remerge' | + | |
| - | projects: | + | |
| - | - project-compare-type: 'ANT' | + | |
| - | project-pattern: 'genesis' | + | |
| - | branches: | + | |
| - | - branch-compare-type: 'ANT' | + | |
| - | branch-pattern: '**/master' | + | |
| - | file-paths: | + | |
| - | - compare-type: ANT | + | |
| - | pattern: jjb/** | + | |
| - | + | ||
| - | builders: | + | |
| - | - shell: | | + | |
| - | hostname | + | |
| - | whoami | + | |
| - | docker --version | + | |
| - | cd fuel-build/docker | + | |
| - | pwd | + | |
| - | echo foo | + | |
| - | make clean || true | + | |
| - | make | + | |
| - | cd .. | + | |
| - | echo foo | + | |
| - | make clean || true | + | |
| - | sed -i -Ee 's,\ \-t,,g' docker/runcontext | + | |
| - | make all | + | |
| - | </code> | + | |
| - | + | ||
| - | + | ||