gearship
deploys dockerized projects to virtual machines.
Created as a micro alternative to puppet, chef, capistrano, etc, for managing droplets on digital ocean.
Overview
gem install gearship
gearship init
- update
gearship.yml
with server configuration - update
gearship.sh
with install configuration gearship go setup_host
gearship go deploy_app
- your app is live!
Quickstart
Install Gem:
$ gem install gearship
cd
into your project directory then create the gearship
folder:
$ cd my_project
$ gearship init
cd
into the gearship
folder and edit gearship.yml
with your server configuration
Run gearship go setup_host
to install docker on a new server:
$ cd gearship
$ gearship go setup_host
Ship your dockerized project to the docker host:
$ gearship go deploy_app
gearship performs missions which are composed of actions.
Shell scripts under the
missions
directory, such assetup_host.sh
ordeploy_app.sh
, are automatically recognized as a mission.The actions folder has reusable actions that can be called from any
mission_name.sh
withsource actions/action_name.sh
.Actions can be retrieved remotely via HTTP. Put a URL in the actions section of
gearship.yml
, and gearship will automatically load the content and put it into thecompiled/actions
folder in the compile phase.gearship go install_app
is equivalent to runninggearship.sh
, followed byinstall_app.sh
.
What gearship does when gearship go setup_app
is called
- Compile
gearship.yml
to generate attributes, retrieve remote actions, and copy files fromcargo
into thecompiled
directory. Appendsetup_app.sh
file to a copy ofgearship.sh
in thecompiled
directory. - SSH to the server specified in gearship.yml
- Transfer the content of the
compiled
directory to the remote server and extract in$HOME/gearship
- Run
gearship.sh
on the remote server.
Commands
$ gearship # Show command help
$ gearship init # Install gearship into project
$ gearship go [mission] # go docker project
Passing setup variables to scripts during compilation
Ruby
Attributes defined in gearship.yml
are accessible from any file with <%= @attributes.attribute_name %>
when eval_erb: true
is set in gearship.yml
Bash
Attributes defined in gearship.yml
are split into individual files in compiled/attributes
.
Refer to them by $(cat attributes/attribute_name)
in the script.