Skip to content
Permalink
Browse files
Initial commit. Consolidation of redback components into one git proj…
…ect.
  • Loading branch information
effrafax committed Oct 17, 2019
0 parents commit 768ab52470f7b286e7423905b4f0fa8707fdffdb
Showing 9 changed files with 1,181 additions and 0 deletions.
@@ -0,0 +1,25 @@
target
build

#idea files
*.iml
.idea
*.ipr
*.iws
out/

#jenv
.java-version

.DS_Store
.extract
.site-content/

#eclipse files
.project
.classpath
.settings/

#netbeans file
nbactions.xml
nb-configuration.xml
409 LICENSE

Large diffs are not rendered by default.

5 NOTICE
@@ -0,0 +1,5 @@
Apache Archiva Components projects
Copyright 2006-2019 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
@@ -0,0 +1,94 @@
Archiva Redback Documentation - Component Documentation
=======================================================

== Licensing information

Archiva Compontents is developed under the Apache License Version 2.0


:toc:

This is project contains multiple (mostly independent) modules used by different projects related
to Apache Archiva.

== Development

To get involved in Archiva development, contact dev@archiva.apache.org.
Users with questions may mail to users@archiva.apache.org.


== 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

/components/

=== 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 site directory:

.The following creates the site to the staging folder

mvn clean site
mvn site:stage

The result can be checked in

site/target/staging/components/

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.


@@ -0,0 +1,135 @@
#!/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-03
#
# This script runs a sparse git clone of a remote repository and
# initializes the git configuration.
#
# It is mainly used for site content creation, because the main archiva-web-content repository
# is rather large and we don't want to checkout the complete data.
#

SITE_DIR=".site-content"
GIT_REMOTE=""

GIT_USER=$(git config user.name)
GIT_EMAIL=$(git config user.email)

GIT_PATTERN_FILE="git-sparse-checkout-pattern"
GIT_PATTERN_DEST=".git/info/sparse-checkout"

MY_PWD=$(pwd)

CLONE=1
FORCE=1
MODULE_DIR="${MY_PWD}"
PATTERN=""
while [ ! -z "$1" ]; do
case "$1" in
-f)
FORCE=0
shift
;;
-d)
shift
SITE_DIR="$1"
shift
;;
-p)
shift
if [ -z "${PATTERN}" ]; then
PATTERN="${1}"
else
PATTERN="${PATTERN}\n${1}"
fi
shift
;;
-m)
shift
MODULE_DIR="$1"
shift
;;
*)
GIT_REMOTE="$1"
shift
;;
esac
done

print_usage() {
echo "checkoutRepo [-m MODULE_DIR] [-d SITE_DIR] [-f] GIT_URL"
echo " -m: The module directory where the pattern file can be found and the site dir will be created."
echo " -d SITE_DIR: Use the given directory for checkout"
echo " -f: Force clone, even if directory exists"
}

if [ ! -f "${MODULE_DIR}/pom.xml" ]; then
echo "Looks like the working directory is not a valid dir. No pom.xml found."
exit 1
fi

cd "${MODULE_DIR}" || { echo "Could not change to module directory ${MODULE_DIR}"; exit 1; }

if [ -z "$GIT_REMOTE" ]; then
print_usage
exit 1
fi

if [ "${GIT_REMOTE:0:8}" == "scm:git:" ]; then
GIT_REMOTE="${GIT_REMOTE:8}"
fi


if [ -d "${SITE_DIR}" ]; then
if [ ! -d "${SITE_DIR}/.git" ]; then
echo "Directory ${SITE_DIR} exist already, but is not a git clone. Aborting."
exit 1
elif [ "$FORCE" -eq 0 ]; then
CLONE=0
fi
else
CLONE=0
fi

if [ $CLONE -eq 0 ]; then
git clone "${GIT_REMOTE}" "${SITE_DIR}" --no-checkout
if [ $? -ne 0 ]; then
echo "Git clone failed"
exit 1
fi
fi

cd "${SITE_DIR}" || { echo "Could not change to site dir ${SITE_DIR}"; exit 1; }

git config core.sparsecheckout true
git config user.name "${GIT_USER}"
git config user.email "${GIT_EMAIL}"

if [ ! -z "${PATTERN}" ]; then
echo -e "${PATTERN}" >"${GIT_PATTERN_DEST}"
elif [ -f "../${GIT_PATTERN_FILE}" ]; then
cp "../${GIT_PATTERN_FILE}" "${GIT_PATTERN_DEST}"
fi

git checkout --

cd "${MY_PWD}"

@@ -0,0 +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"

SUB_DIR="redback/components"

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

@@ -0,0 +1 @@
/redback/components

0 comments on commit 768ab52

Please sign in to comment.