Skip to content
Permalink
Browse files
Using help plugin for config retrieval
  • Loading branch information
effrafax committed Nov 30, 2019
1 parent 79604cf commit 1ba141080eb11af03ac480b558ea35c056814aaf
Showing 2 changed files with 11 additions and 17 deletions.
@@ -26,22 +26,15 @@

THIS_DIR=$(dirname $0)
THIS_DIR=$(readlink -f ${THIS_DIR})
CONTENT_DIR=".site-content"
BRANCH="asf-staging-3.0"
SUB_DIR="/components"

if grep -q '<scmPublishBranch>' pom.xml; then
BRANCH=$(sed -n -e 's/.*<scmPublishBranch>\(.*\)<\/scmPublishBranch>.*/\1/p' pom.xml)
fi

if grep -q '<scmPubCheckoutDirectory>' pom.xml; then
CONTENT_DIR=$(sed -n -e 's/.*<scmPubCheckoutDirectory>\(.*\)<\/scmPubCheckoutDirectory>.*/\1/p' pom.xml)
fi


VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
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}" checkout ${BRANCH}
git -C "${CONTENT_DIR}" reset --hard origin/${BRANCH}
git -C "${CONTENT_DIR}" clean -f -d
fi
@@ -53,7 +46,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)? "
@@ -53,14 +53,15 @@
<site.staging.base>${project.basedir}/target/staging/components</site.staging.base>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<webUrl>https://archiva.apache.org/components</webUrl>
<scmPubCheckoutDirectory>${basedir}/.site-content</scmPubCheckoutDirectory>

<!-- The git repository, where the site content is placed -->
<siteRepositoryUrl>scm:git:https://gitbox.apache.org/repos/asf/archiva-web-content.git</siteRepositoryUrl>
<site.staging.base>${project.basedir}</site.staging.base>

<asciidoctor.maven.plugin.version>2.0.0-RC.1</asciidoctor.maven.plugin.version>

<scmPubCheckoutDirectory>.site-content</scmPubCheckoutDirectory>
<scmPublishBranch>asf-staging</scmPublishBranch>
<scmPublishPath>/components</scmPublishPath>

</properties>

<description>Parent Pom for various components used in Apache Archiva and Redback.</description>
@@ -396,7 +397,7 @@
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
<skipDeploy>true</skipDeploy>
<stagingDirectory>${site.staging.base}/target/staging/components</stagingDirectory>
<stagingDirectory>${site.staging.base}/target/staging${scmPublishPath}</stagingDirectory>
<asciidoc>
<!-- optional site-wide AsciiDoc attributes -->
<attributes>

0 comments on commit 1ba1410

Please sign in to comment.