Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Independent instances #38

Closed
wants to merge 10 commits into from

2 participants

gerhard Adam Hamsik
gerhard
Owner

Creates independent instances of your code across all $HOSTS.

Should include status (show all remote instances) & pruning (keep only n instances).

gerhard gerhard was assigned
Adam Hamsik

I like this one do you plan to merge it in ?

gerhard
Owner

Yes, I was meant to get it finished months ago! I went through most of my backlog now, shouldn't be much longer.

gerhard
Owner

Docker was made for this very feature, it's outside the scope of deliver.

gerhard gerhard closed this
gerhard gerhard deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 4, 2012
Commits on Aug 27, 2012
Commits on Sep 12, 2012
  1. Prettier help and strategies outputs

    authored
    Dropped the OPTIONS notion, there are only COMMANDS and MODES.
    Old options still work, users expect -v, -h etc.
Commits on Sep 13, 2012
  1. Better colouring & ordering for commands

    authored
    Started on explaining the new commands
  2. Merge branch 'master' into zero-downtime

    authored
    Conflicts:
    	libexec/output
Commits on Sep 24, 2012
  1. Indentation

    authored
  2. inventory replaced with status, new link

    authored
    Starting on clone...
This page is out of date. Refresh to see the latest.
4 libexec/defaults
View
@@ -16,8 +16,8 @@ SSH_TIMEOUT=3
AUTHORIZED_REMOTE_HOSTS=()
-REQUIRED_CONFIGS=("ORIGIN_DIR" "STRATEGY")
-OPTIONAL_CONFIGS=("APP" "APP_USER" "DELIVER_TO" "REFSPEC" "GIT_PUSH" "REVISION" "FOREMAN_EXTRAS" "PORT" "AUTHORIZED_REMOTE_HOSTS")
+REQUIRED_CONFIGS=(ORIGIN_DIR STRATEGY)
+OPTIONAL_CONFIGS=(APP APP_USER DELIVER_TO REFSPEC GIT_PUSH REVISION FOREMAN_EXTRAS PORT AUTHORIZED_REMOTE_HOSTS)
MODE="compact"
107 libexec/init
View
@@ -7,41 +7,52 @@ __version() {
__help() {
__version
- echo -e "${txtbld}Usage:${txtrst}
- deliver [MODE] [COMMAND]
- deliver [OPTIONS]
-
-${txtbld}Commands:${txtrst}
- deliver strategies Lists all available strategies
- deliver check Checks if everything is setup correctly, displays the entire configuration
- deliver [MODE] Takes your code into production
-
-${txtbld}Modes:${txtrst}
- -C, --compact Displays every task as it's run, silences all output. (default mode)
- -V, --verbose Same as above, does not silence output.
- -P, --plain Displays every task as it's run, silences all output. No colouring. (CI)
- -D, --debug Runs in shell debug mode, displays everything.
-
-${txtbld}Options:${txtrst}
- -s, --strategy Enforces a particular strategy.
- -h, --help Displays this help. (works with no other options)
- -v, --version Displays the running version (works with no other options)
-
-${txtbld}Miscellaneous:${txtrst}
- You can overwrite any config at runtime (deliver check):
-
- HOSTS=ruby-1-local PORT=6000 deliver -V
+ echo -e "${txtbld}USAGE${txtrst}
+ deliver [${txtcyn}CO${txtgrn}MMA${txtred}ND${txtrst}] [${txtylw}MODE${txtrst}]
+
+${txtbld}COMMANDS${txtrst}
+ ${txtbld}deliver${txtrst} Delivers your code to all \$HOSTS
+ deliver ${txtgrn}clone${txtrst}* Creates independent instances of your code across \$HOSTS
+ deliver ${txtred}prune${txtrst}* Keeps \$KEEP most recent code instances across \$HOSTS
+ deliver ${txtred}clear${txtrst}* Clears all traces of your code from \$HOSTS
+ deliver ${txtcyn}check${txtrst} Displays the local deliver configuration (highlights errors)
+ deliver ${txtcyn}status${txtrst}* Displays all code instances across \$HOSTS
+ deliver ${txtcyn}strategies${txtrst} Lists all available strategies
+ deliver ${txtcyn}help${txtrst} This help message
+ deliver ${txtcyn}version${txtrst} Current deliver version
+
+${txtbld}MODES${txtrst}
+ Each of the above commands supports the following runtime modes:
+
+ ${txtylw}-C${txtrst}, ${txtylw}--compact${txtrst} Displays progress, silences output. (default mode)
+ ${txtylw}-P${txtrst}, ${txtylw}--plain${txtrst} Same as compact, but uses no colours (CI friendly)
+ ${txtylw}-V${txtrst}, ${txtylw}--verbose${txtrst} Same as compact, does not silence output
+ ${txtylw}-D${txtrst}, ${txtylw}--debug${txtrst} Shell debug mode
+
+${txtbld}CLONING*${txtrst}
+ This command allows you to run 2 (or more) instances of your code side-by-side.
+
+${txtbld}PRUNING*${txtrst}
+
+${txtbld}CLEARING*${txtrst}
+
+${txtbld}STATUS*${txtrst}
+
+${txtbld}MISCELLANEOUS${txtrst}
+ You can overwrite any config at runtime. Run ${txtcyn}deliver check${txtrst} to confirm this:
+
+ HOSTS=ruby-1-local PORT=6000 ${txtcyn}deliver check${txtrst}
"
}
__available_strategies() {
__version
- echo -e "${txtbld}Available strategies:${txtrst}"
+ echo -e "${txtbld}STRATEGIES${txtrst}"
for strategy in $STRATEGIES_NAME
do
- echo " * $strategy"
+ echo " ${txtmgt}$strategy${txtrst}"
done
echo ""
@@ -51,6 +62,32 @@ while (( $# ))
do
arg="$1" && shift
case "${arg}" in
+# This is inspired by Netflix's approach to HA and some recent blog posts:
+# 1. http://blog.phusion.nl/2012/07/26/roadmap-preview-2-live-irb-console-deployment-error-resistance-new-website/
+# 2. http://blog.appfog.com/how-to-update-your-appfog-app-with-zero-downtime/
+# 3. http://blog.argteam.com/coding/hardening-node-js-for-production-part-3-zero-downtime-deployments-with-nginx/
+ (clone)
+ CLONE=true
+ ;;
+ (-h|--help|help)
+ __help
+ exit 0
+ ;;
+ (-v|--version|version)
+ __version
+ exit 0
+ ;;
+ (-s|--strategies|strategies)
+ __available_strategies
+ exit 0
+ ;;
+ (-c|--check|check)
+ CHECK=true
+ ;;
+ (status|prune|clear)
+ echo "${arg} has not been implemented yet"
+ exit 1
+ ;;
(-C|--compact)
MODE="compact"
;;
@@ -64,24 +101,6 @@ do
# this was already captured in libexec/output
# noop
;;
- (-h|--help)
- __help
- exit 0
- ;;
- (-s|--strategy)
- STRATEGY="$1" && shift
- ;;
- (-v|--version)
- __version
- exit 0
- ;;
- (strategies)
- __available_strategies
- exit 0
- ;;
- (check)
- CHECK=true
- ;;
(*)
hint_message "Unknown argument ${arg} ignored"
;;
2  strategies/generated
View
@@ -9,7 +9,7 @@
# Every deliver is a commit on the generated branch. This then gets pushed out
# to all remote hosts (or just to github:pages).
-OPTIONAL_CONFIGS+=("GENERATED_DIR" "GENERATED_BRANCH" "GENERATE_CMD" "HOSTS")
+OPTIONAL_CONFIGS+=(GENERATED_DIR GENERATED_BRANCH GENERATE_CMD HOSTS)
REFSPEC="$GENERATED_BRANCH"
4 strategies/gh-pages
View
@@ -9,8 +9,8 @@
# Every deploy is a commit on the generated branch. This then gets pushed out
# to github:pages.
-REQUIRED_CONFIGS+=("GENERATED_DIR" "GENERATED_BRANCH")
-OPTIONAL_CONFIGS=("GENERATE_CMD" "ROCCO_FILES")
+REQUIRED_CONFIGS+=(GENERATED_DIR GENERATED_BRANCH)
+OPTIONAL_CONFIGS=(GENERATE_CMD ROCCO_FILES)
GENERATED_DIR="gh-pages"
GENERATED_BRANCH="gh-pages"
4 strategies/nodejs
View
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
-REQUIRED_CONFIGS+=("HOSTS")
-OPTIONAL_CONFIGS+=("SUPERVISOR")
+REQUIRED_CONFIGS+=(HOSTS)
+OPTIONAL_CONFIGS+=(SUPERVISOR)
# Sincer deliver leverages foreman,
# it supports all the supervisors that foreman does
4 strategies/ruby
View
@@ -3,8 +3,8 @@
# This is the default deliver strategy.
# It uses git push, rvm & foreman to generate upstart jobs
-REQUIRED_CONFIGS+=("HOSTS")
-OPTIONAL_CONFIGS+=("SUPERVISOR")
+REQUIRED_CONFIGS+=(HOSTS)
+OPTIONAL_CONFIGS+=(SUPERVISOR)
# Sincer deliver leverages foreman,
# it supports all the supervisors that foreman does
4 strategies/shared
View
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
-REQUIRED_CONFIGS+=("HOSTS")
-OPTIONAL_CONFIGS+=("OWNER" "GROUP" "PERMISSIONS")
+REQUIRED_CONFIGS+=(HOSTS)
+OPTIONAL_CONFIGS+=(OWNER GROUP PERMISSIONS)
run() {
authorize_hosts
Something went wrong with that request. Please try again.