3 # Copyright 2017 Huawei Technologies Co., Ltd.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
12 function restart_jenkins() {
13 sudo systemctl restart jenkins
15 echo -n "Restarting jenkins"
16 until $(curl --output /dev/null --silent --head --fail http://localhost:8080/login); do
24 sed -i 's|archive\.ubuntu\.com|mirrors.ocf.berkeley.edu|g' /etc/apt/sources.list
26 # Assume that the vagrant host is running a local Nexus proxy
27 echo "192.168.33.1 nexus-proxy" >> /etc/hosts
30 cat >> /etc/inputrc <<EOF
31 set show-all-if-ambiguous on
32 set show-all-if-unmodified on
33 set match-hidden-files off
34 set mark-symlinked-directories on
39 apt-get -y install git
40 git config --global user.email "jenkins@localhost"
41 git config --global user.name "jenkins"
42 apt-get -y install curl openjdk-8-jdk-headless maven unzip python-pip
45 wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
46 sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
48 apt-get -y install jenkins
51 apt-get -y install docker.io
52 sudo usermod -aG docker jenkins
54 su -l jenkins -c "/vagrant/jenkins-init-1.sh"
58 su -l jenkins -c "/vagrant/jenkins-init-2.sh"
62 su -l jenkins -c "/vagrant/jjb-init.sh"