diff options
author | Gary Wu <gary.i.wu@huawei.com> | 2017-06-22 13:29:06 -0700 |
---|---|---|
committer | Gary Wu <gary.i.wu@huawei.com> | 2017-06-22 13:29:06 -0700 |
commit | b2076ffbf0ee9ad589a37bad8e12dcd64661b713 (patch) | |
tree | 3feabdf4a818ac5881e8a2ceabe1e6ff48f52cc4 /bootstrap/jenkins/vagrant/bootstrap.sh | |
parent | 7c203d3202eb75493e2d2218b015f114cd14f025 (diff) |
Refactoring
Change-Id: I6fdd372db4d8856853eb045033bd9dfbdcbea160
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'bootstrap/jenkins/vagrant/bootstrap.sh')
-rwxr-xr-x | bootstrap/jenkins/vagrant/bootstrap.sh | 25 |
1 files changed, 18 insertions, 7 deletions
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" |