Skip to content

Instantly share code, notes, and snippets.

@mhakeem
Forked from whistler/jenkins_rails_ubuntu.sh
Created March 27, 2014 20:46
Show Gist options
  • Select an option

  • Save mhakeem/9818255 to your computer and use it in GitHub Desktop.

Select an option

Save mhakeem/9818255 to your computer and use it in GitHub Desktop.

Revisions

  1. Ibrahim Muhammad created this gist Jul 26, 2012.
    87 changes: 87 additions & 0 deletions jenkins_rails_ubuntu.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,87 @@
    sudo aptitude install build-essential libssl-dev libreadline5 libreadline5-dev zlib1g zlib1g-dev
    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 libsqlite3-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 aptitude update
    sudo aptitude 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 "ibrahim@ven.io"
    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 bundle