Sha256: f40d570b309bee20487278c40f93b5f521a6d0d57a71c99fb9df6c90661b2151

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

#!/bin/bash

#
# This script is used to execute non-ruby service hooks. It's called from
# EY::Serverside::Deploy#callback. If you'd like to call it directly you should
# be careful to replicate everything done in EY::Serverside::Deploy or your
# hook code may not execute as planned.
#

set -o nounset

abort() {
  echo "$*"
  exit 1
}

HOOK=${1:-}
[ -n "${HOOK}" ] || abort "No hook name provided."

# We run all deploy hooks from the root directory of the current release of
# their app.
[ -n "${EY_DEPLOY_RELEASE_PATH:-}" ] || abort "EY_DEPLOY_RELEASE_PATH must be set."
[ -d ${EY_DEPLOY_RELEASE_PATH} ] || abort "EY_DEPLOY_RELEASE_PATH must exist and be a directory"
cd ${EY_DEPLOY_RELEASE_PATH}

# Set up the service hook paths
_app_path=$(dirname $(dirname ${EY_DEPLOY_RELEASE_PATH}))
_service_hooks_path="${_app_path}/shared/hooks"

# Run the hook.
_hook_path="${service_hooks_path}/${HOOK}"
if [ ! \( -f ${_hook_path} -a -x ${_hook_path} \) ]; then
  abort "${_hook_path} must exist and be executable"
fi
exec ${_hook_path}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
engineyard-serverside-2.8.0.pre2 bin/engineyard-serverside-execute-service-hook