build-version.sh 971 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. # calls build.sh with information found in given version
  3. MY_DIR=$(dirname $0)
  4. MY_DIR=$(readlink -f "$MY_DIR")
  5. pushd $MY_DIR > /dev/null
  6. . functions.sh
  7. version=$1
  8. versionfile="${MY_DIR}/versions/${version}"
  9. [ -r $versionfile ] || abort "Failed to find the version '$version'."
  10. base=`awk 'BEGIN { FS="=" } /^gluon=([a-f0-9]+)$/ { print $2; }' $versionfile`
  11. branch=`awk 'BEGIN { FS="=" } /^branch=([a-z]+)$/ { print $2; }' $versionfile`
  12. site=`awk 'BEGIN { FS="=" } /^site=([a-f0-9]+)$/ { print $2; }' $versionfile`
  13. [ -z "$base" ] && abort "Failed to parse Gluon base commit-id from version file."
  14. [ -z "$branch" ] && abort "Failed to parse branch name from version file."
  15. [ -z "$site" ] && abort "Failed to parse site repo commit-id from version file."
  16. info Building $branch version '$version' again ...
  17. echo " * Gluon base = $base"
  18. echo " * Site repo = $site"
  19. echo
  20. # invoke build script
  21. BASE=$base BRANCH=$branch SITE=$site VERSION=$version ./build.sh