Upload raw files recuresively with path 61/19161/1
authorLusheng Ji <lji@research.att.com>
Tue, 17 Oct 2017 02:14:08 +0000 (22:14 -0400)
committerLusheng Ji <lji@research.att.com>
Tue, 17 Oct 2017 02:14:41 +0000 (22:14 -0400)
Issue-Id: DCAEGEN2-128
Change-Id: I05c7ab91828224ccf87326c8980c2459290c56dc
Signed-off-by: Lusheng Ji <lji@research.att.com>
mvn-phase-lib.sh
mvn-phase-script.sh
scripts/cloud_init/cdap-init.sh [moved from scripts/cdap-init.sh with 100% similarity]
scripts/cloud_init/instconsulagentub16.sh [moved from scripts/instconsulagentub16.sh with 100% similarity]

index b9e764c..8854944 100755 (executable)
@@ -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() 
index 945fccc..db190e0 100755 (executable)
@@ -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"