Skip to content

Instantly share code, notes, and snippets.

@selfup
Last active July 7, 2016 17:22
Show Gist options
  • Save selfup/3449f7671d5492506cc7 to your computer and use it in GitHub Desktop.
Save selfup/3449f7671d5492506cc7 to your computer and use it in GitHub Desktop.

For Ubuntu, Debian, and Raspbian

Here we set everything up to be ready for install

cd
sudo apt-get install git -y
git clone https://github.com/selfup/DevOpsOne.git
python ~/DevOpsOne/setup_1.py
. .bashrc
. .bash_profile
python ~/DevOpsOne/setup_2.py
. .bashrc
. .bash_profile
python ~/DevOpsOne/setup_3.py

Now we install the meat and bones (we have to re-run some of the the scripts, they will go by very very quickly this time)

There will be some warnings that things already exists or that things don't exists, but these are normal!

Installing/compiling ruby will take 5 to 10 minutes depending on your setup:

python ~/DevOpsOne/install_ruby.py
python ~/DevOpsOne/setup_1.py
python ~/DevOpsOne/setup_2.py
python ~/DevOpsOne/setup_3.py
rbenv global 2.3.0
rbenv rehash
python ~/DevOpsOne/install_rest.py
rbenv rehash

Ruby, Rails, NodeJS, and Postgres have just been installed. Whoaa!

Now we hook up a rails app to a postgres database

Don't worry, this is pretty automated!

Clone your favorite app:

cd favorite_app_directory

Run the ruby script that will take a command line argument after the .rb

This will set up a valid database.yml for you (the most painfull process of hooking up a rails app)

ruby ~/DevOpsOne/create_db_yml_desktop.rb a_password_you_will_remember

Please check your .gitignore and run git status to make sure the script properly added the correct files to your .gitignore

Now we go into the postgres console and input the password we gave to the ruby script as an ARGV[0]

sudo -u postgres psql
\password name_of_favorite_app
\q

Now you can run development/test/production

rake db:setup
RAILS_ENV=production rake db:setup
RAILS_ENV=production rake assets:precompile
RAILS_ENV=production rails s

All done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment