From c8289b5efae2b42bee2942a12038fff9c6582a76 Mon Sep 17 00:00:00 2001 From: Mark Longair Date: Thu, 31 Oct 2013 10:46:01 +0000 Subject: If the origin/install-script branch exists, use that in preference Once merged to master we can remove origin/install-script, but development is awkward without it. This commit also makes it easy to have an arbitrary number of fallbacks. --- script/site-specific-install.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'script/site-specific-install.sh') diff --git a/script/site-specific-install.sh b/script/site-specific-install.sh index 3c7e0a842..5231abc1d 100755 --- a/script/site-specific-install.sh +++ b/script/site-specific-install.sh @@ -3,8 +3,7 @@ # Set IDEAL_VERSION to the commitish we want to check out; typically # this is the version tag. Since this may not exist before release, # fall back to the master branch: -IDEAL_VERSION=0.15 -FALLBACK_VERSION=origin/master +VERSIONS="origin/install-script 0.15 origin/master" PARENT_SCRIPT_URL=https://github.com/mysociety/commonlib/blob/master/bin/install-site.sh @@ -27,8 +26,7 @@ misuse() { [ -z "$DEFAULT_SERVER" ] && misuse DEFAULT_SERVER [ -z "$HOST" ] && misuse HOST [ -z "$DISTRIBUTION" ] && misuse DISTRIBUTION -[ -z "$IDEAL_VERSION" ] && misuse VERSION -[ -z "$FALLBACK_VERSION" ] && misuse FALLBACK_VERSION +[ -z "$VERSIONS" ] && misuse VERSIONS [ -z "$DEVELOPMENT_INSTALL" ] && misuse DEVELOPMENT_INSTALL [ -z "$BIN_DIRECTORY" ] && misuse BIN_DIRECTORY @@ -37,9 +35,8 @@ update_mysociety_apt_sources if [ ! "$DEVELOPMENT_INSTALL" = true ]; then install_nginx add_website_to_nginx - # Check out the requested version: - su -l -c "cd '$REPOSITORY' && (git checkout '$IDEAL_VERSION' || - git checkout '$FALLBACK_VERSION')" \ + # Check out the first available requested version: + su -l -c "cd '$REPOSITORY' && (for v in $VERSIONS; do git checkout $v && break; done)" \ "$UNIX_USER" fi -- cgit v1.2.3