#!/bin/bash set -x set -e # add ubuntu repos echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list echo "deb http://us.archive.ubuntu.com/ubuntu/ precise multiverse" >> /etc/apt/sources.list # replace init dpkg-divert --local --rename --add /sbin/initctl ln -s /bin/true /sbin/initctl apt-get -qy update apt-get install -qy curl git-core build-essential # add evrone repo mkdir -p /etc/apt/sources.list.d echo "deb http://download.opensuse.org/repositories/home:/dmexe/xUbuntu_12.04/ ./" > /etc/apt/sources.list.d/Evrone.list curl http://download.opensuse.org/repositories/home:/dmexe/xUbuntu_12.04/Release.key | apt-key add - apt-get -qy update # add packages apt-get install -qy libmysqlclient-dev libpq-dev imagemagick libmagickwand-dev \ libcurl4-openssl-dev nodejs postgresql-contrib-9.1 libxml2-dev libxslt-dev \ openjdk-7-jre-headless libsqlite3-dev libgeos-dev ruby # install runit chmod 0000 /sbin/start apt-get -qy install runit chmod 0755 /sbin/start # set user password useradd -m ci echo "ci:ci" | chpasswd apt-get -qy install sudo echo "ci ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers # fixes locales locale-gen en_US.UTF-8 dpkg-reconfigure -fnoninteractive locales update-locale LC_ALL="en_US.UTF-8" LANG="en_US.UTF-8" LANGUAGE="en_US" # install ssh apt-get install -qy openssh-server mkdir -p /var/run/sshd sv-gen ssh "/usr/sbin/sshd -D -e" # install postgresql apt-get install -qy postgresql echo "host all all all trust" > /etc/postgresql/9.1/main/pg_hba.conf sv-gen postgresql "/usr/lib/postgresql/9.1/bin/postgres -D /var/lib/postgresql/9.1/main -c config_file=/etc/postgresql/9.1/main/postgresql.conf" postgres # install mysql apt-get install -qy mysql-server sv-gen mysqld "/usr/sbin/mysqld" mysql # add ruby apt-get install -qy rbenv rbenv-2.0.0-p195 rbenv-1.9.3-p448 env RBENV_VERSION=2.0.0-p195 rbenv exec gem install bundler --no-ri --no-rdoc env RBENV_VERSION=1.9.3-p448 rbenv exec gem install bundler --no-ri --no-rdoc rbenv rehash apt-get -qy clean autoremove sv-enable postgresql sv-enable ssh