# Test every definition if available in the current repository and update the jobs
# if they do define one (they should always define their definitions)
for dir in `ls .`; do
- if [[ -d $dir/config ]] && [[ -f $dir/config/definitions ]]; then
+ definitions_dir="$dir/config/definitions"
+ if [ -d "$definitions_dir" ]; then
+ echo "found definitions directory: $definitions_dir"
+
# Test the definitions first
- venv/bin/jenkins-jobs test $dir/config/definitions -o /tmp/output
+ venv/bin/jenkins-jobs test $definitions_dir -o /tmp/output
# Update Jenkins with the output if they passed the test phase
# Note that this needs proper permissions with the right credentials to the
# correct Jenkins instance.
- venv/bin/jenkins-jobs update $dir/config/definitions
+ venv/bin/jenkins-jobs update $definitions_dir
fi
done