From 0680ef279b89c573a74837f6a69f310aaa9dceec Mon Sep 17 00:00:00 2001 From: Jonathan Knight Date: Tue, 19 Sep 2023 16:35:31 +0000 Subject: [PATCH] Deploy snapshot docs in a separate action (merge main -> ce/main 103368) [git-p4: depot-paths = "//dev/coherence-ce/main/": change = 103369] --- tools/bin/github-deploy-snapshot-docs.sh | 49 ++++++++++++++++++++++++ tools/bin/github-deploy-snapshots.sh | 24 ------------ 2 files changed, 49 insertions(+), 24 deletions(-) create mode 100755 tools/bin/github-deploy-snapshot-docs.sh diff --git a/tools/bin/github-deploy-snapshot-docs.sh b/tools/bin/github-deploy-snapshot-docs.sh new file mode 100755 index 0000000000000..91c620047cf61 --- /dev/null +++ b/tools/bin/github-deploy-snapshot-docs.sh @@ -0,0 +1,49 @@ +#!/bin/sh +set -e +# +# Copyright (c) 2000, 2022, Oracle and/or its affiliates. +# +# Licensed under the Universal Permissive License v 1.0 as shown at +# http://oss.oracle.com/licenses/upl. +# + +CURRENT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + +if [ "${CURRENT_VERSION}" = "" ]; then + echo "Could not find current version from Maven" + exit 1 +fi + +echo "${CURRENT_VERSION}" | grep -q "SNAPSHOT" +if [ $? != 0 ] ; then + echo "This job only deploys SNAPSHOT versions, skipping version ${CURRENT_VERSION}" + exit 0 +fi + +echo "Building version ${CURRENT_VERSION}" +mvn -B clean install -Dproject.official=true -P-modules --file prj/pom.xml -DskipTests -s .github/maven/settings.xml +mvn -B clean install -Dproject.official=true -Pmodules,-coherence,docs -nsu --file prj/pom.xml -DskipTests -s .github/maven/settings.xml + +echo "Deploying docs for version ${CURRENT_VERSION}" +git stash save --keep-index --include-untracked || true +git stash drop || true +git checkout gh-pages +git config pull.rebase true +git pull + +rm -rf "${CURRENT_VERSION}" || true +mkdir -p "${CURRENT_VERSION}"/api || true +mv prj/coherence-javadoc/target/javadoc/apidocs "${CURRENT_VERSION}"/api/java +mv prj/docs/target/docs "${CURRENT_VERSION}"/docs +git add -A "${CURRENT_VERSION}"/* + +if [ "${HEAD_BRANCH}" = "master" ]; then + echo "Deploying docs for version ${CURRENT_VERSION} to latest-snapshot" + rm -rf latest-snapshot || true + cp -R "${CURRENT_VERSION}" latest-snapshot + git add -A latest-snapshot/* +fi + +echo "Pushing docs for ${CURRENT_VERSION} to gh-pages" +git commit -m "Update ${CURRENT_VERSION} docs" +git push origin gh-pages \ No newline at end of file diff --git a/tools/bin/github-deploy-snapshots.sh b/tools/bin/github-deploy-snapshots.sh index 44eb3215ba921..82f5a6a83607a 100755 --- a/tools/bin/github-deploy-snapshots.sh +++ b/tools/bin/github-deploy-snapshots.sh @@ -27,27 +27,3 @@ mvn -B clean install -Dproject.official=true -Pmodules,-coherence,docs -nsu --fi echo "Deploying version ${CURRENT_VERSION}" mvn -B clean deploy -Dproject.official=true -P-modules -nsu --file prj/pom.xml -DskipTests -s .github/maven/settings.xml mvn -B clean deploy -Dproject.official=true -Pmodules,-coherence,docs -nsu --file prj/pom.xml -DskipTests -s .github/maven/settings.xml - -echo "Deploying docs for version ${CURRENT_VERSION}" -git stash save --keep-index --include-untracked || true -git stash drop || true -git checkout gh-pages -git config pull.rebase true -git pull - -rm -rf "${CURRENT_VERSION}" || true -mkdir -p "${CURRENT_VERSION}"/api || true -mv prj/coherence-javadoc/target/javadoc/apidocs "${CURRENT_VERSION}"/api/java -mv prj/docs/target/docs "${CURRENT_VERSION}"/docs -git add -A "${CURRENT_VERSION}"/* - -if [ "${HEAD_BRANCH}" = "master" ]; then - echo "Deploying docs for version ${CURRENT_VERSION} to latest-snapshot" - rm -rf latest-snapshot || true - cp -R "${CURRENT_VERSION}" latest-snapshot - git add -A latest-snapshot/* -fi - -echo "Pushing docs for ${CURRENT_VERSION} to gh-pages" -git commit -m "Update ${CURRENT_VERSION} docs" -git push origin gh-pages