Implemented support for custom gradle setting
This commit is contained in:
parent
e9ccfd15de
commit
b4719d2eb4
3 changed files with 29 additions and 12 deletions
18
Jenkinsfile
vendored
18
Jenkinsfile
vendored
|
|
@ -13,12 +13,6 @@ pipeline {
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Checkout') {
|
|
||||||
steps {
|
|
||||||
checkout scm
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
steps{
|
steps{
|
||||||
withGradle {
|
withGradle {
|
||||||
|
|
@ -27,7 +21,7 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
stage('Test') {
|
stage('Test') {
|
||||||
steps {
|
steps {
|
||||||
withGradle {
|
withGradle {
|
||||||
|
|
@ -35,16 +29,16 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
stage('Deploy') {
|
stage('Deploy') {
|
||||||
steps {
|
steps {
|
||||||
withGradle {
|
withGradle {
|
||||||
configFileProvider([configFile(fileId: '70cb2022-0bc2-4b25-98a4-e1526dbf2735')]) {
|
configFileProvider([configFile(fileId: '70cb2022-0bc2-4b25-98a4-e1526dbf2735', variable: 'GRADLE_PROPERTIES')]) {
|
||||||
sh 'GPG_TTY=$(tty) ./gradlew ${gradleParams} sign'
|
sh 'GPG_TTY=$(tty) ./gradlew ${gradleParams} -PcustomProperties=${GRADLE_PROPERTIES} sign'
|
||||||
|
|
||||||
sh "./gradlew ${gradleParams} publishToMavenLocal"
|
sh './gradlew ${gradleParams} publishToMavenLocal'
|
||||||
|
|
||||||
sh './gradlew ${gradleParams} -Prelease publish'
|
sh './gradlew ${gradleParams} -Prelease -PcustomProperties=${GRADLE_PROPERTIES} publish'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
build.gradle
12
build.gradle
|
|
@ -5,6 +5,18 @@ plugins {
|
||||||
|
|
||||||
apply from: 'build_publish.gradle'
|
apply from: 'build_publish.gradle'
|
||||||
|
|
||||||
|
// Load custom properties
|
||||||
|
if (project.hasProperty('customProperties')) {
|
||||||
|
project.logger.info("Loading custom properties from: ${project.property('customProperties')}")
|
||||||
|
def props = new Properties()
|
||||||
|
file(project.property('customProperties')).withInputStream { props.load(it) }
|
||||||
|
|
||||||
|
props.each {key, value ->
|
||||||
|
project.logger.info("Updating property: ${key}")
|
||||||
|
project.ext[key] = value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|
|
||||||
11
custom.properties
Normal file
11
custom.properties
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
# ~/.gradle/gradle.properties
|
||||||
|
|
||||||
|
SONATYPE_NEXUS_USERNAME=RkGxVN2E
|
||||||
|
SONATYPE_NEXUS_PASSWORD=
|
||||||
|
|
||||||
|
signing.keyId=21038C46
|
||||||
|
signing.password=
|
||||||
|
|
||||||
|
signing.gnupg.keyName=21038C46
|
||||||
|
signing.gnupg.passphrase=
|
||||||
|
signing.gnupg.useLegacyGpg=true
|
||||||
Loading…
Add table
Add a link
Reference in a new issue