-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3136 from elahrvivaz/fcr_refactor_builddir
Add release script
- Loading branch information
Showing
15 changed files
with
162 additions
and
895 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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
cd "$(dirname "$0")/.." || exit | ||
cd "$(dirname "$0")/../.." || exit | ||
|
||
mvn -Pbloop initialize ch.epfl.scala:bloop-maven-plugin:2.0.0:bloopInstall |
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
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
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,99 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
cd "$(dirname "$0")/../.." || exit | ||
|
||
usage() { | ||
echo "Usage: $(basename "$0") [-h|--help] | ||
where : | ||
-h| --help Display this help text | ||
" 1>&2 | ||
exit 1 | ||
} | ||
|
||
if [[ ($# -ne 0) || ( $1 == "--help") || $1 == "-h" ]]; then | ||
usage | ||
fi | ||
|
||
readReleaseProp() { | ||
grep "^$1=" release.properties | head -n1 | sed "s/$1=//" | ||
} | ||
|
||
readPomVersion() { | ||
grep '^ <version>' "$1" | head -n1 | sed -E 's|.*<version>(.*)</version>.*|\1|' | ||
} | ||
|
||
copyReleaseArtifacts() { | ||
while IFS= read -r -d '' file; do | ||
pushd "$(dirname "$file")" >/dev/null | ||
gpg --armor --detach-sign "$(basename "$file")" | ||
sha256sum "$(basename "$file")" > "$(basename "$file").sha256" | ||
popd >/dev/null | ||
mv "$file"{,.sha256,.asc} "$RELEASE" | ||
done < <(find geomesa-* -name '*-bin.tar.gz' -print0) | ||
} | ||
|
||
JAVA_VERSION="$(mvn help:evaluate -Dexpression=jdk.version -q -DforceStdout)" | ||
if ! [[ $(java -version 2>&1 | head -n 1 | cut -d'"' -f2) =~ ^$JAVA_VERSION.* ]]; then | ||
echo "Error: invalid Java version - Java $JAVA_VERSION required" | ||
exit 1 | ||
fi | ||
|
||
if ! [[ $(which gpg) ]]; then | ||
echo "Error: gpg executable not found" | ||
exit 1 | ||
fi | ||
|
||
# get current branch we're releasing off | ||
BRANCH="$(git branch --show-current)" | ||
|
||
# use the maven release plugin to prep the pom changes but use dryRun to skip commit and tag | ||
mvn release:prepare \ | ||
-DdryRun=true \ | ||
-DautoVersionSubmodules=true \ | ||
-Darguments="-DskipTests -Dmaven.javadoc.skip=true -Ppython" \ | ||
-Ppython | ||
|
||
RELEASE="$(readPomVersion pom.xml.tag)" | ||
TAG="$(readReleaseProp scm.tag)" | ||
NEXT="$(readPomVersion pom.xml.next)" | ||
|
||
# update README versions and commit | ||
for pom in pom.xml pom.xml.tag pom.xml.next; do | ||
sed -i "s|<geomesa\.release\.version>.*|<geomesa.release.version>$RELEASE</geomesa.release.version>|" "$pom" | ||
sed -i "s|<geomesa\.devel\.version>.*|<geomesa.devel.version>$NEXT</geomesa.devel.version>|" "$pom" | ||
done | ||
mvn clean install -pl . | ||
git commit -am "Set version for release $RELEASE" | ||
|
||
# commit release tag | ||
find . -name pom.xml -exec mv {}.tag {} \; | ||
git commit -am "[maven-release-plugin] prepare release $TAG" | ||
git tag "$TAG" | ||
|
||
# commit next dev version | ||
find . -name pom.xml -exec mv {}.next {} \; | ||
git commit -am "[maven-release-plugin] prepare for next development iteration" | ||
|
||
# clean up leftover release artifacts | ||
mvn release:clean | ||
|
||
# deploy to maven central | ||
git checkout "$TAG" | ||
mkdir -p "$RELEASE" | ||
|
||
mvn clean deploy -Pcentral,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 | ||
copyReleaseArtifacts | ||
|
||
# reset pom changes | ||
./build/scripts/change-scala-version.sh 2.12 | ||
|
||
# push commits and tags | ||
git checkout "$BRANCH" | ||
git push lt "$BRANCH" | ||
git push lt "$TAG" |
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
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
File renamed without changes
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
Oops, something went wrong.