You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2019/01/01 14:46:22 UTC

[isis] branch release-1.17.0-RC2 updated: ISIS-1899: updates verify-isis-release.sh script

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

danhaywood pushed a commit to branch release-1.17.0-RC2
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/release-1.17.0-RC2 by this push:
     new 06f947a  ISIS-1899: updates verify-isis-release.sh script
06f947a is described below

commit 06f947ad7a0968c34d8e6941a77e12aa0196cd17
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Jan 1 14:46:08 2019 +0000

    ISIS-1899: updates verify-isis-release.sh script
---
 scripts/verify-isis-release.sh | 141 +++++++++++++++++++++++++++++------------
 1 file changed, 101 insertions(+), 40 deletions(-)

diff --git a/scripts/verify-isis-release.sh b/scripts/verify-isis-release.sh
index 0d7d95f..37a55b5 100755
--- a/scripts/verify-isis-release.sh
+++ b/scripts/verify-isis-release.sh
@@ -1,8 +1,20 @@
 #!/bin/bash
-# Instructions:
-# -Create an empty directory
-# -Put a url.txt file in it containing a list of all the urls of the zip files
-# -Run this script
+#
+# usage: ./verify_isis_release.sh [nexus_repo_number] [isis_version]
+#
+# where nexus_repo_number and isis_version are as advised in RC vote message.
+#
+#    eg: ./verify_isis_release.sh 1086 1.17.0
+#
+#
+# prereqs:
+#    curl or wget
+#    gpg
+#    unzip
+#    jdk 7
+#    mvn 3.5.0+
+#
+
 
 _execmustpass(){
     echo $@
@@ -11,7 +23,7 @@ _execmustpass(){
     if [ $status -eq 0 ] || [ $? -eq 0 ]; then
         return;
     fi
-    echo "Command $@ failed! [error $status] Exiting..."
+    echo "Command $@ failed! [error $status] Exiting..." >&2
     exit 10
 }
 
@@ -22,11 +34,11 @@ _execmayfail(){
     if [ $status -eq 0 ] || [ $? -eq 0 ]; then
         return;
     fi
-    echo "Command $@ failed! [error $status] But continuing anyway..."
+    echo "Command $@ failed! [error $status] But continuing anyway..." >&2
 }
 
 _download(){
-    for fil in `cat *.txt`
+    for fil in `cat /tmp/url.txt | grep -v ^#`
     do
         echo 'Downloading '$fil
         _execmustpass $download_cmd $fil
@@ -36,9 +48,9 @@ _download(){
 
 _verify(){
     for zip in *.zip
-    do 
-        echo 'Verifying '$zip   
-        _execmustpass gpg --verify $zip.asc $zip 
+    do
+        echo 'Verifying '$zip
+        _execmustpass gpg --verify $zip.asc $zip
     done
 }
 
@@ -49,60 +61,109 @@ _unpack(){
     set +f
 }
 
-_fetch_dependencies(){
-    _execmayfail mvn dependency:go-offline
-}
-
 _build(){
     echo 'Removing Isis from local repo '$module
     rm -rf ~/.m2/repository/org/apache/isis
     for module in ./isis*/ ./*archetype*/
     do
-        cd $module
-        grep -q "Isis Core" pom.xml
-        retcode=$?
-        if [  $retcode -eq 0 ]
-        then
-            echo 'Building Core '$module
-            _fetch_dependencies
-            _execmustpass mvn clean install -o
-        else
-            echo 'Building Module '$module
-            _execmustpass mvn clean install $offline
-        fi
-		cd ..
+        pushd $module
+        _execmustpass mvn clean install -Dskip.git
+	    popd
     done
 }
 
-if [[ $@ == *online* ]]
-then
-    echo "Enabling online mode."
-	offline=
-else
-    echo "Enabling offline mode. Use '$0 --online' to use online mode."
-	offline=-o
-fi
+_generate_simpleapp(){
+    ISISCPN=simpleapp
+    rm -rf test-$ISISCPN
+    mkdir test-$ISISCPN
+    pushd test-$ISISCPN
+
+    _execmustpass mvn archetype:generate  \
+        -D archetypeCatalog=local \
+        -D groupId=com.mycompany \
+        -D artifactId=myapp \
+        -D archetypeGroupId=org.apache.isis.archetype \
+        -D archetypeArtifactId=$ISISCPN-archetype \
+        -B
+
+    pushd myapp
+    _execmustpass mvn clean install
+    popd; popd
+}
+
+_generate_helloworld(){
+    ISISCPN=helloworld
+    rm -rf test-$ISISCPN
+    mkdir test-$ISISCPN
+    pushd test-$ISISCPN
+
+    _execmustpass mvn archetype:generate  \
+        -D archetypeCatalog=local \
+        -D groupId=com.mycompany \
+        -D artifactId=myapp \
+        -D archetypeGroupId=org.apache.isis.archetype \
+        -D archetypeArtifactId=$ISISCPN-archetype \
+        -B
+
+    pushd myapp
+    _execmustpass mvn clean install
+    popd; popd
+}
+
 
 # check the environment
 # Check for curl or wget
 download_cmd=
 curl --version > /dev/null 2>&1
 if [[ $? -eq 0 ]]; then
-    download_cmd=curl -L -O
-fi 
+    download_cmd="curl -L -O"
+fi
 if [[ -z "$download_cmd" ]]; then
     wget --version > /dev/null 2>&1
     if [[ $? -eq 0 ]]; then
         download_cmd=wget
     else
-        echo "No downloader found.. exitting.."
+        echo "No downloader found.. exiting.."
         exit 11
-    fi 
+    fi
 fi
 
-# The work starts here 
+NEXUSREPONUM=$1
+shift
+VERSION=$1
+shift
+
+if [[ -z "$NEXUSREPONUM" || -z "$VERSION" ]]; then
+    echo "usage: `basename $0` [nexus_repo_number] [isis_version]" >&2
+    exit 1
+fi
+
+cat <<EOF >/tmp/url.txt
+http://repository.apache.org/content/repositories/orgapacheisis-$NEXUSREPONUM/org/apache/isis/core/isis/$VERSION/isis-$VERSION-source-release.zip
+http://repository.apache.org/content/repositories/orgapacheisis-$NEXUSREPONUM/org/apache/isis/archetype/helloworld-archetype/$VERSION/helloworld-archetype-$VERSION-source-release.zip
+http://repository.apache.org/content/repositories/orgapacheisis-$NEXUSREPONUM/org/apache/isis/archetype/simpleapp-archetype/$VERSION/simpleapp-archetype-$VERSION-source-release.zip
+EOF
+
+# The work starts here
 _download
 _verify
 _unpack
 _build
+_generate_simpleapp
+_generate_helloworld
+
+# print instructions for final testing
+clear
+cat <<EOF
+
+# Test out simpleapp using:
+pushd test-simpleapp/myapp
+mvn -pl webapp jetty:run
+popd
+
+# Test out helloworld using:
+pushd test-helloworld/myapp
+mvn jetty:run
+popd
 
+EOF
\ No newline at end of file