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

daisyguo 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 49ce24d  Add the script to checkout svn to the local directory (#45)
49ce24d is described below

commit 49ce24d2729c4723629340075cd3e36d9cd8ac83
Author: Vincent <s...@us.ibm.com>
AuthorDate: Tue Feb 27 02:22:31 2018 -0500

    Add the script to checkout svn to the local directory (#45)
---
 tools/checkout_svn.sh               | 25 +++++++++++++++++++++++++
 tools/package_source_code.sh        |  5 -----
 tools/travis/package_source_code.sh |  5 +----
 tools/upload_artifacts.sh           | 14 +-------------
 4 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/tools/checkout_svn.sh b/tools/checkout_svn.sh
new file mode 100755
index 0000000..5e405d2
--- /dev/null
+++ b/tools/checkout_svn.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+
+set -e
+
+echo "Checkout the SVN to the local directory."
+
+WORK_DIR=${1:-"$HOME"}
+
+SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
+source "$SCRIPTDIR/load_config.sh" $1 $2 $3
+
+if [[ `wget -S --spider $CURRENT_VERSION_URL  2>&1 | grep 'HTTP/1.1 404 Not 
Found'` ]]; then
+    # Create an empty folder named ${REMOTE_PATH} in the remote staging folder
+    svn mkdir -m "Create the directory for ${version} in staging." 
$CURRENT_VERSION_URL $CREDENTIALS
+fi
+
+# Create a subversion directory for openwhisk to stage all the packages
+rm -rf $OPENWHISK_SVN
+mkdir -p $OPENWHISK_SVN
+rm -rf $OPENWHISK_SVN/*
+
+cd $OPENWHISK_SVN
+
+# Make sure the folder $REMOTE_PATH is connected to the svn staging server.
+svn co $CURRENT_VERSION_URL $REMOTE_PATH
diff --git a/tools/package_source_code.sh b/tools/package_source_code.sh
index a67d05a..ae8e5fa 100755
--- a/tools/package_source_code.sh
+++ b/tools/package_source_code.sh
@@ -7,11 +7,6 @@ echo "Package the artifacts."
 SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
 source "$SCRIPTDIR/load_config.sh" $1 $2 $3
 
-# Create a subversion directory for openwhisk to stage all the packages
-rm -rf $OPENWHISK_SVN
-mkdir -p $CURRENT_VERSION_DIR
-rm -rf $CURRENT_VERSION_DIR/*
-
 # Clean up all the source code by excluding unnecessary files and folders
 # Remove all the hidden files and folder
 # Remove bin and build folders
diff --git a/tools/travis/package_source_code.sh 
b/tools/travis/package_source_code.sh
index ffcdc49..20a4870 100755
--- a/tools/travis/package_source_code.sh
+++ b/tools/travis/package_source_code.sh
@@ -13,10 +13,7 @@ SVN_PASSWORD=$3
 
 "$PARENTDIR/install_dependencies.sh"
 "$PARENTDIR/download_source_code.sh" $WORK_DIR
-
-if [ "$TRAVIS_EVENT_TYPE" == "push" ] ; then
-    "$PARENTDIR/clean_remote_stage_artifacts.sh" $SVN_USERNAME $SVN_PASSWORD
-fi
+"$PARENTDIR/checkout_svn.sh" $WORK_DIR $SVN_USERNAME $SVN_PASSWORD
 
 "$PARENTDIR/package_source_code.sh" $WORK_DIR $SVN_USERNAME $SVN_PASSWORD
 
diff --git a/tools/upload_artifacts.sh b/tools/upload_artifacts.sh
index 164d2fe..ffeb272 100755
--- a/tools/upload_artifacts.sh
+++ b/tools/upload_artifacts.sh
@@ -9,19 +9,7 @@ WORK_DIR=${1:-"$HOME"}
 SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
 source "$SCRIPTDIR/load_config.sh" $1 $2 $3
 
-if [[ `wget -S --spider $CURRENT_VERSION_URL  2>&1 | grep 'HTTP/1.1 200 OK'` 
]]; then
-    svn delete $CURRENT_VERSION_URL -m "Removing Apache OpenWhisk release 
${version} from staging." $CREDENTIALS
-fi
-
-# Create an empty folder named ${REMOTE_PATH} in the remote staging folder
-svn mkdir -m "Create the directory for ${version} in staging." 
$CURRENT_VERSION_URL $CREDENTIALS
-
-cd $OPENWHISK_SVN
-
-# Make sure the folder $REMOTE_PATH is connected to the svn staging server.
-svn co $CURRENT_VERSION_URL $REMOTE_PATH
-
-cd $REMOTE_PATH
+cd $OPENWHISK_SVN/$REMOTE_PATH
 
 svn add --force * $CREDENTIALS
 svn commit -m "Staging Apache OpenWhisk release ${version}." $CREDENTIALS

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

Reply via email to