-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 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,41 @@ | ||
#!/bin/bash | ||
|
||
function user_continue() { | ||
read -p "Do you want to continue? [y/n]" -n 1 -r | ||
echo | ||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then | ||
exit 1 | ||
fi | ||
} | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "USAGE: `basename $0` <repo-path>" | ||
exit | ||
fi | ||
|
||
REPO_PATH="${1}" | ||
SHA=`git rev-parse --verify HEAD` | ||
echo "=================================================================" | ||
echo "BEGIN PUBLISH SNAPSHOT for revision ${SHA} at ${REPO_PATH}" | ||
echo "=================================================================" | ||
user_continue | ||
|
||
# update pom to release version | ||
mvn clean && mvn package -Dmaven.javadoc.skip=true -B -V | ||
|
||
# Clone the maven repo | ||
pushd ${REPO_PATH} | ||
git pull | ||
popd | ||
|
||
# Deploy the artifact to the maven repo | ||
mvn deploy -DskipTests -DaltDeploymentRepository=snapshot::default::file://${REPO_PATH} | ||
|
||
# Push changes to the maven repo | ||
pushd ${REPO_PATH} | ||
git add . | ||
git commit -a -m "Publish snapshot: ${SHA}" | ||
git push origin master | ||
popd | ||
|
||
echo "Successfully published SNAPSHOT artifacts for ${SHA}" |