mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
Fix wrong backward compatibility handling for deployHost, deployAccount.
This commit is contained in:
parent
437abcf225
commit
f52cbbe36a
@ -468,4 +468,31 @@ class NeoDeploymentTest extends BasePipelineTest {
|
|||||||
warAction: 'illegalWARAction',
|
warAction: 'illegalWARAction',
|
||||||
vmSize: 'lite')
|
vmSize: 'lite')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void deployHostProvidedAsDeprecatedParameterTest() {
|
||||||
|
new File(workspacePath, archiveName) << "dummy archive"
|
||||||
|
cpe.setConfigProperty('CI_DEPLOY_ACCOUNT', 'configPropsUser123')
|
||||||
|
|
||||||
|
neoDeployScript.call(script: [commonPipelineEnvironment: cpe],
|
||||||
|
archivePath: archiveName,
|
||||||
|
deployHost: "my.deploy.host.com"
|
||||||
|
)
|
||||||
|
|
||||||
|
assert jlr.log.contains("[WARNING][neoDeploy] Deprecated parameter 'deployHost' is used. This will not work anymore in future versions. Use parameter 'host' instead.")
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void deployAccountProvidedAsDeprecatedParameterTest() {
|
||||||
|
new File(workspacePath, archiveName) << "dummy archive"
|
||||||
|
cpe.setConfigProperty('CI_DEPLOY_ACCOUNT', 'configPropsUser123')
|
||||||
|
|
||||||
|
neoDeployScript.call(script: [commonPipelineEnvironment: cpe],
|
||||||
|
archivePath: archiveName,
|
||||||
|
host: "my.deploy.host.com",
|
||||||
|
deployAccount: "myAccount"
|
||||||
|
)
|
||||||
|
|
||||||
|
assert jlr.log.contains("Deprecated parameter 'deployAccount' is used. This will not work anymore in future versions. Use parameter 'account' instead.")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,8 @@ def call(parameters = [:]) {
|
|||||||
'applicationName',
|
'applicationName',
|
||||||
'archivePath',
|
'archivePath',
|
||||||
'account',
|
'account',
|
||||||
|
'deployAccount', //deprecated, replaced by parameter 'account'
|
||||||
|
'deployHost', //deprecated, replaced by parameter 'host'
|
||||||
'deployMode',
|
'deployMode',
|
||||||
'dockerEnvVars',
|
'dockerEnvVars',
|
||||||
'dockerImage',
|
'dockerImage',
|
||||||
@ -60,14 +62,14 @@ def call(parameters = [:]) {
|
|||||||
stepConfiguration.put('account', defaultDeployAccount)
|
stepConfiguration.put('account', defaultDeployAccount)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(parameters.DEPLOY_HOST && !parameters.host) {
|
if(parameters.deployHost && !parameters.host) {
|
||||||
echo "[WARNING][${stepName}] Deprecated parameter 'DEPLOY_HOST' is used. This will not work anymore in future versions. Use parameter 'host' instead."
|
echo "[WARNING][${stepName}] Deprecated parameter 'deployHost' is used. This will not work anymore in future versions. Use parameter 'host' instead."
|
||||||
parameters.put('host', parameters.DEPLOY_HOST)
|
parameters.put('host', parameters.deployHost)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(parameters.CI_DEPLOY_ACCOUNT && !parameters.account) {
|
if(parameters.deployAccount && !parameters.account) {
|
||||||
echo "[WARNING][${stepName}] Deprecated parameter 'CI_DEPLOY_ACCOUNT' is used. This will not work anymore in future versions. Use parameter 'account' instead."
|
echo "[WARNING][${stepName}] Deprecated parameter 'deployAccount' is used. This will not work anymore in future versions. Use parameter 'account' instead."
|
||||||
parameters.put('account', parameters.CI_DEPLOY_ACCOUNT)
|
parameters.put('account', parameters.deployAccount)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Backward compatibility end
|
// Backward compatibility end
|
||||||
|
Loading…
Reference in New Issue
Block a user