2012-06-14 16:30:56 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# A simple script to verify that the XML output is unaltered after a change.
|
2012-08-10 10:02:51 -07:00
|
|
|
|
|
|
|
# First, symlink "config" to the directory containing your config files
|
|
|
|
# (eg openstack-ci-puppet/modules/openstack_project/files/jenkins_job_builder/config)
|
|
|
|
|
2012-06-14 16:30:56 -07:00
|
|
|
# Before you start work, run "./test.sh save".
|
|
|
|
# As you test your change, run "./test.sh" to see differences in XML output.
|
|
|
|
|
|
|
|
mkdir -p /tmp/jenkins_jobs_test/saved
|
|
|
|
mkdir -p /tmp/jenkins_jobs_test/test
|
|
|
|
|
|
|
|
if [ "$1" == "save" ]
|
|
|
|
then
|
2012-08-07 14:11:29 -07:00
|
|
|
rm -f /tmp/jenkins_jobs_test/saved/*
|
2012-08-10 10:02:51 -07:00
|
|
|
jenkins-jobs test -o /tmp/jenkins_jobs_test/saved/ config
|
2012-06-14 16:30:56 -07:00
|
|
|
else
|
2012-08-07 14:11:29 -07:00
|
|
|
rm -f /tmp/jenkins_jobs_test/test/*
|
2012-08-10 10:02:51 -07:00
|
|
|
jenkins-jobs test -o /tmp/jenkins_jobs_test/test/ config
|
2012-08-07 14:11:29 -07:00
|
|
|
for x in `(cd /tmp/jenkins_jobs_test/saved && find -type f)`
|
2012-06-14 16:30:56 -07:00
|
|
|
do
|
2012-08-07 14:11:29 -07:00
|
|
|
if ! diff -u /tmp/jenkins_jobs_test/saved/$x /tmp/jenkins_jobs_test/test/$x >/dev/null 2>&1
|
|
|
|
then
|
|
|
|
echo "============================================================"
|
|
|
|
echo $x
|
|
|
|
echo "------------------------------------------------------------"
|
|
|
|
fi
|
|
|
|
diff -u /tmp/jenkins_jobs_test/saved/$x /tmp/jenkins_jobs_test/test/$x
|
2012-06-14 16:30:56 -07:00
|
|
|
done
|
|
|
|
fi
|