Skip to content

Fixes for raise condition #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ function symlink_update() {
local src=$1
local dst=$2

# remove old symlink
if [[ -L $dst ]]; then
rm $dst || die "Unable to delete production symlink"
# create new symlink
ln -s $src ${dst}_tmp || die "Unable to create new symlink"

# replace old symlink
mv -Tf ${dst}_tmp $dst || die "Unable to replace production symlink"
fi

# create new symlink
ln -s $src $dst || die "Unable to create production symlink"
}

symlink_post_hook(){
Expand Down Expand Up @@ -184,7 +184,6 @@ do_prune(){
# Called when script finishes or if user aborts
cleanup(){
rm -f $LOCK_FILE || die
popd > /dev/null
}

handle_sigint(){
Expand All @@ -195,6 +194,9 @@ handle_sigint(){

############## END FUNCTIONS ####################3

# Catch ctrl-c
trap handle_sigint SIGINT

if [ $# -gt 1 ]; then
echo "Bad usage"
exit 48
Expand Down Expand Up @@ -224,11 +226,7 @@ fi
# fix relative paths
DIR=$(readlink -f $(dirname "${SETTINGS_FILE}"))
echo "${infostar} Working directory: ${DIR}"
pushd ${DIR} > /dev/null

# Catch ctrl-c
# This should be done after pushd since it calls popd to restore cwd
trap handle_sigint SIGINT
cd ${DIR}

# Create release name
releasename="${releaseprefix:-release}-`date +%Y%m%d%H%M%S`"
Expand Down Expand Up @@ -315,10 +313,10 @@ echo " rm $LOCK_FILE"
echo "*********************************"
echo
answer="fail"
until [ "$answer" == "yes" ]; do
until [[ "$answer" = "yes" ]]; do
echo -n "${bold}Do you wish to continue?${normal} [${green}yes${normal}/${red}no${normal}] "
read answer
if [ "$answer" == "no" ]; then
if [[ "$answer" = "no" ]]; then
echo "Aborting."
exit 45
fi
Expand Down
16 changes: 8 additions & 8 deletions deploy_settings_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ VCS="git"
# All relative paths are relative to the directory this configuration exists in.

# A lock file is used to ensure multiple deploys aren't run at the same time.
# LOCK_FILE=deploy.lock
#LOCK_FILE=deploy.lock

# Path to an existing working copy (user must checkout/clone the repository
# before the first deploy, the deploy script only updates/pulls new revisions)
Expand All @@ -19,18 +19,18 @@ EXPORT_TARGET=/var/www/site/releases
SYMLINK_PATH=/var/www/site/example.com

# How many old releases to retain.
# RELEASE_COUNT=8
#RELEASE_COUNT=8

# File patterns to remove from the export. If you create a custom
# `export_post_hook` you must manually call `file_prune` if you need this
# feature.
# PRUNE=(o
# ".*\.xcf"
# )
#PRUNE=(o
# ".*\.xcf"
#)

# Sample hook
# update_post_hook(){
# echo "in overloaded post update hook"
# }
#update_post_hook(){
# echo "in overloaded post update hook"
#}

SETTINGS_FILE_OK=1