The Lockdown Gradle plug-in is intended for use in Gradle builds, to allow teams to easily expose the ability to add/update credentials in credential storage files without requiring all team members to install the Lockdown CLI.
Add the Lockdown Gradle plug-in to your buildscript classpath, and then use the AddCredentialsTask to allow developers to add encrypted values
buildscript {
repositories {
jcenter()
}
dependencies {
classpath group: 'org.starchartlabs.lockdown', name: 'lockdown-gradle-plugin', version: '2.0.0'
}
}
task addCredentials(type: org.starchartlabs.lockdown.gradle.task.AddCredentialsTask){
publicKey "${projectDir}/id_rsa.pub"
credentialFile "${projectDir}/credentials.properties"
}
./gradlew addCredentials -PlookupKey=<lookupKey>
A dialog will appear to accept the credentials - once entered, they are encrypted and stored.
The -P argument for the lookupKey
determines which set of credentials is updated or created