forked from oracle/coherence
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy snapshot docs in a separate action
(merge main -> ce/main 103368) [git-p4: depot-paths = "//dev/coherence-ce/main/": change = 103369]
- Loading branch information
1 parent
51df44a
commit 0680ef2
Showing
2 changed files
with
49 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters