This is an automated email from the ASF dual-hosted git repository.

dgrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk-release.git


The following commit(s) were added to refs/heads/master by this push:
     new b63c7e8  Sanity check script usage. (#319)
b63c7e8 is described below

commit b63c7e881e639bc0afbb6568de77275ef5979fe4
Author: rodric rabbah <[email protected]>
AuthorDate: Sun Feb 2 15:27:00 2020 -0500

    Sanity check script usage. (#319)
    
    * Sanity check script usage.
    * Add sanity checks to staging script.
---
 tools/build_release.sh     | 11 +++++++++++
 tools/upload_to_staging.sh | 21 +++++++++++++++++++--
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/tools/build_release.sh b/tools/build_release.sh
index 5353b1e..8f86124 100755
--- a/tools/build_release.sh
+++ b/tools/build_release.sh
@@ -19,6 +19,17 @@
 set -e
 
 SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
+SCRIPTNAME=$(basename "$0")
+
+if [ $# -lt 1 ]; then
+  echo "Usage: $SCRIPTNAME <config-file>"
+  exit -1
+fi
+
+if [ ! -f "$1" ]; then
+  echo "Error: config file '$1' does not exist"
+  exit -1
+fi
 
 "$SCRIPTDIR"/download_source_code.sh $@
 "$SCRIPTDIR"/package_source_code.sh $@
diff --git a/tools/upload_to_staging.sh b/tools/upload_to_staging.sh
index 7536029..5accc77 100755
--- a/tools/upload_to_staging.sh
+++ b/tools/upload_to_staging.sh
@@ -18,11 +18,28 @@
 
 set -e
 
-echo "Upload release candidates to staging."
-
 SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
+SCRIPTNAME=$(basename "$0")
+
+if [ $# -lt 1 ]; then
+  echo "Usage: $SCRIPTNAME <config-file>"
+  exit -1
+fi
+
+if [ ! -f "$1" ]; then
+  echo "Error: config file '$1' does not exist"
+  exit -1
+fi
+
+echo "Upload release candidates to staging."
 source "$SCRIPTDIR/load_config.sh" $1
 
+if [ ! -d "$STAGE_SVN_DIR" ]; then
+    echo "Error: svn staging directory '$STAGE_SVN_DIR' not found."
+    echo "       Try running '$SCRIPTDIR/checkout_svn.sh' to setup your svn."
+    exit -1
+fi
+
 cd "$STAGE_SVN_DIR"
 
 svn update

Reply via email to