Skip to content

Instantly share code, notes, and snippets.

@nekoya
Created January 27, 2015 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nekoya/69b85981b34c8299293b to your computer and use it in GitHub Desktop.
Save nekoya/69b85981b34c8299293b to your computer and use it in GitHub Desktop.
Install Jenkins
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 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