-
Notifications
You must be signed in to change notification settings - Fork 17
/
release.sh
executable file
·43 lines (34 loc) · 1.73 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
set -e
SCRIPT_DIR=$(dirname $0)
USER_GRADLE_PROPERTIES=~/.gradle/gradle.properties
check_configured() {
grep -q "$1" ${USER_GRADLE_PROPERTIES} || echo "$1 not configured in ${USER_GRADLE_PROPERTIES}. $2"
}
check_configuration() {
if [ ! -f ${USER_GRADLE_PROPERTIES} ]; then
echo "${USER_GRADLE_PROPERTIES} does not exist"
exit 1
fi
check_configured "sonatypeUsername" "This is the username you use to authenticate with sonatype nexus (e.g. otto-de)"
check_configured "sonatypePassword" "This is the password you use to authenticate with sonatype nexus (ask Guido or one of the developers)"
check_configured "signing.secretKeyRingFile" "This is the gpg secret key file, e.g. ~/.gnupg/secring.gpg. If this doesn't exist, generate a key: gpg --gen-key"
check_configured "signing.keyId" "This is the id of your key (e.g. 72FE5380). Use gpg --list-keys to find yours"
check_configured "signing.password" "This is the password you defined for your gpg key"
# gpg --send-keys --keyserver keyserver.ubuntu.com yourKeyId
}
check_configuration
set +e
grep 'def jlineup_version = ".*-SNAPSHOT"' "$SCRIPT_DIR/build.gradle"
SNAPSHOT=$?
set -e
"${SCRIPT_DIR}"/gradlew clean
"${SCRIPT_DIR}"/gradlew check
"${SCRIPT_DIR}"/gradlew -Dorg.gradle.internal.http.socketTimeout=200000 -Dorg.gradle.internal.http.connectionTimeout=200000 build installBootDist
"${SCRIPT_DIR}"/gradlew -Dorg.gradle.internal.http.socketTimeout=200000 -Dorg.gradle.internal.http.connectionTimeout=200000 publish
if [[ $SNAPSHOT == 1 ]]; then
echo "Closing and releasing into Sonatype OSS repository"
"${SCRIPT_DIR}"/gradlew closeAndReleaseRepository
else
echo "This is a snapshot release, closing in sonatype is not necessary"
fi