Skip to content

Commit 00434a6

Browse files
author
Marcel Schnelle
committed
Fixed Travis deployment of snapshots by falling back to sysenv correctly
1 parent f39e7d6 commit 00434a6

File tree

4 files changed

+17
-20
lines changed

4 files changed

+17
-20
lines changed

android-junit5/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ project.configure(project) {
167167
repo = "maven"
168168
name = ARTIFACT_ID
169169
userOrg = project.ext.bintrayUser
170-
licenses = ["EPL-1.0"]
170+
licenses = [LICENCE_NAME]
171171
publish = true
172172
publicDownloadNumbers = true
173173
vcsUrl = VCS_URL

build.gradle

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,26 @@ buildscript {
88
}
99
}
1010

11-
// Populate deployment credentials:
12-
// * Local development - stored in properties file
13-
// * CI Server - stored in environment variables
14-
def bintrayUser = ""
15-
def bintrayKey = ""
16-
def sonatypeUser = ""
17-
def sonatypePass = ""
11+
// Populate deployment credentials in an environment-aware fashion.
12+
//
13+
// * Local development:
14+
// Stored in local.properties file on the machine
15+
// * CI Server:
16+
// Stored in environment variables before launch
17+
Properties properties = new Properties()
1818

1919
def credentialsFile = new File(project.rootDir, "local.properties")
2020
if (credentialsFile.exists()) {
21-
Properties properties = new Properties()
2221
credentialsFile.withReader { properties.load(it) }
23-
bintrayUser = properties.get("BINTRAY_USER")
24-
bintrayKey = properties.get("BINTRAY_KEY")
25-
sonatypeUser = properties.get("SONATYPE_USER")
26-
sonatypePass = properties.get("SONATYPE_PASS")
27-
28-
} else {
29-
bintrayUser = System.getenv("bintrayUser")
30-
bintrayKey = System.getenv("bintrayKey")
31-
sonatypeUser = System.getenv("sonatypeUser")
32-
sonatypePass = System.getenv("sonatypePass")
3322
}
3423

24+
// @formatter:off
25+
def bintrayUser = properties.get("BINTRAY_USER", System.getenv("bintrayUser"))
26+
def bintrayKey = properties.get("BINTRAY_KEY", System.getenv("bintrayKey"))
27+
def sonatypeUser = properties.get("SONATYPE_USER", System.getenv("sonatypeUser"))
28+
def sonatypePass = properties.get("SONATYPE_PASS", System.getenv("sonatypePass"))
29+
// @formatter:on
30+
3531
allprojects {
3632
repositories {
3733
google()

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
GROUP_ID = de.mannodermaus.gradle.plugins
55
ARTIFACT_ID = android-junit5
66
VERSION_NAME = 1.0.0-M5-SNAPSHOT
7+
LICENCE_NAME = EPL-1.0
78
DESCRIPTION = Unit Testing with JUnit 5 for Android.
89
VCS_URL = https://github.com/aurae/android-junit5
910

scripts/deploy_snapshot.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ elif [ "$TRAVIS_BRANCH" != "$BRANCH" ]; then
2121
echo "Skipping snapshot deployment: wrong branch. Expected '$BRANCH' but was '$TRAVIS_BRANCH'."
2222
else
2323
echo "Deploying snapshot..."
24-
./gradlew publishLibraryPublicationToSnapshotRepository
24+
./gradlew publishLibraryPublicationToSnapshotRepository --info --stacktrace
2525
echo "Snapshot deployed!"
2626
fi

0 commit comments

Comments
 (0)