Skip to content

Commit

Permalink
Add capability to publish a patch
Browse files Browse the repository at this point in the history
  • Loading branch information
shyamz-22 committed Dec 17, 2017
1 parent b2076b6 commit cfc8acf
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 5 deletions.
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildscript {
}

plugins {
id 'net.nemerosa.versioning' version '2.0.0'
id 'net.nemerosa.versioning' version '2.6.1'
}

apply plugin: 'java'
Expand Down Expand Up @@ -60,9 +60,10 @@ artifacts {
}

versioning {
releaseMode = 'snapshot' // how to compute version on release-branches
displayMode = 'snapshot' // how to compute version on non-release-branches
dirty = { t -> t } // switch off dirty-suffix ( could be usefull for local development )
releaseBuild = VERSIONING_RELEASE_BUILD
releaseMode = VERSIONING_RELEASE_MODE
displayMode = VERSIONING_DISPLAY_MODE
dirty = { t -> t }
}

apply from: 'publishToMaven.gradle'
6 changes: 5 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ POM_DEVELOPER_ID=shyamz-22
POM_DEVELOPER_NAME=Syamala Umamaheswaran

RELEASE_REPOSITORY_URL=https://oss.sonatype.org/service/local/staging/deploy/maven2
SNAPSHOT_REPOSITORY_URL=https://oss.sonatype.org/content/repositories/snapshots
SNAPSHOT_REPOSITORY_URL=https://oss.sonatype.org/content/repositories/snapshots

VERSIONING_RELEASE_BUILD=false
VERSIONING_RELEASE_MODE=snapshot
VERSIONING_DISPLAY_MODE=snapshot
34 changes: 34 additions & 0 deletions publish/publish-patch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
set -x

set -e


main() {
git checkout master

local CURRENT_BRANCH=$(git branch -a | grep 'release/' | tail -n 1)

echo "${CURRENT_BRANCH}"

git checkout ${CURRENT_BRANCH}

./gradlew clean build

./gradlew versionFile

export $(cat build/version.properties | xargs)

GIT_TAG="${VERSION_DISPLAY}"

echo "./gradlew uploadArchives"

echo "git tag ${GIT_TAG}"

echo "git push --tag"

}


main $*

0 comments on commit cfc8acf

Please sign in to comment.