1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00

Merge pull request #471 from marcusholl/pr/removeNeoCredentialsCheck

Removing check for neo deploy credentials id
This commit is contained in:
Marcus Holl 2019-03-12 10:15:19 +01:00 committed by GitHub
commit d3bf402621
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,6 +62,7 @@ void call(parameters = [:]) {
.mixin(parameters, PARAMETER_KEYS, CONFIG_KEY_COMPATIBILITY)
.withMandatoryProperty('neo')
.withMandatoryProperty('source')
.withMandatoryProperty('neo/credentialsId')
.withPropertyInValues('deployMode', DeployMode.stringValues())
.use()
@ -80,45 +81,41 @@ void call(parameters = [:]) {
ToolDescriptor neo = new ToolDescriptor('SAP Cloud Platform Console Client', 'NEO_HOME', 'neoHome', '/tools/', 'neo.sh', null, 'version')
ToolDescriptor java = new ToolDescriptor('Java', 'JAVA_HOME', '', '/bin/', 'java', '1.8.0', '-version 2>&1')
if (configuration.neo.credentialsId) {
withCredentials([usernamePassword(
credentialsId: configuration.neo.credentialsId,
passwordVariable: 'NEO_PASSWORD',
usernameVariable: 'NEO_USERNAME')]) {
withCredentials([usernamePassword(
credentialsId: configuration.neo.credentialsId,
passwordVariable: 'NEO_PASSWORD',
usernameVariable: 'NEO_USERNAME')]) {
assertPasswordRules(NEO_PASSWORD)
assertPasswordRules(NEO_PASSWORD)
dockerExecute(
script: script,
dockerImage: configuration.dockerImage,
dockerEnvVars: configuration.dockerEnvVars,
dockerOptions: configuration.dockerOptions
) {
dockerExecute(
script: script,
dockerImage: configuration.dockerImage,
dockerEnvVars: configuration.dockerEnvVars,
dockerOptions: configuration.dockerOptions
) {
neo.verify(this, configuration)
java.verify(this, configuration)
neo.verify(this, configuration)
java.verify(this, configuration)
String neoExecutable = neo.getToolExecutable(script, configuration)
String neoExecutable = neo.getToolExecutable(script, configuration)
DeployMode deployMode = DeployMode.fromString(configuration.deployMode)
DeployMode deployMode = DeployMode.fromString(configuration.deployMode)
NeoCommandHelper neoCommandHelper = new NeoCommandHelper(
this,
deployMode,
configuration.neo,
neoExecutable,
NEO_USERNAME,
NEO_PASSWORD,
configuration.source
)
NeoCommandHelper neoCommandHelper = new NeoCommandHelper(
this,
deployMode,
configuration.neo,
neoExecutable,
NEO_USERNAME,
NEO_PASSWORD,
configuration.source
)
lock("$STEP_NAME :${neoCommandHelper.resourceLock()}") {
deploy(script, utils, configuration, neoCommandHelper, configuration.dockerImage, deployMode)
}
lock("$STEP_NAME :${neoCommandHelper.resourceLock()}") {
deploy(script, utils, configuration, neoCommandHelper, configuration.dockerImage, deployMode)
}
}
} else {
error("[neoDeploy] No credentials defined for the deployment. Please specify the value for credentialsId for neo.")
}
}
}