Skip to content

Instantly share code, notes, and snippets.

@fj
Created November 22, 2013 19:40
Show Gist options
  • Save fj/7605618 to your computer and use it in GitHub Desktop.
Save fj/7605618 to your computer and use it in GitHub Desktop.
Hypothetical deployment YAML for hypothetical CMDB/deployment tool.
strategies:
# deployment mechanisms
-
name: ec2-production
# config for deploying to production
-
name: ec2-staging
# config for deploying to staging
-
name: vagrant-local-development
# config for spinning up a VM locally
sources:
# define sources to pull config, actions, etc. from later (git repo, HTTP URL, run local command, etc.)
actions:
# discrete steps to take during deployment ("configure SSH", "install mysql", "start nginx", etc.)
# actions can be imported from shared repositories or local files
-
name: postgres
commands:
start:
steps:
# ... steps for starting postgres
install:
steps:
# ... steps for installing postgres
stop:
steps:
# ... steps for stopping postgres
-
name: nginx
commands:
start:
steps:
# ... steps for starting nginx
stop:
steps:
# ... steps for stopping nginx
services:
# actions
-
name: web
config:
# config hash for web nodes
actions:
# setup steps to take
# must be declared in actions section
# can pass parameters
-
name: api
config:
# config hash for API server nodes
# actions, etc.
-
name: storm-node
config:
# config hash for Storm nodes
# actions, etc.
@fj
Copy link
Author

fj commented Nov 22, 2013

Let's say the tool is called "deployer". The idea is that you could do things like this:

# create a new web node using the ec2-production strategy
deployer create --strategy=ec2-production --service=web

# scale up/down using the ec2-staging strategy
deployer scale --strategy=ec2-staging --service=web --num=+2 # add two nodes
deployer scale --strategy=ec2-staging --service=web --num=-3 # remove three nodes
deployer scale --strategy=ec2-staging --service=web --num=8 # set to eight nodes

(lots more handwaving here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment