Skip to content
Alan Graham edited this page Jun 6, 2016 · 11 revisions

This guide will step you through setting up a new deployment application with Cloudpad.

Installing

Create a directory and add a Gemfile:

$ mkdir app-deploy
$ cd app-deploy
$ touch Gemfile

Add this line to your application's Gemfile:

source 'http://rubygems.org'
gem 'cloudpad', :github => 'agquick/cloudpad'
gem 'cloudpad-starter', :github => 'agquick/cloudpad-starter' # if you want cloudpad base dockerfiles, etc. This is optional.

And then execute:

$ bundle install
$ bundle exec cap install

Update your Capfile:

# Capfile

require 'capistrano/setup'
# require 'capistrano/deploy' # comment this line out

require 'cloudpad'

# any extensions go here, for example cloudpad/starter
require 'cloudpad/starter'

Delete everything in config/deploy.rb

# config/deploy.rb
# This is your configuration file. Let's make it empty for now...

Directory Structure

The directory structure is integral to how Cloudpad works. Below is an outline of the relevant directories and files. Extensions may add more directories or files to these locations.

  • config/ - where all configuration is stored

    • deploy.rb - global configuration
    • deploy/ - config for stages
      • production.rb - configuration overrides for production environment
  • context/ - context for building images

    • src/ - holds all cached repositories
    • services/ - compile location for defined container services
  • manifests/ - directory for holding all Dockerfile manifests

Installing Extension Files

If you are using any extensions, you can run the relevant commands now. For example, this will install the starter files:

$ bundle exec cap production starter:install:all

Provision Launcher

The machine that will be running the Cloudpad commands is known as the launcher. This machine needs to have docker installed. It also needs a few other services like a docker registry and etcd. This command will install all of this for you.

$ bundle exec cap production launcher:provision

What's Next?

Now you are ready to:

  1. Write your configuration file
  2. Build your images
  3. Add and provision your hosts
  4. Deploy your containers

Clone this wiki locally