Skip to content

Instantly share code, notes, and snippets.

@salvatoretrimarchi
Forked from nekoya/install_jenkins.sh
Created September 3, 2018 16:37
Show Gist options
  • Save salvatoretrimarchi/9d4ab71519a92eb3777615913d63e1c3 to your computer and use it in GitHub Desktop.
Save salvatoretrimarchi/9d4ab71519a92eb3777615913d63e1c3 to your computer and use it in GitHub Desktop.
Install Jenkins
#Ubuntu Xenial
if [ ! -f /etc/init.d/jenkins ];then
curl -L http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
echo "deb http://pkg.jenkins-ci.org/debian binary/" > /etc/apt/sources.list.d/jenkins.list
apt-get -y update
apt-get install -y openjdk-8-jdk jenkins
# wait jenkins http port
echo "wait Jenkins service "
while [ "`netstat -tunl|grep 8080`" = "" ];do echo -n "."; sleep 1; done
echo " ok"
# download jenkins-cli
echo -n "downloading jenkins-cli.jar "
while [ ! -f jenkins-cli.jar ]; do
echo -n "."
sleep 1
wget -q http://localhost:8080/jnlpJars/jenkins-cli.jar
done
echo " ok"
# update center
curl -L http://updates.jenkins-ci.org/update-center.json | sed '1d;$d' | curl -X POST -H "Accept: application/json" -d @- http://localhost:8080/updateCenter/byId/default/postBack
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment