From 52aedbca578ac037d763f6de5e0c6953ae15ec97 Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Tue, 9 Aug 2016 16:28:28 -0400 Subject: [PATCH] Moved rvm setup to provisioning --- .gitignore | 2 ++ README.rdoc | 4 +--- Vagrantfile | 6 +++++- setup/Vagrant Windows Instructions.txt | 4 +--- setup/build.sh | 22 ++++++++++------------ setup/other-user-setup.sh | 2 ++ setup/ruby-install.sh | 13 +++++++++++++ setup/rvm-install.sh | 3 +++ 8 files changed, 37 insertions(+), 19 deletions(-) create mode 100644 .gitignore create mode 100644 setup/other-user-setup.sh create mode 100644 setup/ruby-install.sh create mode 100644 setup/rvm-install.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2bc92fa --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +work/* +.vagrant/ \ No newline at end of file diff --git a/README.rdoc b/README.rdoc index a1db60c..0005db4 100644 --- a/README.rdoc +++ b/README.rdoc @@ -3,6 +3,4 @@ Ubuntu 14.04 vagrant template for rails development. To use, do the following: * Run vagrant up -* Run vagrant ssh -* Cd to /vagrant/setup -* Run ./build.sh +* Run vagrant ssh \ No newline at end of file diff --git a/Vagrantfile b/Vagrantfile index 1cd2380..3d18a59 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,9 +2,13 @@ Vagrant.configure("2") do |config| config.vm.box = "ubuntu/trusty64" config.vm.network "public_network" config.vm.network "private_network", ip: "192.168.254.2" + config.vm.provision :shell, path: "setup/build.sh" + config.vm.provision :shell, path: "setup/rvm-install.sh", args: "stable", privileged: false + config.vm.provision :shell, path: "setup/ruby-install.sh", args: "2.3.0 rails", privileged: false + config.vm.provision :shell, path: "setup/other-user-setup.sh", privileged: false config.vm.provider "virtualbox" do |v| v.memory = 2048 v.cpus = 2 v.name = "railsdev" end -end \ No newline at end of file +end diff --git a/setup/Vagrant Windows Instructions.txt b/setup/Vagrant Windows Instructions.txt index c1e3473..3ee3914 100644 --- a/setup/Vagrant Windows Instructions.txt +++ b/setup/Vagrant Windows Instructions.txt @@ -5,6 +5,4 @@ For Windows: 4. Instal Vagrant 5. Open CMD and navigate to railsVagrant folder 6. From CMD run vagrant up -7. Run vagrant ssh -8. Run build.sh inside vagrant - +7. Run vagrant ssh \ No newline at end of file diff --git a/setup/build.sh b/setup/build.sh index ae481ee..9df1832 100644 --- a/setup/build.sh +++ b/setup/build.sh @@ -1,13 +1,11 @@ - -sudo apt-get update -sudo apt-get install nodejs -y -sudo apt-get install curl -y -gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 -\curl -sSL https://get.rvm.io | bash -s stable --rails -echo "source $HOME/.rvm/scripts/rvm" >> /home/vagrant/.bashrc -sudo apt-get install git-core -y +#!/usr/bin/env bash +apt-get update +apt-get install nodejs nodejs-legacy npm curl git -y wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh -cd /vagrant/setup -wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.10.deb -sudo dpkg -i elasticsearch-0.90.10.deb -rm elasticsearch-0.90.10.deb + +#Docker install +curl -sSL https://get.docker.com/ | sh +usermod -aG docker vagrant +curl -L https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s`-`uname -m` > docker-compose +mv docker-compose /usr/local/bin/ +chmod +x /usr/local/bin/docker-compose \ No newline at end of file diff --git a/setup/other-user-setup.sh b/setup/other-user-setup.sh new file mode 100644 index 0000000..455aec4 --- /dev/null +++ b/setup/other-user-setup.sh @@ -0,0 +1,2 @@ +git config --global user.name "Jacob Cody Wimer" +git config --global user.email "jacob.wimer@gmail.com" diff --git a/setup/ruby-install.sh b/setup/ruby-install.sh new file mode 100644 index 0000000..913c491 --- /dev/null +++ b/setup/ruby-install.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + + source $HOME/.rvm/scripts/rvm + + rvm use --default --install $1 + + shift + + if (( $# )) + then gem install $@ + fi + + rvm cleanup all \ No newline at end of file diff --git a/setup/rvm-install.sh b/setup/rvm-install.sh new file mode 100644 index 0000000..b62ba1b --- /dev/null +++ b/setup/rvm-install.sh @@ -0,0 +1,3 @@ + #!/usr/bin/env bash +gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 +\curl -sSL https://get.rvm.io | bash -s $1 \ No newline at end of file