diff --git a/checkoutSite.sh b/checkoutSite.sh index 5e582bd1..4762b092 100755 --- a/checkoutSite.sh +++ b/checkoutSite.sh @@ -27,7 +27,7 @@ # is rather large and we don't want to checkout the complete data. # -SITE_DIR=".site-content" +SITE_DIR="site-content" GIT_REMOTE="" GIT_USER=$(git config user.name) @@ -42,6 +42,7 @@ CLONE=1 FORCE=1 MODULE_DIR="${MY_PWD}" PATTERN="" +BRANCH="master" while [ ! -z "$1" ]; do case "$1" in -f) @@ -67,6 +68,11 @@ while [ ! -z "$1" ]; do MODULE_DIR="$1" shift ;; + -b) + shift + BRANCH="$1" + shift + ;; *) GIT_REMOTE="$1" shift @@ -119,6 +125,8 @@ fi cd "${SITE_DIR}" || { echo "Could not change to site dir ${SITE_DIR}"; exit 1; } +git checkout "${BRANCH}" + git config core.sparsecheckout true git config user.name "${GIT_USER}" git config user.email "${GIT_EMAIL}" diff --git a/deploySite.sh b/deploySite.sh index 7a04361c..cac4175c 100755 --- a/deploySite.sh +++ b/deploySite.sh @@ -27,34 +27,49 @@ 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 + -SUB_DIR="redback/core" if [ -d "${CONTENT_DIR}/.git" ]; then git -C "${CONTENT_DIR}" fetch origin - git -C "${CONTENT_DIR}" reset --hard origin/master + git -C "${CONTENT_DIR}" reset --hard origin/${BRANCH} + git -C "${CONTENT_DIR}" clean -f -d fi echo ">>>> Creating site and reports <<<<" -mvn clean site site:stage "$@" +mvn clean site "$@" +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${SUB_DIR}/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)? " read ANSWER -if [ "${ANSWER}" == "yes" -o "${ANSWER}" == "YES" ]; then +if [ "${ANSWER}" == "yes" -o "${ANSWER}" == "YES" -o "${ANSWER}" == "y" -o "${ANSWER}" == "Y" ]; then echo "> Starting publish process" mvn scm-publish:publish-scm "$@" else echo "> Aborting now" echo "> Running git reset in .site-content directory" git -C "${CONTENT_DIR}" fetch origin - git -C "${CONTENT_DIR}" reset --hard origin/master + git -C "${CONTENT_DIR}" reset --hard origin/${BRANCH} + git -C "${CONTENT_DIR}" clean -f -d echo ">>>> Finished <<<<" fi diff --git a/pom.xml b/pom.xml index 1086ef35..499dfff7 100644 --- a/pom.xml +++ b/pom.xml @@ -33,6 +33,8 @@ pom Apache Archiva Redback + Redback is a authorization and authentication framework used by Archiva. + It is developed by the Apache Archiva team. http://archiva.apache.org/redback/core 2006 @@ -71,7 +73,6 @@ - ${project.basedir} 4.3.10.RELEASE 4.1 @@ -92,12 +93,12 @@ DefaultLevel=INFO,Runtime=ERROR,Tool=ERROR,SQL=ERROR,Schema=ERROR,MetaData=ERROR - ${basedir}/.site-content + ${project.basedir} + .site-content + asf-staging scm:git:https://gitbox.apache.org/repos/asf/archiva-web-content.git - ${project.basedir} - @@ -721,10 +722,12 @@ maven-scm-publish-plugin false - Apache Archiva versioned module docs for ${project.version} + Apache Redback versioned module docs for ${project.version} true ${project.build.directory}/staging/ + ${scmPublishBranch} true + ${project.build.directory}/staging