From 011aed509eb454dd02243acb37fca0d132f44f15 Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Sun, 1 Dec 2019 00:04:09 +0100 Subject: [PATCH] Using help plugin for config retrieval --- deploySite.sh | 20 +++++--------------- pom.xml | 3 ++- src/site/site.xml | 2 +- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/deploySite.sh b/deploySite.sh index cac4175c..3b714af2 100755 --- a/deploySite.sh +++ b/deploySite.sh @@ -26,23 +26,13 @@ THIS_DIR=$(dirname $0) THIS_DIR=$(readlink -f ${THIS_DIR}) -CONTENT_DIR=".site-content" -BRANCH="asf-staging-3.0" VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) - -SUB_DIR="/redback/core/${VERSION}" - -if grep -q '' pom.xml; then - BRANCH=$(sed -n -e 's/.*\(.*\)<\/scmPublishBranch>.*/\1/p' pom.xml) -fi - -if grep -q '' pom.xml; then - CONTENT_DIR=$(sed -n -e 's/.*\(.*\)<\/scmPubCheckoutDirectory>.*/\1/p' pom.xml) -fi - - +PUBLISH_PATH=$(mvn help:evaluate -Dexpression=scmPublishPath -q -DforceStdout) +BRANCH=$(mvn help:evaluate -Dexpression=scmPublishBranch -q -DforceStdout) +CONTENT_DIR=$(mvn help:evaluate -Dexpression=scmPubCheckoutDirectory -q -DforceStdout) if [ -d "${CONTENT_DIR}/.git" ]; then + git -C "${CONTENT_DIR}" fetch origin git -C "${CONTENT_DIR}" fetch origin git -C "${CONTENT_DIR}" reset --hard origin/${BRANCH} git -C "${CONTENT_DIR}" clean -f -d @@ -55,7 +45,7 @@ mvn site:stage "$@" echo "*****************************************" echo ">>>> Finished the site stage process <<<<" echo "> You can check the content in the folder target/staging or by opening the following url" -echo "> file://${THIS_DIR}/target/staging${SUB_DIR}/index.html" +echo "> file://${THIS_DIR}/target/staging${PUBLISH_PATH}/index.html" echo "> " echo "> If everything is fine enter yes. After that the publish process will be started." echo -n "Do you want to publish (yes/no)? " diff --git a/pom.xml b/pom.xml index a30121eb..a6849a14 100644 --- a/pom.xml +++ b/pom.xml @@ -96,6 +96,7 @@ ${project.basedir} .site-content asf-staging + /redback/core/${project.version} scm:git:https://gitbox.apache.org/repos/asf/archiva-web-content.git @@ -753,7 +754,7 @@ UTF-8 UTF-8 true - ${site.staging.base}/target/staging/redback/core/${project.version} + ${site.staging.base}/target/staging${scmPublishPath}/ diff --git a/src/site/site.xml b/src/site/site.xml index 586b17cf..b7bb528e 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -51,7 +51,7 @@ - ]]> + ]]>