diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2015-05-01 10:54:12 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2015-05-06 09:29:30 +0200 |
commit | 52263372efe24ca0dae3405c7e0319f1b67288ce (patch) | |
tree | 81897ebfd7db03b3230425bf474d956cdee2a899 /scripts/jobs | |
parent | 9e1520af6e861b6e3e6a51c41ca053717a250953 (diff) | |
download | scala-52263372efe24ca0dae3405c7e0319f1b67288ce.tar.gz scala-52263372efe24ca0dae3405c7e0319f1b67288ce.tar.bz2 scala-52263372efe24ca0dae3405c7e0319f1b67288ce.zip |
[backport] Remove existing builds from private-repo before building a release.
Backport of 1a292c3d0fe10699837a02ffd8adc3ea4d3a6d22
Diffstat (limited to 'scripts/jobs')
-rwxr-xr-x | scripts/jobs/integrate/bootstrap | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/jobs/integrate/bootstrap b/scripts/jobs/integrate/bootstrap index 2ffab7983c..307deddbbe 100755 --- a/scripts/jobs/integrate/bootstrap +++ b/scripts/jobs/integrate/bootstrap @@ -476,6 +476,29 @@ deriveModuleVersions() { # PARTEST_IFACE_VER=${PARTEST_IFACE_VER-$(deriveVersion scala scala-partest-interface "$PARTEST_IFACE_REF")} } +createNetrcFile() { + local netrcFile=$HOME/`basename $1`-netrc + grep 'host=' $1 | sed 's/host=\(.*\)/machine \1/' > $netrcFile + grep 'user=' $1 | sed 's/user=\(.*\)/login \1/' >> $netrcFile + grep 'password=' $1 | sed 's/password=\(.*\)/password \1/' >> $netrcFile +} + +removeExistingBuilds() { + createNetrcFile "$HOME/.credentials-private-repo" + local netrcFile="$HOME/.credentials-private-repo-netrc" + + local storageApiUrl=`echo $releaseTempRepoUrl | sed 's/\(scala-release-temp\)/api\/storage\/\1/'` + local scalaLangModules=`curl -s $storageApiUrl/org/scala-lang | jq -r '.children | .[] | "org/scala-lang" + .uri'` + + for module in "org/scalacheck" $scalaLangModules; do + local artifacts=`curl -s $storageApiUrl/$module | jq -r ".children | .[] | select(.uri | contains(\"$SCALA_VER\")) | .uri"` + for artifact in $artifacts; do + echo "Deleting $releaseTempRepoUrl$module$artifact" + curl -s --netrc-file $netrcFile -X DELETE $releaseTempRepoUrl$module$artifact + done + done +} + constructUpdatedModuleVersions() { updatedModuleVersions=() @@ -606,6 +629,8 @@ determineScalaVersion deriveModuleVersions +removeExistingBuilds + bootstrap if [ "$publishToSonatype" == "yes" ] |