download_build.sh 925 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/sh
  2. ## Copyright (c) 2014 Minoca Corp. All Rights Reserved.
  3. ##
  4. ## Script Name:
  5. ##
  6. ## download_build.sh
  7. ##
  8. ## Abstract:
  9. ##
  10. ## This script downloads and extracts the latest build.
  11. ##
  12. ## Author:
  13. ##
  14. ## Evan Green 15-May-2014
  15. ##
  16. ## Environment:
  17. ##
  18. ## Minoca Build
  19. ##
  20. set -e
  21. if test -z "$ARCH"; then
  22. echo "ARCH must be set."
  23. exit 1
  24. fi
  25. if test -z "$DEBUG"; then
  26. echo "DEBUG must be set."
  27. exit 1
  28. fi
  29. export TMPDIR=$PWD
  30. export TEMP=$TMPDIR
  31. SCHEDULE_ARCH="$ARCH$VARIANT"
  32. last_native_build=`python ../../client.py --query "Native Pilot $SCHEDULE_ARCH"`
  33. if test -z $last_native_build; then
  34. echo "Error: Failed to get last Native Pilot $SCHEDULE_ARCH build."
  35. exit 1
  36. fi
  37. file=minoca-bin-$ARCH$VARIANT$DEBUG.tar.gz
  38. echo "Downloading $file from schedule instance ID $last_native_build"
  39. python ../../client.py --pull $file $file $last_native_build
  40. echo "Extracting $file"
  41. tar -xzf $file
  42. rm $file