build-version.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132
  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. ts=`awk 'BEGIN { FS="=" } /^TS=.+$/ { print $2; }' $versionfile`
  14. [ -z "$base" ] && abort "Failed to parse Gluon base commit-id from version file."
  15. [ -z "$branch" ] && abort "Failed to parse branch name from version file."
  16. [ -z "$site" ] && abort "Failed to parse site repo commit-id from version file."
  17. [ -z "$ts" ] && abort "Failed to parse timestamp from version file."
  18. info Building $branch version '$version' again ...
  19. echo " * Gluon base = $base"
  20. echo " * Site repo = $site"
  21. echo " * Timestamp = $ts"
  22. echo
  23. # invoke build script
  24. BASE="$base" BRANCH="$branch" SITE="$site" VERSION="$version" BUILD_TS="$ts" ./build.sh