Skip to content

Commit f9d592c

Browse files
committed
ci-build.sh: move cache invalidation to post-build
Let's do it after any deploy, even a snapshot.
1 parent a08f411 commit f9d592c

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

ci-build.sh

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -198,17 +198,6 @@ EOL
198198
echo "== Cutting and deploying release version =="
199199
mvn $BUILD_ARGS release:perform
200200
checkSuccess $?
201-
202-
echo "== Invalidating SciJava Maven repository cache =="
203-
curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/bdd932af4c4816f88cb6a52cdd7449f175934634/maven-helper.sh &&
204-
gav=$(sh maven-helper.sh gav-from-pom pom.xml) &&
205-
ga=${gav%:*} &&
206-
echo "--> Artifact to invalidate = $ga" &&
207-
echo "machine maven.scijava.org" >"$HOME/.netrc" &&
208-
echo " login $MAVEN_USER" >>"$HOME/.netrc" &&
209-
echo " password $MAVEN_PASS" >>"$HOME/.netrc" &&
210-
sh maven-helper.sh invalidate-cache "$ga"
211-
checkSuccess $?
212201
elif [ "$deployOK" ]; then
213202
echo
214203
echo "== Building and deploying main branch SNAPSHOT =="
@@ -223,6 +212,20 @@ EOL
223212

224213
# --== POST-BUILD ACTIONS ==--
225214

215+
if [ "$deployOK" -a "$success" -eq 0 ]; then
216+
echo
217+
echo "== Invalidating SciJava Maven repository cache =="
218+
curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/bdd932af4c4816f88cb6a52cdd7449f175934634/maven-helper.sh &&
219+
gav=$(sh maven-helper.sh gav-from-pom pom.xml) &&
220+
ga=${gav%:*} &&
221+
echo "--> Artifact to invalidate = $ga" &&
222+
echo "machine maven.scijava.org" >"$HOME/.netrc" &&
223+
echo " login $MAVEN_USER" >>"$HOME/.netrc" &&
224+
echo " password $MAVEN_PASS" >>"$HOME/.netrc" &&
225+
sh maven-helper.sh invalidate-cache "$ga"
226+
checkSuccess $?
227+
fi
228+
226229
echo ::endgroup::
227230
fi
228231

0 commit comments

Comments
 (0)