bugfix
This commit is contained in:
parent
dc98ed767e
commit
36568915c8
2 changed files with 15 additions and 2 deletions
11
Jenkinsfile
vendored
11
Jenkinsfile
vendored
|
|
@ -13,7 +13,7 @@ node {
|
||||||
checkout scm
|
checkout scm
|
||||||
}
|
}
|
||||||
|
|
||||||
withMaven(mavenConfiguration) {
|
withGradle {
|
||||||
def gradleParams = "--no-daemon -Pversion=1.0.${BUILD_NUMBER}"
|
def gradleParams = "--no-daemon -Pversion=1.0.${BUILD_NUMBER}"
|
||||||
|
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
|
|
@ -26,8 +26,15 @@ node {
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Deploy') {
|
stage('Deploy') {
|
||||||
|
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId:'gpg_key', usernameVariable: 'KEY_ID', passwordVariable: 'KEY_PASSWORD']]) {
|
||||||
|
sh "./gradlew ${gradleParams} -Psigning.homeDir=/var/jenkins_home/.gnupg_ci -psigning.keyId=${KEY_ID} -Psigning.password=${KEY_PASSWORD} sign"
|
||||||
|
}
|
||||||
|
|
||||||
sh "./gradlew ${gradleParams} publishToMavenLocal"
|
sh "./gradlew ${gradleParams} publishToMavenLocal"
|
||||||
sh "./gradlew ${gradleParams} -Prelease publish"
|
|
||||||
|
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId:'36795fd4-6f0a-491b-b869-b26ec9c06996', usernameVariable: 'SONATYPE_NEXUS_USERNAME', passwordVariable: 'SONATYPE_NEXUS_PASSWORD']]) {
|
||||||
|
sh "./gradlew ${gradleParams} -PSONATYPE_NEXUS_USERNAME=${SONATYPE_NEXUS_USERNAME} -PSONATYPE_NEXUS_PASSWORD=${SONATYPE_NEXUS_PASSWORD} -Prelease publish"
|
||||||
|
}
|
||||||
|
|
||||||
sh "mvn ${mvnParams} scm:tag"
|
sh "mvn ${mvnParams} scm:tag"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,11 @@ publishing {
|
||||||
def snapshotsRepoUrl = 'http://oss.sonatype.org/content/repositories/snapshots/'
|
def snapshotsRepoUrl = 'http://oss.sonatype.org/content/repositories/snapshots/'
|
||||||
def releasesRepoUrl = 'http://oss.sonatype.org/service/local/staging/deploy/maven2/'
|
def releasesRepoUrl = 'http://oss.sonatype.org/service/local/staging/deploy/maven2/'
|
||||||
url = project.hasProperty('release') && !version.endsWith('SNAPSHOT') ? releasesRepoUrl : snapshotsRepoUrl
|
url = project.hasProperty('release') && !version.endsWith('SNAPSHOT') ? releasesRepoUrl : snapshotsRepoUrl
|
||||||
|
|
||||||
|
credentials {
|
||||||
|
username System.getenv('SONATYPE_NEXUS_USERNAME')
|
||||||
|
password System.getenv('SONATYPE_NEXUS_PASSWORD')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -49,6 +54,7 @@ publishing {
|
||||||
// Signing
|
// Signing
|
||||||
|
|
||||||
signing {
|
signing {
|
||||||
|
useGpgCmd()
|
||||||
sign publishing.publications.mavenJava
|
sign publishing.publications.mavenJava
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue