#!/bin/bash #/ NAME #/ init -- #/ #/ SYNOPSIS #/ #/ init # figure out the project root under which bin, lib live shome="$(cd -P -- "$(dirname -- "$BASH_SOURCE")/.." && pwd -P)" # load a jason bourne library source "$shome/libexec/_treadstone" DEFINE_boolean "helpers" "$FLAGS_FALSE" "Generate the bin and libexec helpers" "H" function main { local dollar='$' if [[ "$FLAGS_helpers" = "$FLAGS_TRUE" ]]; then mkdir -p "libexec" cat > "libexec/aohelper" <&- } shome="${dollar}(cd -P -- "${dollar}(dirname -- "${dollar}BASH_SOURCE")/.." && pwd -P)" app_ruby="${dollar}(ryaml ${dollar}shome/config/deploy.yml app_ruby)" ruby_loader="${dollar}(ryaml ${dollar}shome/config/deploy.yml ruby_loader)" PATH="${dollar}PATH:/usr/local/rvm/bin:${dollar}HOME/.rvm/bin" if ! ${dollar}ruby_loader ${dollar}app_ruby bundle check 2>&- > /dev/null; then ${dollar}ruby_loader ${dollar}app_ruby bundle install --local --quiet fi ${dollar}ruby_loader ${dollar}app_ruby bundle exec ao "${dollar}{BASH_SOURCE##*/}" "${dollar}@" EOF chmod 755 "libexec/aohelper" for nm_cmd in activate check compare debug deploy dna hosts lock migrate proxy release restart rollback shell stage unlock; do ln -nfs "../libexec/aohelper" $shome/bin/$nm_cmd done else if [[ "$#" < 1 ]]; then logger_fatal "missing application name" exit 1 fi local nm_app="$1"; shift cat > "Capfile" <&1 >/dev/null; } || #{ruby_loader} bundle #{bundler_options} >/dev/null" end end end # overrides namespace :deploy do task :bundle do ${nm_app}.bundle.ruby end end # interesting hosts Deploy self, __FILE__ do |admin, node| if node["run_list"].include?("role[something_something]") { :deploy => { } } end end EOF mkdir -p "config" cat > "config/deploy.yml" <