Skip to content

Instantly share code, notes, and snippets.

Last active Jan 8, 2017
What would you like to do?
Install Jenkins on server
# A simple script to install jenkins on debian/ubuntu
# Tested on a new Debian 8 DreamCompute image from Dreamhost.
sudo apt-get update
sudo apt-get install --force-yes -y apt-transport-https wget openjdk-8-jdk git subversion ca-certificates-java vim authbind binfmt-support
wget -q -O - | sudo apt-key add -
echo "deb binary/" > /etc/apt/sources.list.d/jenkins.list
sudo apt-get update
sudo apt-get install -y jenkins
# The following will set jenkins up to work on port 80. Simple and stupid
sed -i 's/JAVA=\/usr\/bin\/java/JAVA=\"authbind \/usr\/bin\/java\"/g' /etc/default/jenkins
sed -i 's/HTTP_PORT=8080/HTTP_PORT=80/g' /etc/default/jenkins
chmod 500 $AUTHBIND_PORT
chown jenkins $AUTHBIND_PORT
# Setup a few needed things in the environment for the debian pbuilder to work
cat > /etc/sudoers.d/jenkins << EOF
jenkins ALL=NOPASSWD: /usr/sbin/cowbuilder, /usr/sbin/chroot
Defaults env_keep+="DEB_* DIST ARCH"
# note: must install cowbuilder manually, pbuilder prompts for input
sudo apt-get install -y qemu-user-static devscripts
sudo systemctl restart jenkins
# After install, run this:
# sudo apt-get install cowbuilder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment