raw repo push path and content type fixes 33/9933/1
authorAndrew Gauld <ag1282@att.com>
Fri, 1 Sep 2017 16:05:51 +0000 (12:05 -0400)
committerAndrew Gauld <ag1282@att.com>
Fri, 1 Sep 2017 16:07:23 +0000 (12:07 -0400)
Change-Id: Ie50b637786804e9c327d0af91b7c936a7df15731
Issue-Id: CCSDK-66
Signed-off-by: Andrew Gauld <ag1282@att.com>
mvn-phase-script.sh

index 51d1b28..cce6392 100755 (executable)
@@ -23,7 +23,7 @@ echo "=> Prepare environment "
 
 # This is the base for where "deploy" will upload
 # MVN_NEXUSPROXY is set in the pom.xml
-REPO=$MVN_NEXUSPROXY/content/sites/raw
+REPO=$MVN_NEXUSPROXY/content/sites/raw/$MVN_PROJECT_GROUPID
 
 TIMESTAMP=$(date +%C%y%m%dT%H%M%S)
 export BUILD_NUMBER="${TIMESTAMP}"
@@ -98,17 +98,17 @@ deploy)
     hostport=$(echo $1 | cut -f3 -d /)
     host=$(echo $hostport | cut -f1 -d:)
     settings=${SETTINGS_FILE:-$HOME/.m2/settings.xml}
-    ( echo machine $host; echo login $(xpath -q -e "//servers/server[id='$MVN_SERVER_ID']/username/text()" $settings); echo password $(xpath -q -e "//servers/server[id='$MVN_SERVER_ID']/password/text()" $settings) ) >$HOME/.netrc
+    echo machine $host login $(xpath -q -e "//servers/server[id='$MVN_SERVER_ID']/username/text()" $settings) password $(xpath -q -e "//servers/server[id='$MVN_SERVER_ID']/password/text()" $settings) >$HOME/.netrc
     chmod 600 $HOME/.netrc
     set -x
   }
   function putraw {
-    curl -X PUT -H "Content-Type: text/plain" --netrc --upload-file $1 --url $REPO/$2
+    curl -X PUT -H "Content-Type: $3" --netrc --upload-file $1 --url $REPO/$2
   }
   setnetrc $REPO
   PLUGIN_FILE=$(echo $PLUGIN_NAME-*.wgn)
-  putraw $PLUGIN_FILE plugins/$PLUGIN_FILE
-  putraw $TYPE_FILE_SOURCE $TYPE_FILE_DEST
+  putraw $PLUGIN_FILE plugins/$PLUGIN_FILE application/gzip
+  putraw $TYPE_FILE_SOURCE $TYPE_FILE_DEST text/x-yaml
   set +e +x
   ;;
 *)