Lets create another job called extended_tests on Jenkins. Purpose of this job is to run a set of test cases (in our case, set will contain only one test) whenever new commit arrives on gerrit.
- Go to Jenkins address.
New-Item --> Freestyle-Project. - Under Build-Trigger. Check "gerrit event".
- Use builder under project name. And master under Branches.
- Under "Build" --> Execute Shell, Add following script
echo "USER=$USER, HOME=$HOME, WORKSPACE=$WORKSPACE, REFSPEC=$GERRIT_REFSPEC" cd ${WORKSPACE} git clone http://jenkins1@10.10.0.19:8080/builder && scp -p -P 29418 jenkins1@10.10.0.19:hooks/commit-msg builder/.git/hooks/ cd builder bash job_script.sh
- Commit a patchset on builder.
- You will see that a pipeline will get triggered automatically.
NOTE: You might need to install Workspace Cleanup Plugin to jenkins.
No comments:
Post a Comment