diff --git a/Jenkinsfile b/Jenkinsfile index c11c66fc7b..45b5f506b7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -190,8 +190,8 @@ void withPublishEnivronment(Closure 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() diff --git a/build.gradle b/build.gradle index a4551da3dc..a59d812c6f 100644 --- a/build.gradle +++ b/build.gradle @@ -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 {