Skip to content

Instantly share code, notes, and snippets.

@ryane
Created April 17, 2013 19:38
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ryane/5407113 to your computer and use it in GitHub Desktop.
Save ryane/5407113 to your computer and use it in GitHub Desktop.
A script (or just list of commands) to setup a jenkins server on Ubuntu 12.04 hosted at linode. Liberally borrowed from https://gist.github.com/whistler/3179919#file-jenkins_rails_ubuntu-sh
sudo aptitude -y install build-essential libssl-dev libreadline5 libreadline5-dev zlib1g zlib1g-dev
sudo apt-get -y install libxslt-dev libxml2-dev
sudo apt-get -y install libmysqlclient-dev ruby-dev
sudo apt-get -y install libcurl4-openssl-dev
sudo apt-get -y install imagemagick libmagickcore-dev libmagickwand-dev
sudo apt-get -y install libsqlite3-dev
sudo apt-get -y install libreadline-dev
sudo apt-get -y install git
sudo apt-get -y install libicu48
sudo apt-get -y install nodejs
sudo apt-get -y install redis-server
sudo apt-get -y install zsh
sudo apt-get -y install ack
### Install Phantomjs
sudo apt-get -y install phantomjs
### Install Java ###
sudo apt-get -y install openjdk-6-jre-headless
### Install Jenkins ###
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo aptitude -y update
sudo aptitude -y install jenkins
sudo /etc/init.d/jenkins start
### Log in as Jenkins ###
sudo adduser jenkins
sudo passwd jenkins
sudo -Hiu jenkins
### Configure Apache ###
sudo aptitude -y install apache2
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod vhost_alias
sudo a2dissite default
sudo touch /etc/apache2/sites-available/jenkins
sudo echo "<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName *
ServerAlias ci
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPreserveHost on
ProxyPass / http://localhost:8080/
</VirtualHost>" > /etc/apache2/sites-available/jenkins
sudo a2ensite jenkins
sudo apache2ctl restart
### Install MySQL ###
sudo apt-get -y install mysql-server
### Install Postgresql
sudo apt-get -y install postgresql postgresql-contrib
sudo apt-get -y install libpq-dev
### Configure Githhub ###
ssh-keygen
# copy over key to Github
git config --global user.name "ryane"
git config --global user.email "ryanesc@gmail.com"
ssh -T git@github.com
### Install rbenv ###
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> .bash_profile
echo 'eval "$(rbenv init -)"' >> .bash_profile
source ~/.bash_profile
############ Install ruby-build ############
pushd /tmp
git clone git://github.com/sstephenson/ruby-build.git
cd ruby-build
sudo ./install.sh
popd
### Install Ruby ###
CONFIGURE_OPTS="--with-readline-dir=/usr/include/readline"
rbenv install 1.9.3-p194
rbenv global 1.9.3-p194
rbenv local 1.9.3-p194
gem install bundler
### Install Heroku Toolbelt
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment