Update publication config

* Allows publication to a custom maven repo, as we do in CI tasks
* Adds `SKIP_TESTS` (defaults to `false`) param for quicker testing
of CI build task with `fly execute`
This commit is contained in:
Gareth Clay
2020-07-02 12:02:31 +01:00
committed by Gareth Clay
parent f9a6b9ab2a
commit 81ec2f15a3
4 changed files with 15 additions and 3 deletions

View File

@@ -232,6 +232,11 @@ configure(publishedProjects) {
apply plugin: 'maven-publish'
publishing {
repositories {
maven {
url = project.properties.getOrDefault('publicationRepository', "${System.getenv('HOME')}/.m2/repository")
}
}
publications {
mavenJava(MavenPublication) {
suppressAllPomMetadataWarnings()

View File

@@ -3,13 +3,19 @@
set -euo pipefail
readonly ONLY_SHOW_STANDARD_STREAMS_ON_TEST_FAILURE="${ONLY_SHOW_STANDARD_STREAMS_ON_TEST_FAILURE:-true}"
readonly SKIP_TESTS="${SKIP_TESTS:-false}"
# shellcheck source=common.sh
source "$(dirname "$0")/common.sh"
repository=$(pwd)/distribution-repository
if [ "$SKIP_TESTS" == "true" ]; then
build_task=assemble
else
build_task=build
fi
pushd git-repo >/dev/null
./gradlew --parallel clean build install \
./gradlew --parallel clean "$build_task" publish \
-PonlyShowStandardStreamsOnTestFailure="${ONLY_SHOW_STANDARD_STREAMS_ON_TEST_FAILURE}" \
-Dmaven.repo.local="${repository}"
-PpublicationRepository="${repository}"
popd >/dev/null

View File

@@ -37,7 +37,7 @@ git commit -m "Release v$stageVersion"
git tag -a "v$stageVersion" -m "Release v$stageVersion"
echo
./gradlew --no-daemon clean install -Dmaven.repo.local="${repository}"
./gradlew clean publish -PpublicationRepository="${repository}"
echo
echo "Setting next development version (v$nextVersion)"

View File

@@ -16,3 +16,4 @@ run:
path: git-repo/ci/scripts/build-project.sh
params:
ONLY_SHOW_STANDARD_STREAMS_ON_TEST_FAILURE: true
SKIP_TESTS: false