diff options
author | Mark Longair <mhl@pobox.com> | 2013-10-31 10:46:01 +0000 |
---|---|---|
committer | Mark Longair <mhl@pobox.com> | 2013-11-07 12:46:25 +0000 |
commit | c8289b5efae2b42bee2942a12038fff9c6582a76 (patch) | |
tree | e76589501f408ae8b9f853851c5bc4779faea9a9 /script | |
parent | 20e447e7356ac038728882d096e286068aa7feea (diff) |
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.
Diffstat (limited to 'script')
-rwxr-xr-x | script/site-specific-install.sh | 11 |
1 files changed, 4 insertions, 7 deletions
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 |