Migrating to staging branch for site publish

This commit is contained in:
Martin Stockhammer 2019-11-29 21:41:55 +01:00
parent 332945d852
commit 3226d92da3
17 changed files with 245 additions and 24 deletions

View File

@ -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}"

View File

@ -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 '<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
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

33
pom.xml
View File

@ -33,6 +33,8 @@
<packaging>pom</packaging>
<name>Apache Archiva Redback</name>
<description>Redback is a authorization and authentication framework used by Archiva.
It is developed by the Apache Archiva team.</description>
<url>http://archiva.apache.org/redback/core</url>
<inceptionYear>2006</inceptionYear>
@ -71,7 +73,6 @@
</distributionManagement>
<properties>
<site.staging.base>${project.basedir}</site.staging.base>
<springVersion>4.3.10.RELEASE</springVersion>
<commons-collections.version>4.1</commons-collections.version>
@ -92,12 +93,12 @@
<openjpa.Log>DefaultLevel=INFO,Runtime=ERROR,Tool=ERROR,SQL=ERROR,Schema=ERROR,MetaData=ERROR</openjpa.Log>
<scmPubCheckoutDirectory>${basedir}/.site-content</scmPubCheckoutDirectory>
<site.staging.base>${project.basedir}</site.staging.base>
<scmPubCheckoutDirectory>.site-content</scmPubCheckoutDirectory>
<scmPublishBranch>asf-staging</scmPublishBranch>
<!-- 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>
</properties>
<repositories>
@ -721,10 +722,12 @@
<artifactId>maven-scm-publish-plugin</artifactId>
<inherited>false</inherited>
<configuration>
<checkinComment>Apache Archiva versioned module docs for ${project.version}</checkinComment>
<checkinComment>Apache Redback versioned module docs for ${project.version}</checkinComment>
<skipDeletedFiles>true</skipDeletedFiles>
<content>${project.build.directory}/staging/</content>
<scmBranch>${scmPublishBranch}</scmBranch>
<tryUpdate>true</tryUpdate>
<content>${project.build.directory}/staging</content>
<!--
<ignorePathsToDelete>
<path>%regex[^(?!docs/).*$]</path>
@ -746,8 +749,11 @@
<artifactId>maven-site-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<locales>en</locales>
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
<skipDeploy>true</skipDeploy>
<stagingDirectory>${site.staging.base}/target/staging/redback/core/</stagingDirectory>
<stagingDirectory>${site.staging.base}/target/staging/redback/core/${version}</stagingDirectory>
</configuration>
<executions>
<execution>
@ -947,9 +953,18 @@
<version>${javadocPluginVersion}</version>
<inherited>false</inherited>
<configuration>
<javadocVersion>1.8</javadocVersion>
<source>1.8</source>
<notimestamp>true</notimestamp>
<javadocVersion>${javaFullVersion}</javadocVersion>
<source>${compiler.source}</source>
<doclint>none</doclint>
<detectLinks>true</detectLinks>
<detectJavaApiLink>true</detectJavaApiLink>
<linksource>true</linksource>
<show>protected</show>
<quiet>true</quiet>
<doctitle>Archiva Redback API</doctitle>
<isOffline>false</isOffline>
<excludePackageNames>*.test</excludePackageNames>
</configuration>
<reportSets>
<reportSet>
@ -1052,6 +1067,8 @@ The executor runs a shell script.
<arguments>
<argument>-d</argument>
<argument>${scmPubCheckoutDirectory}</argument>
<argument>-b</argument>
<argument>${scmPublishBranch}</argument>
<argument>${siteRepositoryUrl}</argument>
</arguments>
</configuration>

View File

@ -26,6 +26,7 @@
</parent>
<artifactId>redback-authentication</artifactId>
<name>Redback :: Authentication</name>
<description>API and providers for authenticating users.</description>
<packaging>pom</packaging>
<properties>
<site.staging.base>${project.parent.basedir}</site.staging.base>

View File

@ -26,6 +26,7 @@
</parent>
<artifactId>redback-authorization</artifactId>
<name>Redback :: Authorization</name>
<description>API and providers for RBAC based authorization.</description>
<packaging>pom</packaging>
<properties>
<site.staging.base>${project.parent.basedir}</site.staging.base>

View File

@ -27,6 +27,7 @@
</parent>
<artifactId>redback-common</artifactId>
<name>Redback :: Commons</name>
<description>Common Components used by different Redback modules.</description>
<packaging>pom</packaging>
<properties>
<site.staging.base>${project.parent.basedir}</site.staging.base>

View File

@ -28,10 +28,12 @@
</parent>
<artifactId>redback-configuration</artifactId>
<properties>
<site.staging.base>${project.parent.basedir}</site.staging.base>
</properties>
<name>Redback :: Configuration</name>
<description>Redback Configuration API</description>
<dependencies>
<dependency>

View File

@ -26,6 +26,7 @@
</parent>
<artifactId>redback-integrations</artifactId>
<name>Redback :: Integrations</name>
<description>Redback integration modules for security and REST</description>
<packaging>pom</packaging>
<properties>
<site.staging.base>${project.parent.basedir}</site.staging.base>

View File

@ -26,6 +26,7 @@
</parent>
<artifactId>redback-keys</artifactId>
<name>Redback :: Key Management</name>
<description>Management of authentication keys</description>
<packaging>pom</packaging>
<properties>
<site.staging.base>${project.parent.basedir}</site.staging.base>

View File

@ -32,6 +32,7 @@
<site.staging.base>${project.parent.basedir}</site.staging.base>
</properties>
<name>Redback :: Policy</name>
<description>Redback security policies</description>
<dependencies>
<dependency>

View File

@ -26,6 +26,7 @@
</parent>
<artifactId>redback-rbac</artifactId>
<name>Redback :: Role Based Access Control</name>
<description>Redback RBAC API and data model.</description>
<packaging>pom</packaging>
<properties>
<site.staging.base>${project.parent.basedir}</site.staging.base>

View File

@ -28,6 +28,8 @@
</parent>
<artifactId>redback-system</artifactId>
<description>Redback system components</description>
<properties>
<site.staging.base>${project.parent.basedir}</site.staging.base>
</properties>

View File

@ -26,6 +26,7 @@
</parent>
<artifactId>redback-users</artifactId>
<name>Redback :: User Management</name>
<description>Redback User model</description>
<packaging>pom</packaging>
<properties>
<site.staging.base>${project.parent.basedir}</site.staging.base>

View File

@ -0,0 +1,166 @@
body {
padding-top: 1px;
}
a.externalLink[href^="https"] {
background: url('../images/external-link-12x12.png') right center no-repeat;
padding-right: 18px;
}
#leftColumn {
display: none !important
}
#bodyColumn {
margin-left: 1.5em;
}
div#rhs {
float: right;
text-align: center;
}
div.mainBox {
margin-left: auto;
margin-right: auto;
margin-top: 1em;
margin-bottom: 1em;
width: 75%;
background-color: #ccc;
position: relative;
padding-left: 5em;
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
}
div.mainBox div {
padding: 0.4em;
}
div.newsBox {
margin-left: auto;
margin-right: auto;
margin-top: 1em;
margin-bottom: 1em;
width: 75%;
background-color: #ccc;
position: relative;
padding-left: 8em;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
}
div.newsBox div {
padding: 0.6em;
}
div.mainBox span + p a {
background: url(../images/arrow.png) no-repeat;
background-size: 16px 16px;
background-position: right;
padding-right: 20px;
}
div.mainBox span + p a {
font-size: 1.5em;
/*color: black;*/
}
div.mainBox span + p a:hover {
/*color: blue;*/
}
.bignumber {
position: absolute;
color: white;
left: 0.25em;
font-size: 1.9em;
}
div.linkBox p {
text-align: right;
margin-bottom: 0;
margin-top: 0;
padding-top: 0;
}
#banner {
background: none;
}
#banner img {
margin: 10px;
}
div.jqmWindow h2, div.jqmWindow p {
text-align: center;
}
span.jqmClose {
position: absolute;
cursor: pointer;
right: 4px;
top: 6px;
}
div.section {
margin-right: 110px;
margin-left: 10px;
}
.hero-unit p {
/* font-weight: inherit;*/
}
.archivascreenshots {
border: 1px solid silver;
margin-left: 0.25em;
margin-bottom: 0.25em
}
.rhs span {
display: block;
font-size: 13px;
font-weight: bold;
margin-top: 1.5em;
margin-bottom: 1.5em;
}
.container ul li iframe {
margin-top: 4px;
margin-right: 4px;
}
.modal-body table {
border: 0px;
}
.features-preview:after {
background-color: #F5F5F5;
border: 1px solid #DDDDDD;
border-radius: 4px 0 4px 0;
color: #9DA0A4;
content: "New web UI";
font-size: 12px;
font-weight: bold;
left: -1px;
padding: 3px 7px;
position: absolute;
top: -1px;
}
.features-preview {
background-color: #FFFFFF;
border: 1px solid #DDDDDD;
border-radius: 4px 4px 4px 4px;
margin: 15px 0;
padding: 39px 19px 14px;
position: relative;
min-height: 450px;
}
.carousel .item > img {
min-height: 400px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

View File

@ -26,25 +26,22 @@
<custom>
<fluidoSkin>
<topBarEnabled>true</topBarEnabled>
<copyrightStyle>pull-right</copyrightStyle>
<sideBarEnabled>false</sideBarEnabled>
<skipGenerationDate>true</skipGenerationDate>
<googleSearch>
<sitesearch>https://archiva.apache.org/redback</sitesearch>
</googleSearch>
<twitter>
<user>archiva</user>
<showUser>true</showUser>
<showFollowers>false</showFollowers>
</twitter>
<ohloh>
<projectId>8659</projectId>
<widget>thin-badge</widget>
</ohloh>
<gitHub>
<projectId>apache/archiva-redback-core</projectId>
<projectId>apache/archiva</projectId>
<ribbonOrientation>right</ribbonOrientation>
<ribbonColor>black</ribbonColor>
<ribbonColor>gray</ribbonColor>
</gitHub>
</fluidoSkin>
</custom>
@ -53,15 +50,21 @@
<version position="right" />
<body>
<head>
<![CDATA[<link rel="stylesheet" href="../css/site.css" type="text/css" />]]>
</head>
<breadcrumbs>
<item name="Apache" href="https://www.apache.org" />
<item name="Archiva" href="https://archiva.apache.org" />
<item name="Redback" href="index.html" />
<item name="Archiva" href="../../index.html" />
<item name="Redback" href="../index.html" />
<item name="Redback Modules" href="index.html" />
</breadcrumbs>
<menu ref="reports" />
<menu ref="modules" />
<menu name="ASF" inherit="bottom">
<item name="How Apache Works" href="http://www.apache.org/foundation/how-it-works.html"/>
<item name="Foundation" href="http://www.apache.org/foundation/"/>