Using help plugin for config retrieval
diff --git a/.gitignore b/.gitignore
index 9df6607..ed0b931 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
target
.DS_Store
site-content
+.site-content
diff --git a/deploySite.sh b/deploySite.sh
index 3227c32..122b958 100755
--- a/deploySite.sh
+++ b/deploySite.sh
@@ -29,18 +29,14 @@
CONTENT_DIR=".site-content"
BRANCH="asf-staging-3.0"
SUB_DIR="/redback"
-
-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}" checkout "${BRANCH}"
git -C "${CONTENT_DIR}" fetch origin
git -C "${CONTENT_DIR}" reset --hard origin/${BRANCH}
git -C "${CONTENT_DIR}" clean -f -d
@@ -53,7 +49,7 @@
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 b32ecc8..2f1ed84 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,8 +35,9 @@
<redbackReleaseDate>2017-05-11</redbackReleaseDate>
<redbackCurrentDevVersion>3.0.0-SNAPSHOT</redbackCurrentDevVersion>
- <scmPubCheckoutDirectory>site-content</scmPubCheckoutDirectory>
+ <scmPubCheckoutDirectory>.site-content</scmPubCheckoutDirectory>
<scmPublishBranch>asf-staging</scmPublishBranch>
+ <scmPublishPath>/redback</scmPublishPath>
<siteRepositoryUrl>scm:git:https://gitbox.apache.org/repos/asf/archiva-web-content.git</siteRepositoryUrl>
<site.staging.base>${project.basedir}</site.staging.base>
@@ -87,7 +88,7 @@
<artifactId>maven-site-plugin</artifactId>
<configuration>
<skipDeploy>true</skipDeploy>
- <stagingDirectory>${site.staging.base}/target/staging/redback/</stagingDirectory>
+ <stagingDirectory>${site.staging.base}/target/staging${scmPublishPath}/</stagingDirectory>
</configuration>
<executions>
<execution>