Fix passing of singing props from jenkins

This commit is contained in:
Sebastian Sdorra
2021-01-15 09:16:22 +01:00
parent bef74366ff
commit f0d8ff178c
2 changed files with 16 additions and 2 deletions

4
Jenkinsfile vendored
View File

@@ -190,8 +190,8 @@ void withPublishEnivronment(Closure<Void> closure) {
usernamePassword(credentialsId: 'hub.docker.com-cesmarvin', usernameVariable: 'ORG_GRADLE_PROJECT_dockerUsername', passwordVariable: 'ORG_GRADLE_PROJECT_dockerPassword'),
usernamePassword(credentialsId: 'cesmarvin-github', usernameVariable: 'ORG_GRADLE_PROJECT_gitHubUsername', passwordVariable: 'ORG_GRADLE_PROJECT_gitHubApiToken'),
string(credentialsId: 'cesmarvin_npm_token', variable: 'ORG_GRADLE_PROJECT_npmToken'),
file(credentialsId: 'oss-gpg-secring', variable: 'ORG_GRADLE_PROJECT_signing.secretKeyRingFile'),
usernamePassword(credentialsId: 'oss-keyid-and-passphrase', usernameVariable: 'ORG_GRADLE_PROJECT_signing.keyId', passwordVariable: 'ORG_GRADLE_PROJECT_signing.password')
file(credentialsId: 'oss-gpg-secring', variable: 'GPG_KEY_RING'),
usernamePassword(credentialsId: 'oss-keyid-and-passphrase', usernameVariable: 'GPG_KEY_ID', passwordVariable: 'GPG_KEY_PASSWORD')
]) {
withEnv(["ORG_GRADLE_PROJECT_npmEmail=cesmarvin@cloudogu.com"]) {
closure.call()

View File

@@ -149,6 +149,20 @@ project.ext {
isCI = isRunningOnCiServer()
os = os()
arch = arch()
// map signing environment variables
// this is required because of environment variables should not have a dot in the name
// but the gradle signing props are using dots
// also we use the set method, because setting props with dots works neither
if (isEnvAvailable("GPG_KEY_RING")) {
set('signing.secretKeyRingFile', System.getenv("GPG_KEY_RING"))
}
if (isEnvAvailable("GPG_KEY_ID")) {
set('signing.keyId', System.getenv("GPG_KEY_ID"))
}
if (isEnvAvailable("GPG_KEY_PASSWORD")) {
set('signing.password', System.getenv("GPG_KEY_PASSWORD"))
}
}
publishing {