Coder Social home page Coder Social logo

chef-solo's Introduction

What's Included

  1. Nginx
  2. Mongo
  3. Unicorn (+ upstart script)
  4. Capistrano deploy.rb ready to use

Setup

NOTE: We'll assume you're creating an application called awesomeapp on the awesomeapp.com for this README, adjust accordingly.

  1. Launch a new server (only Ubuntu 10.04 LTS has been tested)
  2. Run curl https://raw.github.com/gist/b398348e220b4e3ca000/bootstrap.sh | sh
  3. Run ssh [email protected]
  4. Copy the chef cookbook to the server using rsync -r . [email protected]:chef-solo
  5. Copy ~/chef-solo/node.json.sample to ~/chef-solo/node.json and make any changes needed
  6. Run chef-solo -c ~/chef-solo/solo.rb

Results

Let's assume you create a new rails application with these defaults:

{
  "user": {
    "name":"deployer"
  },
  "rails_app":{
    "name":"awesomeapp",
    "database_password":"secret"
  },
  "run_list":["recipe[main]"]
}
  • The deployer user would be created. If authorized_keys_url is specified those public keys will be added to /home/deployer/.ssh/authorized_keys.
  • /var/www/awesomeapp will be setup to store the Rails application.
  • /var/www/awesomeapp/shared/config/mongoid.yml will be created. The awesomeapp_production Mongo database will be accessible by the awesomeapp user.
  • /home/deployer/deploy/awesomeapp.rb will be created. This is a functional Capistrano deploy.rb file that can be copied down to the application folder. It makes use of the USR2 signal for zero-downtime deployments.
  • /etc/init/unicorn_awesomeapp will be created to automatically launch your Unicorn application on boot. This will be run as the deployer user so that Capistrano script can reboot the script as necessary.

Other Instructions

Simplify SSH Configuration

If you want to login to the server as the deployer user you could add the following to your ~/.ssh/config file:

Host awesomeapp
HostName awesomeapp.com
User deployer

Now you can run ssh awesome and it will do ssh [email protected] in the background, neat-o!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.