

It will also report if it was successful at downloading it or not. This is downloading everything and preserving the folder structure so later you can upload everything using Maven (assuming Maven2 repo). # = DOWNLOAD EVERYTHING =Įcho Successfully downloaded artifact: $url | tee -a $logfile 2>&1Įcho ERROR: Failed to download artifact: $url with error code: $responseCode | tee -a $logfile 2>&1 so you can loop through the lines of the output file and download them using curl. You can use curl to retrieve a list of all your artifacts download URLs by executing: curFolder=`pwd`Īrtifacts=( $(echo $response | sed -n 's|.*"downloadUrl" : "\(*\)".*|\1|p') )Ĭat artifacts.temp | grep "$filter" > $outputFileĪt this point you have all the artifacts filtered out from sha1 and md5 files, metadata etc. Sed 's///g' artifacts2.temp > artifacts3.tempĬat artifacts3.temp | grep "$sourceFolder" > $outputFile Sed 's/,//g' artifacts1.temp > artifacts2.temp


Urls=($(cat $outputFile)) > /dev/null 2>&1Ĭurl -vks -u "$sourceUser:$sourcePassword" -D response.header -X GET "$url" -O > /dev/null 2>&1 # cat artifacts.temp | grep "$filter" > $outputFileĬontToken=( $(echo $response | sed -n 's|.*"continuationToken" : "\(*\)".*|\1|p') ) Sed 's///g' artifacts.temp > artifacts1.temp Sed 's/,//g' artifacts1.temp > artifacts.temp Sed 's/\"//g' artifacts.temp > artifacts1.temp Response=`curl -ksSL -u "$sourceUser:$sourcePassword" -X GET -header 'Accept: application/json' "$url"` Url=$sourceServer"/service/rest/v1/assets?continuationToken="$contToken"&repository="$sourceRepoĮcho Processing repository token: $contToken | tee -a $logfile Url=$sourceServer"/service/rest/v1/assets?repository="$sourceRepo I know one issue is that the very first download this script initiates is put in the wrong directory.

This script is by no means perfect and you may need to edit it. I slightly modified it and posted it below. The script above really helped me with this issue.
