houshengbo closed pull request #66: Remove the redundant configuration loadings
URL: https://github.com/apache/incubator-openwhisk-release/pull/66
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/tools/checkout_svn.sh b/tools/checkout_svn.sh
index e08003e..d0c2d54 100755
--- a/tools/checkout_svn.sh
+++ b/tools/checkout_svn.sh
@@ -23,7 +23,7 @@ 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
+#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
diff --git a/tools/download_source_code.sh b/tools/download_source_code.sh
index f019e4e..a392be9 100755
--- a/tools/download_source_code.sh
+++ b/tools/download_source_code.sh
@@ -21,7 +21,15 @@ set -e
 WORK_DIR=${1:-"$HOME"}
 
 SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
-source "$SCRIPTDIR/load_config.sh" $1
+
+if [[ "$CONFIG_LOADED" != "true" ]]; then
+    echo "reload config."
+    echo "$CONFIG_LOADED"
+    source "$SCRIPTDIR/load_config.sh" $1 $2 $3
+else
+    echo "already loaded config."
+    echo "$CONFIG_LOADED"
+fi
 
 clone_depth=${2:-"100"}
 
diff --git a/tools/load_config.sh b/tools/load_config.sh
index 43b233d..e04ea0d 100755
--- a/tools/load_config.sh
+++ b/tools/load_config.sh
@@ -17,10 +17,14 @@
 #
 
 WORK_DIR=${1:-"$HOME"}
-SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
+DIR="$(cd $(dirname "$0")/ && pwd)"
 
 SVN_USERNAME=$2
 SVN_PASSWORD=$3
+
+
+SCRIPTDIR=${4:-"$DIR"}
+echo "4 is $4"
 CREDENTIALS=""
 
 if [ ! -z "$SVN_USERNAME" ] && [ ! -z "$SVN_PASSWORD" ];then
@@ -32,6 +36,7 @@ 
OPENWHISK_SOURCE_DIR="$OPENWHISK_RELEASE_DIR/openwhisk_sources"
 OPENWHISK_CLEANED_SOURCE_DIR="$OPENWHISK_RELEASE_DIR/openwhisk_cleaned_sources"
 OPENWHISK_SVN="$OPENWHISK_RELEASE_DIR/openwhisk"
 
+echo "SCRIPTDIR is $SCRIPTDIR"
 source "$SCRIPTDIR/util.sh"
 
 CONFIG=$(read_file $SCRIPTDIR/config.json)
@@ -47,3 +52,5 @@ REMOTE_PATH="openwhisk-$version"
 
 CURRENT_VERSION_URL="$STAGE_URL/${REMOTE_PATH}/"
 CURRENT_VERSION_DIR="$OPENWHISK_SVN/openwhisk-$version"
+
+CONFIG_LOADED="true"
diff --git a/tools/package_source_code.sh b/tools/package_source_code.sh
index d04307a..89d43ce 100755
--- a/tools/package_source_code.sh
+++ b/tools/package_source_code.sh
@@ -21,7 +21,7 @@ set -e
 echo "Package the artifacts."
 
 SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
-source "$SCRIPTDIR/load_config.sh" $1 $2 $3
+#source "$SCRIPTDIR/load_config.sh" $1 $2 $3
 
 # Clean up all the source code by excluding unnecessary files and folders
 # Remove all the hidden files and folder
diff --git a/tools/sign_artifacts.sh b/tools/sign_artifacts.sh
index e2a1975..ede2e97 100755
--- a/tools/sign_artifacts.sh
+++ b/tools/sign_artifacts.sh
@@ -21,10 +21,10 @@ set -e
 echo "Sign the artifacts with PGP."
 
 WORK_DIR=${1:-"$HOME"}
-passphrase=${2:-"openwhisk"}
 
 SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
-source "$SCRIPTDIR/load_config.sh" $1
+#source "$SCRIPTDIR/load_config.sh" $1 $2 $3
+passphrase="openwhisk"
 
 # Sign all the artifacts with the PGP key.
 export GPG_TTY=$(tty)
diff --git a/tools/travis/package_source_code.sh 
b/tools/travis/package_source_code.sh
index aa0585d..a6695b6 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
 
-"$PARENTDIR/install_dependencies.sh"
-"$PARENTDIR/download_source_code.sh" $WORK_DIR
+echo "PARENTDIR is $PARENTDIR"
+source "$PARENTDIR/load_config.sh" $WORK_DIR $SVN_USERNAME $SVN_PASSWORD 
$PARENTDIR
+
+#"$PARENTDIR/install_dependencies.sh"
+"$PARENTDIR/download_source_code.sh" $WORK_DIR $SVN_USERNAME $SVN_PASSWORD
 "$PARENTDIR/checkout_svn.sh" $WORK_DIR $SVN_USERNAME $SVN_PASSWORD
 
 "$PARENTDIR/package_source_code.sh" $WORK_DIR $SVN_USERNAME $SVN_PASSWORD
 
 if [ "$TRAVIS_EVENT_TYPE" == "push" ] ; then
     "$SCRIPTDIR/import_pgp_key.sh"
-    "$PARENTDIR/sign_artifacts.sh" $WORK_DIR
+    "$PARENTDIR/sign_artifacts.sh" $WORK_DIR $SVN_USERNAME $SVN_PASSWORD
     "$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 $SVN_USERNAME $SVN_PASSWORD
diff --git a/tools/upload_artifacts.sh b/tools/upload_artifacts.sh
index 2f0e66a..df8b37c 100755
--- a/tools/upload_artifacts.sh
+++ b/tools/upload_artifacts.sh
@@ -23,7 +23,7 @@ echo "Upload the artifacts."
 WORK_DIR=${1:-"$HOME"}
 
 SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
-source "$SCRIPTDIR/load_config.sh" $1 $2 $3
+#source "$SCRIPTDIR/load_config.sh" $1 $2 $3
 
 cd $OPENWHISK_SVN/$REMOTE_PATH
 
diff --git a/tools/verify_source_code.sh b/tools/verify_source_code.sh
index 32b0b41..a559570 100755
--- a/tools/verify_source_code.sh
+++ b/tools/verify_source_code.sh
@@ -21,8 +21,7 @@ echo "Generate the report regarding the source code headers."
 WORK_DIR=${1:-"$HOME"}
 
 SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
-source "$SCRIPTDIR/load_config.sh" $1
-PARENTDIR="$(dirname "$SCRIPTDIR")"
+#source "$SCRIPTDIR/load_config.sh" $1
 
 # run Apache rat to check headers
 cd $OPENWHISK_SOURCE_DIR


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to