![]() 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 ![]() Removing the output file if it exists when you do consecutive runs.Setting the curFolder to the result of pwd.Preserving spaces in the URLs and converting to %20 for download.Taking back a simple filter (for e g a sub-folder).I am a little bit intrigued by the fact that there is no "download all files in a folder" in the REST API ResponseCode=`cat response.header | sed -n '1p' | cut -d' ' -f2`Įcho Successfully downloaded artifact: $urlĮcho ERROR: Failed to download artifact: $url with error code: $responseCode 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. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |