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 3d24c63  Move the artifacts from stage to release (#31)
3d24c63 is described below

commit 3d24c630eb5c0bfe70fd3f35834ea78251a85807
Author: Vincent <s...@us.ibm.com>
AuthorDate: Mon Feb 12 14:08:35 2018 -0500

    Move the artifacts from stage to release (#31)
    
    This PR enables this repository with the functionality to move the
    artifacts from the staging folder to the release folder.
    
    Closes: #22
---
 Dockerfile                                         |  2 --
 ...ifacts.sh => clean_remote_release_artifacts.sh} | 11 ++++------
 tools/config.json                                  |  1 +
 ...emote_artifacts.sh => move_stage_to_release.sh} | 15 +++++++++-----
 tools/package_source_code.sh                       |  5 -----
 tools/travis/package_source_code.sh                |  2 +-
 tools/upload_artifacts.sh                          | 24 ++++++++++++++++++++--
 7 files changed, 38 insertions(+), 22 deletions(-)

diff --git a/Dockerfile b/Dockerfile
deleted file mode 100644
index 2679754..0000000
--- a/Dockerfile
+++ /dev/null
@@ -1,2 +0,0 @@
-FROM ubuntu
-RUN echo "Hello, Docker setup!" > hello.txt
\ No newline at end of file
diff --git a/tools/clean_remote_artifacts.sh 
b/tools/clean_remote_release_artifacts.sh
similarity index 78%
copy from tools/clean_remote_artifacts.sh
copy to tools/clean_remote_release_artifacts.sh
index 8e31d97..258f8e2 100755
--- a/tools/clean_remote_artifacts.sh
+++ b/tools/clean_remote_release_artifacts.sh
@@ -2,7 +2,7 @@
 
 set -e
 
-echo "Clean the remote artifacts"
+echo "Clean the remote artifacts in release directory"
 
 SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
 source "$SCRIPTDIR/util.sh"
@@ -14,8 +14,8 @@ version_minor=$(json_by_key "$CONFIG" ${version_key}.minor)
 
 version=$version_major-$version_minor
 REMOTE_PATH="openwhisk-$version"
-STAGE_URL=$(json_by_key "$CONFIG" "stage_url")
-CURRENT_VERSION_URL="$STAGE_URL/${REMOTE_PATH}/"
+RELEASE_URL=$(json_by_key "$CONFIG" "release_url")
+CURRENT_VERSION_URL="$RELEASE_URL/${REMOTE_PATH}/"
 CREDENTIALS=""
 
 SVN_USERNAME=$1
@@ -26,8 +26,5 @@ if [ ! -z "$SVN_USERNAME" ] && [ ! -z "$SVN_PASSWORD" ];then
 fi
 
 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
+    svn delete $CURRENT_VERSION_URL -m "Removing Apache OpenWhisk release 
${version}." $CREDENTIALS
 fi
-
-
-
diff --git a/tools/config.json b/tools/config.json
index 5b9e217..ed25132 100644
--- a/tools/config.json
+++ b/tools/config.json
@@ -1,5 +1,6 @@
 {
   "stage_url": "https://dist.apache.org/repos/dist/dev/incubator/openwhisk";,
+  "release_url": 
"https://dist.apache.org/repos/dist/release/incubator/openwhisk";,
   "version": {
     "major": "incubator",
     "minor": "rc1"
diff --git a/tools/clean_remote_artifacts.sh b/tools/move_stage_to_release.sh
similarity index 61%
rename from tools/clean_remote_artifacts.sh
rename to tools/move_stage_to_release.sh
index 8e31d97..5e5b24a 100755
--- a/tools/clean_remote_artifacts.sh
+++ b/tools/move_stage_to_release.sh
@@ -2,7 +2,7 @@
 
 set -e
 
-echo "Clean the remote artifacts"
+echo "Move the remote artifacts from staging to release directory."
 
 SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
 source "$SCRIPTDIR/util.sh"
@@ -15,7 +15,11 @@ version_minor=$(json_by_key "$CONFIG" ${version_key}.minor)
 version=$version_major-$version_minor
 REMOTE_PATH="openwhisk-$version"
 STAGE_URL=$(json_by_key "$CONFIG" "stage_url")
+RELEASE_URL=$(json_by_key "$CONFIG" "release_url")
+
 CURRENT_VERSION_URL="$STAGE_URL/${REMOTE_PATH}/"
+RELEASE_VERSION_URL="$RELEASE_URL/${REMOTE_PATH}/"
+
 CREDENTIALS=""
 
 SVN_USERNAME=$1
@@ -25,9 +29,10 @@ if [ ! -z "$SVN_USERNAME" ] && [ ! -z "$SVN_PASSWORD" ];then
     CREDENTIALS="--username $SVN_USERNAME --password $SVN_PASSWORD 
--non-interactive"
 fi
 
-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
+if [[ `wget -S --spider $RELEASE_VERSION_URL  2>&1 | grep 'HTTP/1.1 200 OK'` 
]]; then
+    svn delete $RELEASE_VERSION_URL -m "Removing Apache OpenWhisk release 
${version}." $CREDENTIALS
 fi
 
-
-
+if [[ `wget -S --spider $CURRENT_VERSION_URL  2>&1 | grep 'HTTP/1.1 200 OK'` 
]]; then
+    svn copy $CURRENT_VERSION_URL $RELEASE_URL -m "Releasing Apache OpenWhisk 
release ${version}." $CREDENTIALS
+fi
diff --git a/tools/package_source_code.sh b/tools/package_source_code.sh
index d97ad5d..fa1c136 100755
--- a/tools/package_source_code.sh
+++ b/tools/package_source_code.sh
@@ -35,10 +35,6 @@ echo $STAGE_URL
 
 # Create a subversion directory for openwhisk to stage all the packages
 rm -rf $OPENWHISK_SVN
-
-mkdir -p $OPENWHISK_SOURCE_DIR
-cd $OPENWHISK_SOURCE_DIR
-svn co $STAGE_URL $OPENWHISK_SVN $CREDENTIALS
 mkdir -p $CURRENT_VERSION_DIR
 rm -rf $CURRENT_VERSION_DIR/*
 
@@ -56,4 +52,3 @@ do
         cp -a build/. $CURRENT_VERSION_DIR
     fi
 done
-
diff --git a/tools/travis/package_source_code.sh 
b/tools/travis/package_source_code.sh
index 04bdb80..e09b021 100755
--- a/tools/travis/package_source_code.sh
+++ b/tools/travis/package_source_code.sh
@@ -15,7 +15,7 @@ SVN_PASSWORD=$3
 "$PARENTDIR/download_source_code.sh" $WORK_DIR
 
 if [ "$TRAVIS_EVENT_TYPE" == "push" ] ; then
-    "$PARENTDIR/clean_remote_artifacts.sh" $SVN_USERNAME $SVN_PASSWORD
+    "$PARENTDIR/clean_remote_stage_artifacts.sh" $SVN_USERNAME $SVN_PASSWORD
 fi
 
 "$PARENTDIR/package_source_code.sh" $WORK_DIR $SVN_USERNAME $SVN_PASSWORD
diff --git a/tools/upload_artifacts.sh b/tools/upload_artifacts.sh
index 821865a..2b58ecf 100755
--- a/tools/upload_artifacts.sh
+++ b/tools/upload_artifacts.sh
@@ -21,13 +21,33 @@ SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
 source "$SCRIPTDIR/util.sh"
 
 CONFIG=$(read_file $SCRIPTDIR/config.json)
+STAGE_URL=$(json_by_key "$CONFIG" "stage_url")
+
 version_key="version"
 version_major=$(json_by_key "$CONFIG" ${version_key}.major)
 version_minor=$(json_by_key "$CONFIG" ${version_key}.minor)
 
 version=$version_major-$version_minor
-CURRENT_VERSION_DIR="$OPENWHISK_SVN/openwhisk-$version"
+REMOTE_PATH="openwhisk-$version"
+
+CURRENT_VERSION_URL="$STAGE_URL/${REMOTE_PATH}/"
+
+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
 
 cd $OPENWHISK_SVN
-svn add --force "openwhisk-$version" $CREDENTIALS
+
+# Make sure the folder $REMOTE_PATH is connected to the svn staging server.
+svn co $CURRENT_VERSION_URL $REMOTE_PATH
+
+cd $REMOTE_PATH
+
+svn add --force * $CREDENTIALS
 svn commit -m "Staging Apache OpenWhisk release ${version}." $CREDENTIALS
+
+# Disconnect $REMOTE_PATH with the remote staging server.
+rm -rf .svn

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

Reply via email to