Skip to content
Browse files
Merge pull request #61 from apache/enable-staging-publish
Add staging stage to Jenkinsfile
  • Loading branch information
rvesse committed Jun 22, 2021
2 parents 6dadaeb + 4321eff commit c1436032c1692d7f8df704f5ff65f4f6ff7117f6
Showing 3 changed files with 52 additions and 13 deletions.
@@ -25,6 +25,7 @@ pipeline {
environment {
HUGO_VERSION = '0.66.0'
DEPLOY_BRANCH = 'asf-site'
STAGING_BRANCH = 'asf-staging'

stages {
@@ -61,6 +62,40 @@ pipeline {
stage('Staging') {
when {
not {
branch 'main'
steps {
script {
// Checkout branch with generated content
sh """
git checkout ${STAGING_BRANCH}
git pull origin ${STAGING_BRANCH}

// Remove the content of the target branch and replace it with the content of the temp folder
sh """
rm -rf ${WORKSPACE}/content
git rm -r --cached content/*
mkdir -p ${WORKSPACE}/content
cp -rT ${env.TMP_DIR}/* ${WORKSPACE}/content

// Commit the changes to the target branch
env.COMMIT_MESSAGE = "Staged site from ${BRANCH_NAME} (${env.LAST_SHA})"
sh """
git add -A
git commit -m "${env.COMMIT_MESSAGE}" | true

// Push the generated content for deployment
sh "git push -u origin ${STAGING_BRANCH}"
stage('Deploy') {
when {
anyOf {
@@ -22,13 +22,19 @@ This is the source code for the website of [Apache Jena](

## Repository structure

This repository uses 3 branches for building the website.
This repository uses 3 branches for building the published website.

- The `main` branch, which contains all the sources for the website.
- The `asf-site` branch, which contains the generated website being used for the actual website.
- The `javadoc` branch, which has the javadoc to be published at
- The `javadoc` branch, which has the javadoc to be published as part of the main website under `documentation/javadoc/`

When contributing patches, please create pull requests for the `main` branch.

Additionally the repository also has a `asf-staging` branch that can be used to preview website changes
prior to publishing them to the main website. Any branch other than `main` that has a `Jenkinsfile`
present in it will automatically be staged at, the Javadoc from the
`javadoc` branch is also automatically staged into this staging site.

## Content Management System

The website uses Hugo as static website generator.
@@ -20,15 +20,15 @@ Please see the [Reviewing Contributions](reviewing_contributions.html) page for

#### Improving the Website

You can also help us improve the documentation on this website by making use of the Apache CMS which drives the website.
You can also help us improve the documentation on this website via Pull Request.

Please see [I'm not a committer on $project, which uses the CMS. Can I still use the
CMS?]( for guidance on how to do this. This process allows you to suggest
improvements to the project website as patches (because everything at Apache lives in SVN) and helps the wider community.
Contributions to documentation are always welcome and considered just as valuable as code contributions.
The website source lives in an Apache git repository at []. There is also a full read-write mirror on
GitHub, see [jena-site on GitHub](

You can click the <span class="glyphicon glyphicon-pencil"></span>*Improve this Page* button (top-right) on any page to instantly open the web based CMS editor. If prompted you
will need to use the username `anonymous` and a blank password to log in. Use the *[Diff]* and *[Mail Email]* links to submit your proposed changes to the Apache Jena committers.
git clone
cd jena-site

You can then make a branch, prepare your changes and submit a pull request. Please see the `` in that repository for more details.


@@ -49,14 +49,12 @@ If you have problems with any of our SNAPSHOTs, [let us know](/help_and_support/
You can check the state of each Jena development builds
on the [Apache Jenkins continuous integration server](*).

### Git repository

You can find the Jena source code in the Apache git repository:

There is also a read-only mirror of [Jena on GitHub](
There is also a full read-write mirror of [Jena on GitHub](

git clone
cd jena

0 comments on commit c143603

Please sign in to comment.