Skip to content

Instantly share code, notes, and snippets.

@csgavino
Forked from whistler/jenkins_rails_ubuntu.sh
Last active December 20, 2015 01:09
Show Gist options
  • Save csgavino/6047202 to your computer and use it in GitHub Desktop.
Save csgavino/6047202 to your computer and use it in GitHub Desktop.
sudo apt-get update
sudo apt-get install build-essential libssl-dev libreadline5 libreadline5-dev zlib1g zlib1g-dev sqlite3 libsqlite3-dev git-core
sudo apt-get install libxslt-dev libxml2-dev
# sudo apt-get install libmysqlclient-dev ruby-dev
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev
sudo apt-get install libreadline-dev
### Install Java ###
sudo apt-get 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 apt-get update
sudo apt-get install jenkins
sudo /etc/init.d/jenkins start
### Log in as Jenkins ###
sudo adduser jenkins admin
sudo passwd jenkins
sudo -Hiu jenkins
### Configure Apache ###
sudo aptitude 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 install mysql-server
### Configure Githhub ###
ssh-keygen
# copy over key to Github
git config --global user.name "Ibrahim Muhammad"
git config --global user.email "[email protected]"
ssh -T [email protected]
### 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 bundle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment