This script enables you to launch your Rails application in production environment (port:80) with Nginx and Unicorn.
Please make sure that your Gemfile in your rails application includes unicorn.
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
default_run_options[:pty] = true | |
ssh_options[:forward_agent] = true | |
set :user, "<< YOUR WEBFACTION USERNAME >>" | |
set :application, "<< YOUR APP NAME >>" | |
set :repository, "<< YOUR REPOSITORY ADDRESS >>" | |
set :deploy_to, "/home/<< YOUR WEBFACTION USERNAME >>/webapps/<< YOUR WEBAPP DIRECTORY >>" | |
set :default_stage, "production" |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
#!/bin/bash | |
# Stop all containers | |
containers=`docker ps -a -q` | |
if [ -n "$containers" ] ; then | |
docker stop $containers | |
fi | |
# Delete all containers | |
containers=`docker ps -a -q` | |
if [ -n "$containers" ]; then | |
docker rm -f -v $containers |