diff options
author | Martin Stockhammer <martin_s@apache.org> | 2018-11-15 22:11:20 +0100 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2018-11-15 22:11:20 +0100 |
commit | f528b1addc8164b1466b8dc4aebbf503d43e7152 (patch) | |
tree | 1627123c8201e47ed6a1c3d32f57682298f8048d /archiva-modules | |
parent | d712278c12308e346ab01ce7677d1e23c71607b7 (diff) | |
download | archiva-f528b1addc8164b1466b8dc4aebbf503d43e7152.tar.gz archiva-f528b1addc8164b1466b8dc4aebbf503d43e7152.zip |
Adding script for site publish and some documentation
Diffstat (limited to 'archiva-modules')
-rw-r--r-- | archiva-modules/README.adoc | 81 | ||||
-rwxr-xr-x | archiva-modules/deploySite.sh | 58 | ||||
-rw-r--r-- | archiva-modules/pom.xml | 21 | ||||
-rw-r--r-- | archiva-modules/src/site/site.xml | 11 |
4 files changed, 166 insertions, 5 deletions
diff --git a/archiva-modules/README.adoc b/archiva-modules/README.adoc new file mode 100644 index 000000000..fc24ffe44 --- /dev/null +++ b/archiva-modules/README.adoc @@ -0,0 +1,81 @@ +Archiva Modules - Collection of Archiva Subprojects +=================================================== +:toc: + + +== How to build and publish the pages for the archiva web content + +This module and the children contain web content and project reports that can be published to the +archiva web site: https://archiva.apache.org + +The web content parts of this module and submodules are published to the path + + /ref/${project.version}/ + +=== Use the script + +There is a shell script +deploySite.sh+ which you can run to generate the site check and publish to +the remote repository. It works only on Linux, on other platforms you have to go the next section. + +The script is interactive, it asks you to confirm the publish after generation of the staging part. + +.Execute + + ./deploySite.sh + +All arguments are appended to the mvn calls. + +=== Run the mvn steps manually + +==== Building the pages + +You need enough free disk space to publish the web content. The archiva web site repository is big, +but the maven build will only checkout the necessary directories for this build (sparse checkout). + +For all the commands you have to change to this archiva-modules directory: + + cd archiva/archiva-modules + +.The following creates the site to the staging folder + + mvn clean site site:stage + +The result can be checked in + + archiva-modules/target/staging/ref/${project.version} + +with your browser. + +If you would like the use a local checkout of the archiva-web-content.git repository and not push directly +to the remote repository, you may add this parameter: + + -DsiteRepositoryUrl=scm:git:file:///${path-to-your-local-archiva}/archiva-web-content.git + +where +${path-to-your-local-archiva}+ is the path where a bare clone of the archiva-web-content.git is stored. + +NOTE: You cannot use +mvn site:run+ because this will place the submodules into the same folder and + overwrite each other. + +==== Publish the pages + +.This command publishes to the git repository + + mvn scm-publish:publish-scm + +After publishing to the git repository the gitpubsub mechanism is transferring it to the HTTP server. + +If you would like the use a local checkout of the archiva-web-content.git repository and not push directly +to the remote repository, you may add this parameter: + + -DsiteRepositoryUrl=scm:git:file:///${path-to-your-local-archiva}/archiva-web-content.git + + +=== Some notes about the build process + +A sparse checkout of the git repository will be created in + + .site-content + +but only, if the directory +.site-content/.git+ does not exist. + + diff --git a/archiva-modules/deploySite.sh b/archiva-modules/deploySite.sh index 387856b3b..564cdfe5e 100755 --- a/archiva-modules/deploySite.sh +++ b/archiva-modules/deploySite.sh @@ -1,5 +1,61 @@ #!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# Author: Martin Stockhammer <martin_s@apache.org> +# Date: 2018-11-15 +# +# Publishes the site content and generated reports to the web content repository. +# It stops after the staging and let you check the content before pushing to the repository +# +THIS_DIR=$(dirname $0) +THIS_DIR=$(readlink -f ${THIS_DIR}) +CONTENT_DIR=".site-content" + +PROJECT_VERSION=$(grep '<version>' pom.xml |head -1 | sed -e 's/.*<version>\(.*\)<\/version>.*/\1/g') +SUB_DIR="ref/${PROJECT_VERSION}" + +if [ -d "${CONTENT_DIR}/.git" ]; then + git -C "${CONTENT_DIR}" fetch origin + git -C "${CONTENT_DIR}" reset --hard origin/master +fi + +echo ">>>> Creating site and reports <<<<" mvn clean site site:stage -Preporting "$@" -mvn scm-publish:publish-scm "$@" + +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 "> " +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 + 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 + echo ">>>> Finished <<<<" +fi diff --git a/archiva-modules/pom.xml b/archiva-modules/pom.xml index b8b924233..22ba74a5d 100644 --- a/archiva-modules/pom.xml +++ b/archiva-modules/pom.xml @@ -48,6 +48,17 @@ </modules> <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-site-plugin</artifactId> + <configuration> + <skipDeploy>true</skipDeploy> + </configuration> + </plugin> + </plugins> + </pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -89,13 +100,14 @@ <goal>attach-descriptor</goal> </goals> </execution> - <execution> +<!-- <execution> <id>site-generate-resources</id> <phase>generate-resources</phase> <goals> <goal>site</goal> </goals> - </execution> + </execution>--> + <!-- <execution> <id>stage-for-scm-publish</id> <phase>post-site</phase> @@ -105,7 +117,9 @@ <configuration> <skipDeploy>false</skipDeploy> </configuration> - </execution> </executions> + </execution> + --> + </executions> </plugin> </plugins> @@ -166,6 +180,7 @@ <notimestamp>true</notimestamp> <javadocVersion>1.8</javadocVersion> <source>1.8</source> + <doclint>none</doclint> <links> <link>https://docs.oracle.com/javase/8/docs/api</link> <link>http://commons.apache.org/collections/apidocs-COLLECTIONS_3_0/</link> diff --git a/archiva-modules/src/site/site.xml b/archiva-modules/src/site/site.xml index 2830c81d7..0dbaf9467 100644 --- a/archiva-modules/src/site/site.xml +++ b/archiva-modules/src/site/site.xml @@ -35,11 +35,20 @@ </twitter> <ohloh> <projectId>6670</projectId> - <widget>stats</widget> + <widget>thin-badge</widget> </ohloh> + <gitHub> + <projectId>apache/archiva</projectId> + <ribbonOrientation>right</ribbonOrientation> + <ribbonColor>black</ribbonColor> + </gitHub> </fluidoSkin> </custom> + + <publishDate format="yyyy-MM-dd" position="right" /> + <version position="right" /> + <body> <breadcrumbs> <!-- TODO: need to stop them inheriting |