Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

[PT-563] Consume gradle plugins repo credentials from env #78

Merged
merged 2 commits into from
Feb 8, 2018

Conversation

tobiasheine
Copy link
Contributor

@tobiasheine tobiasheine commented Feb 8, 2018

Tracked in JIRA PT-563

Description

By having another look at the documentation I read that there is an alternative to putting the credentials to the gradle.properties. Instead we can set these project properties -Pgradle.publish.key=<key> -Pgradle.publish.secret=<secret>.

I added the credentials to Jenkins through the credentials plugin and bind them to the env variables GRADLE_PLUGINS_REPO_KEY and GRADLE_PLUGINS_REPO_SECRET.

Scope of this PR is to change prepareGradlePluginsRepoRelease to read these credentials from the env variables and set the project properties. As fallback for a local release we still also check the secrets.properties.

System.properties['com.gradle.login.properties.file'] = rootProject.file('secrets.properties')
String key = buildProperties.env['GRADLE_PLUGINS_REPO_KEY'].or(buildProperties.secrets['gradle.publish.key']).string
String secret = buildProperties.env['GRADLE_PLUGINS_REPO_SECRET'].or(buildProperties.secrets['gradle.publish.secret']).string
project.setProperty('gradle.publish.key', key)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should that be rootProject? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think project because we apply the publish plugin to project not root. I may be wrong :)

@tasomaniac tasomaniac merged commit 019de48 into develop Feb 8, 2018
@tasomaniac tasomaniac deleted the PT-563/consume_credentials_from_env branch February 8, 2018 13:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants