aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wfar...@apache.org
Subject aurora git commit: Change RC verification script to use a temp dir.
Date Fri, 08 May 2015 19:33:54 GMT
Repository: aurora
Updated Branches:
  refs/heads/master 8d8d75ecf -> 288f00be2


Change RC verification script to use a temp dir.

Reviewed at https://reviews.apache.org/r/33994/


Project: http://git-wip-us.apache.org/repos/asf/aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/288f00be
Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/288f00be
Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/288f00be

Branch: refs/heads/master
Commit: 288f00be29ae65fc20278e3bc57c9bf637c328f6
Parents: 8d8d75e
Author: Bill Farner <wfarner@apache.org>
Authored: Fri May 8 12:33:32 2015 -0700
Committer: Bill Farner <wfarner@twitter.com>
Committed: Fri May 8 12:33:32 2015 -0700

----------------------------------------------------------------------
 build-support/release/verify-release-candidate | 74 +++++++++++++--------
 1 file changed, 46 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/288f00be/build-support/release/verify-release-candidate
----------------------------------------------------------------------
diff --git a/build-support/release/verify-release-candidate b/build-support/release/verify-release-candidate
index a0f7179..f96d7c9 100755
--- a/build-support/release/verify-release-candidate
+++ b/build-support/release/verify-release-candidate
@@ -23,20 +23,6 @@ HERE=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)
 
 aurora_svn_dev_dist_url='https://dist.apache.org/repos/dist/dev/aurora'
 
-case $# in
-  1) verify_version="$1"
-     ;;
-
-  *) echo "Usage: $0 RC_VERSION"
-     exit 1
-     ;;
-esac
-
-dist_name="apache-aurora-${verify_version}"
-rc_dir=${dist_name}-verify
-mkdir -p $rc_dir
-cd $rc_dir
-
 download_dist_file() {
   curl -f -O ${aurora_svn_dev_dist_url}/$1
 }
@@ -45,20 +31,22 @@ download_rc_file() {
   download_dist_file ${verify_version}/$1
 }
 
-# Check and import the KEYS files
-read -r -p "Import Apache Aurora GPG KEYS? [y/n]" response
-response=${response,,}
-if [[ $response =~ ^(yes|y| ) ]]; then
-  download_dist_file KEYS
-  gpg --import KEYS
-fi
-
-download_rc_file ${dist_name}.tar.gz
-download_rc_file ${dist_name}.tar.gz.asc
-download_rc_file ${dist_name}.tar.gz.md5
-download_rc_file ${dist_name}.tar.gz.sha
+maybe_import_gpg_keys() {
+  # Check and import the KEYS files
+  read -r -p "Import Apache Aurora GPG KEYS? [y/n]" response
+  response=${response,,}
+  if [[ $response =~ ^(yes|y| ) ]]; then
+    download_dist_file KEYS
+    gpg --import KEYS
+  fi
+}
 
-verify_archive() {
+fetch_archive() {
+  local dist_name=$1
+  download_rc_file ${dist_name}.tar.gz
+  download_rc_file ${dist_name}.tar.gz.asc
+  download_rc_file ${dist_name}.tar.gz.md5
+  download_rc_file ${dist_name}.tar.gz.sha
   gpg --verify ${dist_name}.tar.gz.asc ${dist_name}.tar.gz
   gpg --print-md MD5 ${dist_name}.tar.gz | diff - ${dist_name}.tar.gz.md5
   shasum ${dist_name}.tar.gz | diff - ${dist_name}.tar.gz.sha
@@ -79,7 +67,37 @@ run_tests() {
   ./src/test/sh/org/apache/aurora/e2e/test_end_to_end.sh
 }
 
-verify_archive
+# TODO(wfarner): Share this with make-mesos-native-egg.
+setup_tempdir() {
+  TMPDIR=""
+  cleanup() {
+    if [[ -f Vagrantfile ]]; then
+      vagrant destroy -f
+    fi
+    cd /
+    rm -fr "$TMPDIR"
+  }
+  trap cleanup EXIT
+  TMPDIR=$(mktemp -d -t "$1.XXXXX")
+}
+
+case $# in
+  1) verify_version="$1"
+     ;;
+
+  *) echo "Usage: $0 RC_VERSION"
+     exit 1
+     ;;
+esac
+
+setup_tempdir "aurora-$verify_version"
+echo "Working in sandbox $TMPDIR"
+cd $TMPDIR
+
+maybe_import_gpg_keys
+
+dist_name="apache-aurora-${verify_version}"
+fetch_archive $dist_name
 tar xvzf ${dist_name}.tar.gz
 install_gradle_wrapper ${dist_name}
 cd ${dist_name}


Mime
View raw message