Anastasia Kuznetsova 7c1054ec53 Fix automated job creation
- Splited installation of Jenkins anf JJB
- Changed JJB config
- Added switching to local Gerrit config

Change-Id: Iec04050b1ac3674329c9f0da60d852775d75fbbd
2016-06-07 13:45:51 +00:00

20 lines
529 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