From b2076ffbf0ee9ad589a37bad8e12dcd64661b713 Mon Sep 17 00:00:00 2001 From: Gary Wu Date: Thu, 22 Jun 2017 13:29:06 -0700 Subject: Refactoring Change-Id: I6fdd372db4d8856853eb045033bd9dfbdcbea160 Signed-off-by: Gary Wu --- bootstrap/jenkins/vagrant/bootstrap.sh | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'bootstrap/jenkins/vagrant/bootstrap.sh') diff --git a/bootstrap/jenkins/vagrant/bootstrap.sh b/bootstrap/jenkins/vagrant/bootstrap.sh index f428cc1ff..7c7fe5eb2 100755 --- a/bootstrap/jenkins/vagrant/bootstrap.sh +++ b/bootstrap/jenkins/vagrant/bootstrap.sh @@ -1,7 +1,20 @@ -#!/bin/sh +#!/bin/bash + +function restart_jenkins() { + sudo systemctl restart jenkins + sleep 1 + echo -n "Restarting jenkins" + until $(curl --output /dev/null --silent --head --fail http://localhost:8080/login); do + printf '.' + sleep 3 + done + echo + sleep 1 +} sed -i 's|archive\.ubuntu\.com|mirrors.ocf.berkeley.edu|g' /etc/apt/sources.list +# Assume that the vagrant host is running a local Nexus proxy echo "192.168.33.1 nexus-proxy" >> /etc/hosts @@ -15,8 +28,8 @@ EOF apt-get update apt-get -y install git -git config --global user.email "gary.i.wu@huawei.com" -git config --global user.name "Gary Wu" +git config --global user.email "jenkins@localhost" +git config --global user.name "jenkins" apt-get -y install curl openjdk-8-jdk maven unzip # install Jenkins @@ -31,13 +44,11 @@ sudo usermod -aG docker jenkins su -l jenkins -c "/vagrant/jenkins-init-1.sh" -sudo systemctl restart jenkins -sleep 10 +restart_jenkins su -l jenkins -c "/vagrant/jenkins-init-2.sh" -sudo systemctl restart jenkins -sleep 10 +restart_jenkins su -l jenkins -c "/vagrant/jjb-init.sh" -- cgit 1.2.3-korg