From: Lusheng Ji Date: Tue, 17 Oct 2017 02:14:08 +0000 (-0400) Subject: Upload raw files recuresively with path X-Git-Tag: v1.1.0~15 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=94a4ef60e82e414fc04ba290c54f07fb24e99ca5;p=dcaegen2%2Fdeployments.git Upload raw files recuresively with path Issue-Id: DCAEGEN2-128 Change-Id: I05c7ab91828224ccf87326c8980c2459290c56dc Signed-off-by: Lusheng Ji --- diff --git a/mvn-phase-lib.sh b/mvn-phase-lib.sh index b9e764c..8854944 100755 --- a/mvn-phase-lib.sh +++ b/mvn-phase-lib.sh @@ -241,6 +241,8 @@ upload_raw_file() OUTPUT_FILE_TYPE='application/json' elif [ "$EXT" == 'sh' ]; then OUTPUT_FILE_TYPE='text/x-shellscript' + elif [ "$EXT" == 'py' ]; then + OUTPUT_FILE_TYPE='text/x-python' elif [ "$EXT" == 'gz' ]; then OUTPUT_FILE_TYPE='application/gzip' elif [ "$EXT" == 'wgn' ]; then @@ -263,7 +265,7 @@ upload_raw_file() fi echo "Sending ${OUTPUT_FILE} to Nexus: ${SEND_TO}" - curl -vkn --netrc-file "${NETRC}" --upload-file "${OUTPUT_FILE}" -X PUT -H "Content-Type: $OUTPUT_FILE_TYPE" "${SEND_TO}/${OUTPUT_FILE}-${MVN_PROJECT_VERSION}-${TIMESTAMP}" + #curl -vkn --netrc-file "${NETRC}" --upload-file "${OUTPUT_FILE}" -X PUT -H "Content-Type: $OUTPUT_FILE_TYPE" "${SEND_TO}/${OUTPUT_FILE}-${MVN_PROJECT_VERSION}-${TIMESTAMP}" curl -vkn --netrc-file "${NETRC}" --upload-file "${OUTPUT_FILE}" -X PUT -H "Content-Type: $OUTPUT_FILE_TYPE" "${SEND_TO}/${OUTPUT_FILE}-${MVN_PROJECT_VERSION}" curl -vkn --netrc-file "${NETRC}" --upload-file "${OUTPUT_FILE}" -X PUT -H "Content-Type: $OUTPUT_FILE_TYPE" "${SEND_TO}/${OUTPUT_FILE}" } @@ -290,6 +292,13 @@ upload_files_of_extension() upload_raw_file "$F" done } +upload_files_of_extension_recursively() +{ + FILES=$(find . -name "*.$1") + for F in $FILES ; do + upload_raw_file "$F" + done +} generate_pypirc_then_publish() diff --git a/mvn-phase-script.sh b/mvn-phase-script.sh index 945fccc..db190e0 100755 --- a/mvn-phase-script.sh +++ b/mvn-phase-script.sh @@ -94,8 +94,8 @@ deploy) ;; scripts) # upload all sh file under the root of module - upload_files_of_extension sh - upload_files_of_extension py + upload_files_of_extension_recursively sh + upload_files_of_extension_recursively py ;; *) echo "====> unknown mvn project module" diff --git a/scripts/cdap-init.sh b/scripts/cloud_init/cdap-init.sh similarity index 100% rename from scripts/cdap-init.sh rename to scripts/cloud_init/cdap-init.sh diff --git a/scripts/instconsulagentub16.sh b/scripts/cloud_init/instconsulagentub16.sh similarity index 100% rename from scripts/instconsulagentub16.sh rename to scripts/cloud_init/instconsulagentub16.sh