jenkins-job-builder/tools/test.sh
James E. Blair ab7c6bc6c1 Add documentation.
Move test.sh to the tools directory.
Move parameters and notifications to their own modules; even
though they are implemented as Jenkins properties, they make
more sense as separate entities in the job builder, because
that's they way they are specified in the YAML.  All three
modules that touch the properties xml object know how to
create it if it's missing.

Change-Id: I4b42ff10a93fd3ed98f632b58e47f3e0e45086d6
Reviewed-on: https://review.openstack.org/12741
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2012-09-17 20:25:38 +00:00

32 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# A simple script to verify that the XML output is unaltered after a change.
# First, symlink "config" to the directory containing your config files
# (eg openstack-ci-puppet/modules/openstack_project/files/jenkins_job_builder/config)
# 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
rm -f /tmp/jenkins_jobs_test/saved/*
jenkins-jobs test -o /tmp/jenkins_jobs_test/saved/ config
else
rm -f /tmp/jenkins_jobs_test/test/*
jenkins-jobs test -o /tmp/jenkins_jobs_test/test/ config
for x in `(cd /tmp/jenkins_jobs_test/saved && find -type f)`
do
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
done
fi