-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
This guide will step you through setting up a new deployment application with Cloudpad.
Create a directory and add a Gemfile:
$ mkdir app-deploy
$ cd app-deploy
$ touch GemfileAdd 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 installUpdate 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 set the basics for now...
# config valid only for Capistrano 3.1
lock '3.2.1'
set :application, 'myapp' # the name of this application
set :docker_version, '1.9.1-0~trusty' # which docker version you'd like to install
set :host_subnet, '10.250.10.0/24' # the subnet of your environment
set :registry, '10.250.10.5:5000' # the host of your registry
set :insecure_registry, true # specify if registry is secure or not
set :etcd_client_url, 'http://10.250.10.5:2379' # the URL for all containers to reach etcd
set :nfs_shared_path, '/shared' # where your nfs should be mounted on launcherThe 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 -
puppet/- directory for Puppet manifests and modules (https://docs.puppet.com/)
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:allThe 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:provisionNow you are ready to:
- Write your configuration file
- Build your images
- Add and provision your hosts
- Deploy your containers