You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2021/03/31 00:39:12 UTC

[tomee-tck] branch jakartaee9-tck updated: Script to update the Jakarta EE 9.1 TCK to the latest snapshot

This is an automated email from the ASF dual-hosted git repository.

dblevins pushed a commit to branch jakartaee9-tck
in repository https://gitbox.apache.org/repos/asf/tomee-tck.git


The following commit(s) were added to refs/heads/jakartaee9-tck by this push:
     new b717fb5  Script to update the Jakarta EE 9.1 TCK to the latest snapshot
b717fb5 is described below

commit b717fb5a15c577a409c44e165762b44afe5a34c7
Author: David Blevins <da...@gmail.com>
AuthorDate: Tue Mar 30 17:38:00 2021 -0700

    Script to update the Jakarta EE 9.1 TCK to the latest snapshot
---
 update91tck.sh | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)

diff --git a/update91tck.sh b/update91tck.sh
new file mode 100755
index 0000000..e6de021
--- /dev/null
+++ b/update91tck.sh
@@ -0,0 +1,80 @@
+#!/bin/bash
+#
+# This script will look for a more recent Jakarta EE 9.1 SNAPSHOT TCK
+# And download and install it onto your machine, then update the value
+# of the <jakartaee91.cts.home> element in ~/.m2/settings.xml
+#
+# It is safe to run this script repeatedly as a way to check for new TCKs
+#
+
+grep -q -m 1 jakartaee91.cts.home ~/.m2/settings.xml || {
+    echo "No <jakartaee91.cts.home> variable found in ~/.m2/settings.xml"
+    echo "This script requires you to have setup the EE 9.1 TCK at least once manually"
+    echo "See the README.adoc for further instructions"
+    exit 1
+}
+
+## Download the jakarta-jakartaeetckinfo.txt from Eclipse and get basic meta data
+TCKINFO="$(curl -s https://download.eclipse.org/ee4j/jakartaee-tck/jakartaee9-eftl/staged-910/jakarta-jakartaeetckinfo.txt)"
+DATESTAMP="$(echo "$TCKINFO" | grep 'date:' | perl -pe 's,.*date: (\d\d\d\d-\d\d-\d\d) (\d\d):(\d\d).*,$1.$2$3,')"
+URL="$(echo "$TCKINFO" | grep 'download.eclipse.org' | perl -pe 's,.*(://download.eclipse.org/[^ ]+\.zip).*,https$1,')"
+SHA="$(echo "$TCKINFO" | grep 'SHA256SUM' | perl -pe 's,.*SHA256SUM: ([0-9a-f]+).*,$1,')"
+NAME="$(echo "$TCKINFO" | grep 'Name:' | perl -pe 's,.*Name: *jakarta-([^ ]+)\.zip.*,$1,')"
+
+## Look at our existing tck setup to see where TCKs should be installed
+OLDTCK="$(grep jakartaee91.cts.home ~/.m2/settings.xml | perl -pe 's,.*home>([^<]+)<.*,$1,')"
+TCKDIR="$(dirname "$OLDTCK")"
+
+TCK="$NAME-$DATESTAMP"
+
+echo "Latest TCK
+NAME: $NAME
+DATE: $DATESTAMP
+URL:  $URL
+SHA:  $SHA
+DIR:  $TCKDIR
+"
+
+## Download the TCK if we have not
+[ -f "$TCKDIR/$TCK.zip" ] || (
+    echo "Downloading $TCK.zip"
+    cd "$TCKDIR" &&
+    curl "$URL" > "$TCK.zip"
+)
+
+echo "Downloaded $TCK.zip"
+
+## Extract the TCK if we have not
+[ -d "$TCKDIR/$TCK" ] || (
+    echo "Extracting to $TCKDIR/$TCK"
+    mkdir "$TCKDIR/$TCK" &&
+	cd "$TCKDIR/$TCK" &&
+	bsdtar --strip-components=1 -xf "../$TCK.zip"
+)
+
+echo "Extracted $TCK"
+
+## Download ant if we have not
+[ -f "$TCKDIR/apache-ant-1.10.9-bin.zip" ] || (
+    echo "Downloading ant"
+    cd "$TCKDIR" &&
+	curl -s -O https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.9-bin.zip
+)
+
+echo "Downloaded ant"
+
+## Extract ant into TCK if we have not
+[ -d "$TCKDIR/$TCK/tools/ant" ] || (
+    echo "Extracting ant $TCKDIR/$TCK/tools/ant"
+    mkdir -p "$TCKDIR/$TCK/tools/ant" &&
+	cd "$TCKDIR/$TCK/tools/ant" &&
+	bsdtar --strip-components=1 -xf "../../../apache-ant-1.10.9-bin.zip"
+)
+
+echo "Extracted ant"
+
+## Update jakartaee91.cts.home in ~/.m2/settings.xml
+perl -i -pe "s,(<jakartaee91.cts.home>)[^<]+<,\$1$TCKDIR/$TCK<," ~/.m2/settings.xml
+
+echo "Updated ~/.m2/settings.xml"
+