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

shuber pushed a commit to branch unomi-1.3.x
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/unomi-1.3.x by this push:
     new 450d525e1 Backport UNOMI-721 & UNOMI-126
450d525e1 is described below

commit 450d525e1de71cf61f893c696258507317373061
Author: Serge Huber <[email protected]>
AuthorDate: Wed Dec 7 17:23:07 2022 +0100

    Backport UNOMI-721 & UNOMI-126
---
 generate-site-and-upload.sh | 51 +++++++++++++++++++++++++++++-------
 generate-site.sh            | 48 ++++++++++++++++++++++++++++++----
 release-stage-1.sh          | 55 +++++++++++++++++++++++++++++++++++++++
 release-stage-2.sh          | 63 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 202 insertions(+), 15 deletions(-)

diff --git a/generate-site-and-upload.sh b/generate-site-and-upload.sh
index ac0e59188..debe3563e 100755
--- a/generate-site-and-upload.sh
+++ b/generate-site-and-upload.sh
@@ -17,16 +17,47 @@
 #    limitations under the License.
 #
 
################################################################################
-if [ $# -ne 2 ]
+if [ $# -ne 4 ]
   then
-    echo "Illegal number of arguments supplied. Syntax should be 
generate-site-and-upload.sh SVNusername SVNpassword"
+    echo "Illegal number of arguments supplied. Syntax should be 
generate-site-and-upload.sh X_X_X X.X.X SVNusername SVNpassword "
+    echo "Example: ./generate-site-and-upload.sh 2_0_x 2.0.1 user password"
     exit 1
 fi
-echo Generating site...
-mvn clean install site site:stage -P !integration-tests,!performance-tests
-cd rest
-mvn package
-cd -
-echo Committing site to Apache SVN...
-mvn scm-publish:publish-scm -Dusername=$1 -Dpassword=$2
-echo Site generation and upload completed.
\ No newline at end of file
+echo Setting up environment...
+DIRNAME=`dirname "$0"`
+PROGNAME=`basename "$0"`
+if [ -f "$DIRNAME/setenv.sh" ]; then
+  . "$DIRNAME/setenv.sh"
+fi
+set -e
+# keep track of the last executed command
+trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
+# echo an error message before exiting
+trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT
+BRANCH_NAME=$1
+VERSION=$2
+SVN_USERNAME=$3
+SVN_PASSWORD=$4
+LOCAL_BRANCH_NAME=`git rev-parse --abbrev-ref HEAD`
+echo Git local branch: ${LOCAL_BRANCH_NAME}
+bash generate-site.sh $BRANCH_NAME $VERSION
+echo Committing documentation to Apache SVN...
+mvn scm-publish:publish-scm 
-Dscmpublish.pubScmUrl=scm:svn:https://svn.apache.org/repos/asf/unomi/website/manual
 -Dscmpublish.content=target/staging/manual -Dusername=$SVN_USERNAME 
-Dpassword=$SVN_PASSWORD
+if [ "$LOCAL_BRANCH_NAME" == "master" ]; then
+  mvn scm-publish:publish-scm 
-Dscmpublish.pubScmUrl=scm:svn:https://svn.apache.org/repos/asf/unomi/website/unomi-api
 -Dscmpublish.content=target/staging/unomi-api -Dusername=$SVN_USERNAME 
-Dpassword=$SVN_PASSWORD
+fi
+
+echo "Committing manual to Apache Dist SVN..."
+pushd manual/target
+svn co https://dist.apache.org/repos/dist/release/unomi/$VERSION
+mv unomi-manual-$BRANCH_NAME.pdf $VERSION
+mv unomi-manual-$BRANCH_NAME.pdf.asc $VERSION
+mv unomi-manual-$BRANCH_NAME.zip $VERSION
+mv unomi-manual-$BRANCH_NAME.pdf.sha512 $VERSION
+mv unomi-manual-$BRANCH_NAME.zip.asc $VERSION
+mv unomi-manual-$BRANCH_NAME.zip.sha512 $VERSION
+cd $VERSION
+svn add unomi-manual*
+svn commit -m "Update Unomi manual packages for version ${VERSION}"
+popd
+echo Documentation generation and upload completed.
diff --git a/generate-site.sh b/generate-site.sh
index fe3ebd2f6..21cce3236 100755
--- a/generate-site.sh
+++ b/generate-site.sh
@@ -17,8 +17,46 @@
 #    limitations under the License.
 #
 
################################################################################
-echo Generating site...
-mvn site site:stage -P !integration-tests,!performance-tests
-cd rest
-mvn package
-cd -
+if [ $# -ne 2 ]
+  then
+    echo "Illegal number of arguments supplied. Syntax should be 
generate-site.sh X_X_X X.X.X"
+    echo "Example: ./generate.sh 2_0_x 2.0.1"
+    exit 1
+fi
+echo Setting up environment...
+DIRNAME=`dirname "$0"`
+PROGNAME=`basename "$0"`
+if [ -f "$DIRNAME/setenv.sh" ]; then
+  . "$DIRNAME/setenv.sh"
+fi
+set -e
+# keep track of the last executed command
+trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
+# echo an error message before exiting
+trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT
+RELEASE_BRANCH_NAME=$1
+RELEASE_VERSION=$2
+LOCAL_BRANCH_NAME=`git rev-parse --abbrev-ref HEAD`
+echo Git local branch: ${LOCAL_BRANCH_NAME}
+echo Generating manual for branch ${RELEASE_BRANCH_NAME} and version 
${RELEASE_VERSION}...
+mvn clean
+pushd manual
+mvn -Ddoc.archive=true 
-Ddoc.output.pdf=target/generated-docs/pdf/$RELEASE_BRANCH_NAME 
-Ddoc.output.html=target/generated-docs/html/$RELEASE_BRANCH_NAME 
-Ddoc.version=$RELEASE_BRANCH_NAME -P sign install
+mvn -P sign install
+# If not on master branch we remove the latest directories
+if [ "$LOCAL_BRANCH_NAME" != "master" ]; then
+  rm -rf target/generated-docs/html/latest
+  rm -rf target/generated-docs/pdf/latest
+fi
+popd
+if [ "$LOCAL_BRANCH_NAME" == "master" ]; then
+  echo Generating Javadoc...
+  mvn javadoc:aggregate -P integration-tests
+else
+  echo Not on master branch, skipping Javadoc generation
+fi
+mkdir -p target/staging/unomi-api
+mkdir -p target/staging/manual
+cp -R target/site/apidocs target/staging/unomi-api
+cp -Rf manual/target/generated-docs/html/* target/staging/manual
+echo Documentation generation completed!
diff --git a/release-stage-1.sh b/release-stage-1.sh
new file mode 100755
index 000000000..e35fd86bb
--- /dev/null
+++ b/release-stage-1.sh
@@ -0,0 +1,55 @@
+#!/usr/bin/env bash
+################################################################################
+#
+#    Licensed to the Apache Software Foundation (ASF) under one or more
+#    contributor license agreements.  See the NOTICE file distributed with
+#    this work for additional information regarding copyright ownership.
+#    The ASF licenses this file to You under the Apache License, Version 2.0
+#    (the "License"); you may not use this file except in compliance with
+#    the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+################################################################################
+if [ $# -eq 0 ]
+  then
+    echo "Please use arguments RELEASE_VERSION RELEASE_BRANCH. Ex: 
./release-stage-1.sh 2.1.0 master"
+    exit 1
+fi
+set -e
+# keep track of the last executed command
+trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
+# echo an error message before exiting
+trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT
+export RELEASE_VERSION=$1
+export RELEASE_BRANCH=$2
+echo Prepare staging 1 of release process for version $RELEASE_VERSION in 
branch $RELEASE_BRANCH...
+mkdir -p target/release/$RELEASE_VERSION
+pushd target/release/$RELEASE_VERSION
+git clone https://gitbox.apache.org/repos/asf/unomi.git unomi-$RELEASE_VERSION
+cd unomi-$RELEASE_VERSION
+git checkout $RELEASE_BRANCH
+mvn clean install -P apache-release,integration-tests,docker
+mvn clean install -DskipITs=true -DskipTests=true -P 
integration-tests,rat,apache-release,docker,\!run-tests
+
+pushd target
+gpg --verify unomi-root-$RELEASE_VERSION-SNAPSHOT-source-release.zip.asc 
unomi-root-$RELEASE_VERSION-SNAPSHOT-source-release.zip
+shasum -a 512 unomi-root-$RELEASE_VERSION-SNAPSHOT-source-release.zip
+cat unomi-root-$RELEASE_VERSION-SNAPSHOT-source-release.zip.sha512
+unzip unomi-root-$RELEASE_VERSION-SNAPSHOT-source-release.zip
+cd unomi-root-$RELEASE_VERSION-SNAPSHOT
+mvn clean install
+popd
+
+mvn release:prepare -DskipITs=true -DskipTests=true 
-Drelease.arguments="-Papache-release,integration-tests,\!run-tests 
-DskipITs=true -DskipTests=true" -DdryRun=true -P 
apache-release,integration-tests,docker,\!run-tests
+mvn deploy -DskipITs=true -DskipTests=true 
-Drelease.arguments="-Papache-release,integration-tests,\!run-tests 
-DskipITs=true -DskipTests=true" -P \!run-tests
+rm release.properties
+mvn -DskipITs=true -DskipTests=true 
-Drelease.arguments="-Papache-release,integration-tests,\!run-tests 
-DskipITs=true -DskipTests=true" -P 
apache-release,integration-tests,docker,\!run-tests release:prepare
+mvn -DskipITs=true -DskipTests=true 
-Drelease.arguments="-Papache-release,integration-tests,\!run-tests 
-DskipITs=true -DskipTests=true" -P integration-tests,docker,\!run-tests 
release:perform
+popd
diff --git a/release-stage-2.sh b/release-stage-2.sh
new file mode 100755
index 000000000..6cb9245b9
--- /dev/null
+++ b/release-stage-2.sh
@@ -0,0 +1,63 @@
+#!/usr/bin/env bash
+################################################################################
+#
+#    Licensed to the Apache Software Foundation (ASF) under one or more
+#    contributor license agreements.  See the NOTICE file distributed with
+#    this work for additional information regarding copyright ownership.
+#    The ASF licenses this file to You under the Apache License, Version 2.0
+#    (the "License"); you may not use this file except in compliance with
+#    the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+################################################################################
+echo Prepare staging 2 of release process...
+if [ $# -eq 0 ]
+  then
+    echo "Please use arguments RELEASE_VERSION NEXUS_REPOSITORY_ID. Ex: 
./release-stage-2.sh 2.1.0 orgapacheunomi-1033"
+    exit 1
+fi
+set -e
+# keep track of the last executed command
+trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
+# echo an error message before exiting
+trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT
+
+export RELEASE_VERSION=$1
+export REPO_ID=$2
+pushd target/release/$RELEASE_VERSION
+svn checkout https://dist.apache.org/repos/dist/dev/unomi unomi-dev
+cd unomi-dev
+mkdir $RELEASE_VERSION
+cd $RELEASE_VERSION
+
+wget 
https://repository.apache.org/content/repositories/$REPO_ID/org/apache/unomi/unomi-root/$RELEASE_VERSION/unomi-root-$RELEASE_VERSION-source-release.zip
+wget 
https://repository.apache.org/content/repositories/$REPO_ID/org/apache/unomi/unomi-root/$RELEASE_VERSION/unomi-root-$RELEASE_VERSION-source-release.zip.asc
+wget 
https://repository.apache.org/content/repositories/$REPO_ID/org/apache/unomi/unomi/$RELEASE_VERSION/unomi-$RELEASE_VERSION.tar.gz
+wget 
https://repository.apache.org/content/repositories/$REPO_ID/org/apache/unomi/unomi/$RELEASE_VERSION/unomi-$RELEASE_VERSION.tar.gz.asc
+wget 
https://repository.apache.org/content/repositories/$REPO_ID/org/apache/unomi/unomi/$RELEASE_VERSION/unomi-$RELEASE_VERSION.zip
+wget 
https://repository.apache.org/content/repositories/$REPO_ID/org/apache/unomi/unomi/$RELEASE_VERSION/unomi-$RELEASE_VERSION.zip.asc
+
+mv unomi-root-$RELEASE_VERSION-source-release.zip 
unomi-$RELEASE_VERSION-src.zip
+mv unomi-root-$RELEASE_VERSION-source-release.zip.asc 
unomi-$RELEASE_VERSION-src.zip.asc
+shasum -a 512 unomi-$RELEASE_VERSION-src.zip > 
unomi-$RELEASE_VERSION-src.zip.sha512
+
+mv unomi-$RELEASE_VERSION.zip unomi-$RELEASE_VERSION-bin.zip
+mv unomi-$RELEASE_VERSION.zip.asc unomi-$RELEASE_VERSION-bin.zip.asc
+shasum -a 512 unomi-$RELEASE_VERSION-bin.zip > 
unomi-$RELEASE_VERSION-bin.zip.sha512
+
+mv unomi-$RELEASE_VERSION.tar.gz unomi-$RELEASE_VERSION-bin.tar.gz
+mv unomi-$RELEASE_VERSION.tar.gz.asc unomi-$RELEASE_VERSION-bin.tar.gz.asc
+shasum -a 512 unomi-$RELEASE_VERSION-bin.tar.gz > 
unomi-$RELEASE_VERSION-bin.tar.gz.sha512
+
+cd ..
+svn add $RELEASE_VERSION
+
+svn commit -m "Apache $RELEASE_VERSION Release (for PMC voting)"
+popd

Reply via email to