e53a05ac39
Adds default Openstack jobs for a given project name into Jenkins To envoke add a section as follows to your site manifest: class { "jenkins_jobs": site => "openstack", projects => ["project1", "project2"] } Now using xml building blocks! Change-Id: If4cacba91d3dc22207e53413543e5bcfcfb0b541
32 lines
828 B
Plaintext
32 lines
828 B
Plaintext
<hudson.tasks.Shell>
|
|
<command>#!/bin/bash -xe
|
|
|
|
if [ -z "$GERRIT_NEWREV" ] && [ -z "$GERRIT_REFSPEC" ]
|
|
then
|
|
echo "This job may only be triggered by Gerrit."
|
|
exit 1
|
|
fi
|
|
|
|
if [[ ! -e .git ]]
|
|
then
|
|
git clone https://review.<%= site %>.org/p/$GERRIT_PROJECT .
|
|
fi
|
|
git remote update || git remote update # attempt to work around bug #925790
|
|
git reset --hard
|
|
git clean -x -f -d -q
|
|
|
|
if [ ! -z "$GERRIT_REFSPEC" ]
|
|
then
|
|
git checkout $GERRIT_BRANCH
|
|
git reset --hard remotes/origin/$GERRIT_BRANCH
|
|
git clean -x -f -d -q
|
|
git fetch https://review.<%= site %>.org/p/$GERRIT_PROJECT $GERRIT_REFSPEC
|
|
git merge FETCH_HEAD
|
|
else
|
|
git checkout $GERRIT_NEWREV
|
|
git reset --hard $GERRIT_NEWREV
|
|
git clean -x -f -d -q
|
|
fi
|
|
</command>
|
|
</hudson.tasks.Shell>
|