From ddfeccc11e72b1b2c2e4f9b85426cc96e4673c46 Mon Sep 17 00:00:00 2001 From: Emilio Lahr-Vivaz Date: Fri, 20 Sep 2024 10:29:05 -0400 Subject: [PATCH 1/3] GEOMESA-3398 Bundle documentation with CLI tools --- build/scripts/do-release.sh | 20 ++++++++++++++++--- .../assembly.xml | 11 ++++++---- .../geomesa-archetypes-binary-dist/pom.xml | 8 ++++++++ 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/build/scripts/do-release.sh b/build/scripts/do-release.sh index d43897808de3..8112e75365f0 100755 --- a/build/scripts/do-release.sh +++ b/build/scripts/do-release.sh @@ -16,11 +16,16 @@ if [[ ($# -ne 0) || ( $1 == "--help") || $1 == "-h" ]]; then usage fi +# reads a property out of the release.properties file generated by mvn release:prepare +# args: name of the property to read readReleaseProp() { grep "^$1=" release.properties | head -n1 | sed "s/$1=//" } +# reads the main version out of the pom +# args: pom file to read from readPomVersion() { + # the indentation only matches the top-level version tag grep '^ ' "$1" | head -n1 | sed -E 's|.*(.*).*|\1|' } @@ -41,10 +46,18 @@ if ! [[ $(java -version 2>&1 | head -n 1 | cut -d'"' -f2) =~ ^$JAVA_VERSION.* ]] fi if ! [[ $(which gpg) ]]; then - echo "Error: gpg executable not found" + echo "Error: gpg executable not found (required for signed release)" exit 1 fi +if ! [[ $(which virtualenv) ]]; then + echo "Error: virtualenv executable not found (required for building docs)" + exit 1 +fi + +# configure virtualenv for building the docs +virtualenv .sphinx && source .sphinx/bin/activate && pip install -r docs/requirements.txt + # get current branch we're releasing off BRANCH="$(git branch --show-current)" @@ -64,6 +77,7 @@ for pom in pom.xml pom.xml.tag pom.xml.next; do sed -i "s|.*|$RELEASE|" "$pom" sed -i "s|.*|$NEXT|" "$pom" done +# regenerates the README mvn clean install -pl . git commit -am "Set version for release $RELEASE" @@ -83,11 +97,11 @@ mvn release:clean git checkout "$TAG" mkdir -p "$RELEASE" -mvn clean deploy -Pcentral,python -DskipTests | tee build_2.12.log +mvn clean deploy -Pcentral,docs,python -DskipTests | tee build_2.12.log copyReleaseArtifacts ./build/scripts/change-scala-version.sh 2.13 -mvn clean deploy -Pcentral,python -DskipTests | tee build_2.13.log +mvn clean deploy -Pcentral,docs,python -DskipTests | tee build_2.13.log copyReleaseArtifacts # reset pom changes diff --git a/geomesa-archetypes/geomesa-archetypes-binary-dist/assembly.xml b/geomesa-archetypes/geomesa-archetypes-binary-dist/assembly.xml index 3c4f249887d4..98df1ce402c3 100644 --- a/geomesa-archetypes/geomesa-archetypes-binary-dist/assembly.xml +++ b/geomesa-archetypes/geomesa-archetypes-binary-dist/assembly.xml @@ -16,6 +16,7 @@ org.locationtech.geomesa:geomesa-${tools.module}-spark* org.locationtech.geomesa:geomesa-spark* org.locationtech.geomesa:geomesa-process-wps* + org.locationtech.geomesa:docs com.google.guava:guava @@ -88,7 +89,6 @@ conf 755 0644 - false ../geomesa-${tools.module}-tools/conf-filtered @@ -115,7 +115,6 @@ conf 755 0644 - false ../../geomesa-tools/conf-filtered @@ -129,14 +128,12 @@ examples 755 0644 - false ../../geomesa-tools/examples conf/sfts/examples 755 0644 - false **/application.conf @@ -149,6 +146,12 @@ */** + + ../../docs/target/html + docs + 0700 + 0644 + diff --git a/geomesa-archetypes/geomesa-archetypes-binary-dist/pom.xml b/geomesa-archetypes/geomesa-archetypes-binary-dist/pom.xml index 61d6f142080e..573fec66a363 100644 --- a/geomesa-archetypes/geomesa-archetypes-binary-dist/pom.xml +++ b/geomesa-archetypes/geomesa-archetypes-binary-dist/pom.xml @@ -63,6 +63,14 @@ scala-compiler provided + + + + org.locationtech.geomesa + docs + ${project.version} + pom + From 0a9812a2a71170363c34ff1f35076f3bc7b7afa5 Mon Sep 17 00:00:00 2001 From: Emilio Lahr-Vivaz Date: Fri, 20 Sep 2024 10:30:57 -0400 Subject: [PATCH 2/3] exit virtualenv in script --- build/scripts/do-release.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/scripts/do-release.sh b/build/scripts/do-release.sh index 8112e75365f0..d80017248502 100755 --- a/build/scripts/do-release.sh +++ b/build/scripts/do-release.sh @@ -107,6 +107,9 @@ copyReleaseArtifacts # reset pom changes ./build/scripts/change-scala-version.sh 2.12 +# exit virtualenv +deactivate + # push commits and tags git checkout "$BRANCH" git push lt "$BRANCH" From de8dcf5080321448f1188b2c21654397d0680413 Mon Sep 17 00:00:00 2001 From: Emilio Lahr-Vivaz Date: Fri, 20 Sep 2024 10:39:32 -0400 Subject: [PATCH 3/3] disable shellcheck trying to follow virtualenv --- build/scripts/do-release.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build/scripts/do-release.sh b/build/scripts/do-release.sh index d80017248502..99c475e4ffd2 100755 --- a/build/scripts/do-release.sh +++ b/build/scripts/do-release.sh @@ -56,6 +56,7 @@ if ! [[ $(which virtualenv) ]]; then fi # configure virtualenv for building the docs +# shellcheck disable=SC1091 virtualenv .sphinx && source .sphinx/bin/activate && pip install -r docs/requirements.txt # get current branch we're releasing off