Sergey Kraynev 805c2cef0e Fix errors reported by shellcheck for Gerrit and Jenkins
Change-Id: Ia383b6e788429fc3170d0362afded8f3bc43e61f
2016-08-08 16:37:54 +00:00

20 lines
532 B
Bash

#!/bin/bash
cd /etc/project-config
# Check whether we have local Gerrit installed or not.
# If yes, then 'git pull' should be executed under 'jenkins' user
GERRIT_URL=$(hiera -c /etc/puppet/hiera.yaml gerrit_host)
if [ "$GERRIT_URL" != "nil" ]; then
echo "Pulling changes from installed Gerrit"
su jenkins -c "git pull"
else
echo "Pulling changes from upsteam Gerrit"
git pull
fi
cp -R /etc/project-config/jenkins/jobs/* /etc/jenkins_jobs/config
/usr/local/bin/jenkins-jobs update --delete-old /etc/jenkins_jobs/config