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:54] 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 | + | |
- | <code> | + | |
- | git clone ssh://YOU@gerrit.opnfv.org:29418/releng | + | |
- | </code> | + | |
- | + | ||
- | make changes | + | |
- | <code> | + | |
- | git commit -sv | + | |
- | git review | + | |
- | remote: Resolving deltas: 100% (3/3) | + | |
- | remote: Processing changes: new: 1, refs: 1, done | + | |
- | remote: | + | |
- | remote: New Changes: | + | |
- | remote: https://gerrit.opnfv.org/gerrit/51 | + | |
- | remote: | + | |
- | To ssh://agardner@gerrit.opnfv.org:29418/releng.git | + | |
- | * [new branch] HEAD -> refs/publish/master | + | |
- | </code> | + | |
- | + | ||
- | Follow the link to gerrit https://gerrit.opnfv.org/gerrit/51 | + | |
- | in a few moments the verify job will have completed and you will see | + | |
- | Verified +1 jenkins-ci | + | |
- | in the gerrit ui. | + | |
- | + | ||
- | 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 | + | |
- | + | ||
- | Eventually we can open this up so that more people can submit the patches. | + | |
- | + | ||
- | + | ||
- | Example: | + | |
- | Not sure if self explanatory. | + | |
- | + | ||
- | <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> | + | |
- | + | ||
- | + | ||