aboutsummaryrefslogtreecommitdiffstats
path: root/screwdriver/update-vespa-version-in-sample-apps.sh
diff options
context:
space:
mode:
authorArnstein Ressem <aressem@yahooinc.com>2022-04-07 11:41:19 +0200
committerArnstein Ressem <aressem@yahooinc.com>2022-04-07 11:41:19 +0200
commit5abc0a714362bc7f67ff8b74f55e896e73ad6aae (patch)
tree15b3153b48d9d5f3ac6180d57307f6c6780a8320 /screwdriver/update-vespa-version-in-sample-apps.sh
parent87b9dcc76a9b33f8b456d53c9aa9e19e89645ee1 (diff)
Make sure a Java sample app is compilable with released version before updating version in sample apps.
Diffstat (limited to 'screwdriver/update-vespa-version-in-sample-apps.sh')
-rwxr-xr-xscrewdriver/update-vespa-version-in-sample-apps.sh24
1 files changed, 13 insertions, 11 deletions
diff --git a/screwdriver/update-vespa-version-in-sample-apps.sh b/screwdriver/update-vespa-version-in-sample-apps.sh
index dbcb5d46c3a..ca163de347c 100755
--- a/screwdriver/update-vespa-version-in-sample-apps.sh
+++ b/screwdriver/update-vespa-version-in-sample-apps.sh
@@ -10,23 +10,25 @@ if [[ $# -ne 1 ]]; then
fi
readonly VESPA_RELEASE="$1"
-readonly TRUE="true"
-readonly FALSE="false"
-
export JAVA_HOME=$(dirname $(dirname $(readlink -f /usr/bin/java)))
function is_published {
- BUNDLE_PLUGIN_HTTP_CODE=$(curl --write-out %{http_code} --silent --location --output /dev/null https://repo.maven.apache.org/maven2/com/yahoo/vespa/bundle-plugin/${VESPA_RELEASE}/)
- if [ $BUNDLE_PLUGIN_HTTP_CODE = "200" ] ; then
- echo "$TRUE"
+ local TMP_MVN_REPO=/tmp/maven-repo
+ echo $TMP_MVN_REPO
+ mkdir -p $TMP_MVN_REPO
+ rm -rf $TMP_MVN_REPO/com/yahoo/vespa
+ # Because the transfer of artifacts to Maven Central is not atomic we can't just check a simple pom or jar to be available. Because of this we
+ # check that the publication is complete enough to compile a Java sample app
+ if mvn -V -B -pl ai.vespa.example:albums -Dmaven.repo.local=$TMP_MVN_REPO -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -DskipTests clean package; then
+ return 0
else
- echo "$FALSE"
+ return 1
fi
}
function wait_until_published {
cnt=0
- until [[ $(is_published) = "$TRUE" ]]; do
+ until is_published; do
((cnt+=1))
# Wait max 60 minutes
if (( $cnt > 60 )); then
@@ -38,8 +40,6 @@ function wait_until_published {
done
}
-wait_until_published
-
ssh-add -D
set +x
ssh-add <(echo $SAMPLE_APPS_DEPLOY_KEY | base64 -d)
@@ -49,7 +49,9 @@ git clone git@github.com:vespa-engine/sample-apps.git
cd sample-apps
# Update Vespa version property in pom.xml
-mvn versions:set-property -Dproperty=vespa_version -DnewVersion=${VESPA_RELEASE}
+mvn -V -B versions:set-property -Dproperty=vespa_version -DnewVersion=${VESPA_RELEASE}
+
+wait_until_published
changes=$(git status --porcelain | wc -l)