This is an automated email from the ASF dual-hosted git repository. gmcdonald pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tac-website.git
commit d6fda987174b94d7ea3fdddba766dfae43198a5a Author: gmcdonald <[email protected]> AuthorDate: Sat Feb 25 12:23:31 2023 +0100 tweaks --- Jenkinsfile | 40 +++++++++++++++++++++++++++++--- layouts/_default/baseof.html | 1 + source/stories/{_index.md => __index.md} | 0 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d9d4918..5e68008 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,8 +23,9 @@ pipeline { } environment { - HUGO_VERSION = '0.63.2' + 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 { @@ -71,7 +106,6 @@ pipeline { script { // Checkout branch with generated content sh """ - git fetch git checkout ${DEPLOY_BRANCH} git pull origin ${DEPLOY_BRANCH} """ @@ -85,7 +119,7 @@ pipeline { """ // Commit the changes to the target branch - env.COMMIT_MESSAGE = "Updated ${DEPLOY_BRANCH} from ${BRANCH_NAME} at ${env.LAST_SHA} using ${BUILD_URL}" + env.COMMIT_MESSAGE = "Updated site from ${BRANCH_NAME} (${env.LAST_SHA})" sh """ git add -A git commit -m "${env.COMMIT_MESSAGE}" | true diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 8a60f76..bd004a0 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -71,6 +71,7 @@ </a> <div class="dropdown-menu" aria-labelledby="aboutDropdown"> <a class="dropdown-item" href="/about/">What We Do</a> + <a class="dropdown-item" href="/stories/">Stories</a> <div class="dropdown-divider"></div> <a class="dropdown-item text-uppercase disabled" href="#">About Apache</a> <a class="dropdown-item" href="https://www.apache.org/">The Apache Software Foundation</a> diff --git a/source/stories/_index.md b/source/stories/__index.md similarity index 100% rename from source/stories/_index.md rename to source/stories/__index.md --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
