openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mrutkow...@apache.org
Subject [incubator-openwhisk-release] branch master updated: Add the config option to determine whether to push the artifacts or not (#67)
Date Tue, 20 Mar 2018 03:16:15 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 75e7582  Add the config option to determine whether to push the artifacts or not
(#67)
75e7582 is described below

commit 75e7582dad5d57047ca11fd3b9a0509f755acf4f
Author: Vincent <shou@us.ibm.com>
AuthorDate: Mon Mar 19 23:16:13 2018 -0400

    Add the config option to determine whether to push the artifacts or not (#67)
    
    This PR adds a config option "publish_stage" in the configuration file
    to determine whether this commit will push new artifacts into the
    staging URL or not. By default, it is set to false, meaning it will
    not push new artifacts. We can set it to true in order to push new
    artifacts.
---
 tools/config.json                   |  1 +
 tools/load_config.sh                |  5 +++--
 tools/travis/package_source_code.sh | 17 ++++++++++-------
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/tools/config.json b/tools/config.json
index 6fdbed9..cac2d34 100644
--- a/tools/config.json
+++ b/tools/config.json
@@ -1,4 +1,5 @@
 {
+  "publish_stage": "false",
   "stage_url": "https://dist.apache.org/repos/dist/dev/incubator/openwhisk",
   "release_url": "https://dist.apache.org/repos/dist/release/incubator/openwhisk",
   "version": {
diff --git a/tools/load_config.sh b/tools/load_config.sh
index 43b233d..6e19354 100755
--- a/tools/load_config.sh
+++ b/tools/load_config.sh
@@ -17,10 +17,10 @@
 #
 
 WORK_DIR=${1:-"$HOME"}
-SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
-
+DIR="$(cd $(dirname "$0")/ && pwd)"
 SVN_USERNAME=$2
 SVN_PASSWORD=$3
+SCRIPTDIR=${4:-"$DIR"}
 CREDENTIALS=""
 
 if [ ! -z "$SVN_USERNAME" ] && [ ! -z "$SVN_PASSWORD" ];then
@@ -35,6 +35,7 @@ OPENWHISK_SVN="$OPENWHISK_RELEASE_DIR/openwhisk"
 source "$SCRIPTDIR/util.sh"
 
 CONFIG=$(read_file $SCRIPTDIR/config.json)
+PUBLISH_STAGE=$(json_by_key "$CONFIG" "publish_stage")
 repos=$(echo $(json_by_key "$CONFIG" "RepoList") | sed 's/[][]//g')
 STAGE_URL=$(json_by_key "$CONFIG" "stage_url")
 
diff --git a/tools/travis/package_source_code.sh b/tools/travis/package_source_code.sh
index aa0585d..79bd7ec 100755
--- a/tools/travis/package_source_code.sh
+++ b/tools/travis/package_source_code.sh
@@ -27,16 +27,19 @@ PARENTDIR="$(dirname "$SCRIPTDIR")"
 SVN_USERNAME=$2
 SVN_PASSWORD=$3
 
+source "$PARENTDIR/load_config.sh" "$WORK_DIR" "$SVN_USERNAME" "$SVN_PASSWORD" "$PARENTDIR"
+
 "$PARENTDIR/install_dependencies.sh"
-"$PARENTDIR/download_source_code.sh" $WORK_DIR
-"$PARENTDIR/checkout_svn.sh" $WORK_DIR $SVN_USERNAME $SVN_PASSWORD
+"$PARENTDIR/download_source_code.sh" "$WORK_DIR"
+"$PARENTDIR/checkout_svn.sh" "$WORK_DIR" "$SVN_USERNAME" "$SVN_PASSWORD"
+
 
-"$PARENTDIR/package_source_code.sh" $WORK_DIR $SVN_USERNAME $SVN_PASSWORD
+"$PARENTDIR/package_source_code.sh" "$WORK_DIR" "$SVN_USERNAME" "$SVN_PASSWORD"
 
-if [ "$TRAVIS_EVENT_TYPE" == "push" ] ; then
+if [ "$TRAVIS_EVENT_TYPE" == "push" ] && [ "$PUBLISH_STAGE" == "true" ] ; then
     "$SCRIPTDIR/import_pgp_key.sh"
-    "$PARENTDIR/sign_artifacts.sh" $WORK_DIR
-    "$PARENTDIR/upload_artifacts.sh" $WORK_DIR $SVN_USERNAME $SVN_PASSWORD
+    "$PARENTDIR/sign_artifacts.sh" "$WORK_DIR"
+    "$PARENTDIR/upload_artifacts.sh" "$WORK_DIR" "$SVN_USERNAME" "$SVN_PASSWORD"
 fi
 
-"$PARENTDIR/verify_source_code.sh" $WORK_DIR
+"$PARENTDIR/verify_source_code.sh" "$WORK_DIR"

-- 
To stop receiving notification emails like this one, please contact
mrutkowski@apache.org.

Mime
View raw message