2017-07-11 15:12:03 +02:00
|
|
|
import hudson.AbortException
|
|
|
|
import org.junit.rules.TemporaryFolder
|
|
|
|
import org.junit.Before
|
|
|
|
import org.junit.Rule
|
|
|
|
import org.junit.Test
|
|
|
|
import org.junit.rules.ExpectedException
|
2018-01-16 10:33:13 +02:00
|
|
|
import org.junit.rules.RuleChain
|
|
|
|
|
2018-01-16 16:42:11 +02:00
|
|
|
import util.JenkinsConfigRule
|
2018-01-16 10:33:13 +02:00
|
|
|
import util.JenkinsLoggingRule
|
|
|
|
import util.JenkinsSetupRule
|
2018-01-16 16:03:00 +02:00
|
|
|
import util.JenkinsShellCallRule
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2017-11-13 16:56:19 +02:00
|
|
|
class NeoDeploymentTest extends PiperTestBase {
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2018-01-16 10:33:13 +02:00
|
|
|
private ExpectedException thrown = new ExpectedException().none()
|
|
|
|
private TemporaryFolder tmp = new TemporaryFolder()
|
|
|
|
private JenkinsLoggingRule jlr = new JenkinsLoggingRule(this)
|
2018-01-16 16:03:00 +02:00
|
|
|
private JenkinsShellCallRule jscr = new JenkinsShellCallRule(this)
|
2017-07-11 15:12:03 +02:00
|
|
|
|
|
|
|
@Rule
|
2018-01-16 10:33:13 +02:00
|
|
|
public RuleChain ruleChain = RuleChain.outerRule(thrown)
|
|
|
|
.around(tmp)
|
|
|
|
.around(new JenkinsSetupRule(this))
|
|
|
|
.around(jlr)
|
2018-01-16 16:03:00 +02:00
|
|
|
.around(jscr)
|
2018-01-16 16:42:11 +02:00
|
|
|
.around(new JenkinsConfigRule(this))
|
2017-07-11 15:12:03 +02:00
|
|
|
def archivePath
|
2018-01-11 16:25:58 +02:00
|
|
|
def warArchivePath
|
|
|
|
def propertiesFilePath
|
2017-07-11 15:12:03 +02:00
|
|
|
|
|
|
|
@Before
|
2018-01-16 10:33:13 +02:00
|
|
|
void init() {
|
2017-07-11 15:12:03 +02:00
|
|
|
|
|
|
|
archivePath = "${tmp.newFolder("workspace").toURI().getPath()}archiveName.mtar"
|
2018-01-11 16:25:58 +02:00
|
|
|
warArchivePath = "${tmp.getRoot().toURI().getPath()}workspace/warArchive.war"
|
|
|
|
propertiesFilePath = "${tmp.getRoot().toURI().getPath()}workspace/config.properties"
|
2017-07-11 15:12:03 +02:00
|
|
|
|
|
|
|
helper.registerAllowedMethod('error', [String], { s -> throw new AbortException(s) })
|
|
|
|
helper.registerAllowedMethod('usernamePassword', [Map], { m -> return m })
|
|
|
|
helper.registerAllowedMethod('withCredentials', [List, Closure], { l, c ->
|
|
|
|
if(l[0].credentialsId == 'myCredentialsId') {
|
|
|
|
binding.setProperty('username', 'anonymous')
|
|
|
|
binding.setProperty('password', '********')
|
|
|
|
} else if(l[0].credentialsId == 'CI_CREDENTIALS_ID') {
|
|
|
|
binding.setProperty('username', 'defaultUser')
|
|
|
|
binding.setProperty('password', '********')
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
c()
|
|
|
|
} finally {
|
|
|
|
binding.setProperty('username', null)
|
|
|
|
binding.setProperty('password', null)
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
binding.setVariable('env', [:])
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void straightForwardTest() {
|
|
|
|
|
|
|
|
binding.getVariable('env')['NEO_HOME'] = '/opt/neo'
|
|
|
|
|
|
|
|
new File(archivePath) << "dummy archive"
|
|
|
|
|
2017-11-14 13:57:16 +02:00
|
|
|
withPipeline(defaultPipeline()).execute(archivePath, 'myCredentialsId')
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2018-01-16 16:03:00 +02:00
|
|
|
assert jscr.shell[0] =~ /#!\/bin\/bash "\/opt\/neo\/tools\/neo\.sh" deploy-mta --user 'anonymous' --password '\*\*\*\*\*\*\*\*' --source ".*" --host 'test\.deploy\.host\.com' --account 'trialuser123' --synchronous/
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2018-01-16 10:33:13 +02:00
|
|
|
assert jlr.log.contains("[neoDeploy] Neo executable \"/opt/neo/tools/neo.sh\" retrieved from environment.")
|
2017-07-11 15:12:03 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void badCredentialsIdTest() {
|
|
|
|
|
|
|
|
binding.getVariable('env')['NEO_HOME'] = '/opt/neo'
|
|
|
|
|
|
|
|
new File(archivePath) << "dummy archive"
|
|
|
|
|
|
|
|
thrown.expect(MissingPropertyException)
|
|
|
|
|
2017-11-14 13:57:16 +02:00
|
|
|
withPipeline(defaultPipeline()).execute(archivePath, 'badCredentialsId')
|
2017-07-11 15:12:03 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void credentialsIdNotProvidedTest() {
|
|
|
|
|
|
|
|
binding.getVariable('env')['NEO_HOME'] = '/opt/neo'
|
|
|
|
|
|
|
|
new File(archivePath) << "dummy archive"
|
|
|
|
|
2017-11-14 13:57:16 +02:00
|
|
|
withPipeline(noCredentialsIdPipeline()).execute(archivePath)
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2018-01-16 16:03:00 +02:00
|
|
|
assert jscr.shell[0] =~ /#!\/bin\/bash "\/opt\/neo\/tools\/neo\.sh" deploy-mta --user 'defaultUser' --password '\*\*\*\*\*\*\*\*' --source ".*" --host 'test\.deploy\.host\.com' --account 'trialuser123' --synchronous/
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2018-01-16 10:33:13 +02:00
|
|
|
assert jlr.log.contains("[neoDeploy] Neo executable \"/opt/neo/tools/neo.sh\" retrieved from environment.")
|
2017-07-11 15:12:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void neoHomeNotSetTest() {
|
|
|
|
|
|
|
|
new File(archivePath) << "dummy archive"
|
|
|
|
|
2017-11-14 13:57:16 +02:00
|
|
|
withPipeline(noCredentialsIdPipeline()).execute(archivePath)
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2018-01-16 16:03:00 +02:00
|
|
|
assert jscr.shell[0] =~ /#!\/bin\/bash "neo" deploy-mta --user 'defaultUser' --password '\*\*\*\*\*\*\*\*' --source ".*" --host 'test\.deploy\.host\.com' --account 'trialuser123' --synchronous/
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2018-01-16 10:33:13 +02:00
|
|
|
assert jlr.log.contains("Using Neo executable from PATH.")
|
2017-07-11 15:12:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void neoHomeAsParameterTest() {
|
|
|
|
|
|
|
|
new File(archivePath) << "dummy archive"
|
|
|
|
|
2017-11-14 13:57:16 +02:00
|
|
|
withPipeline(neoHomeParameterPipeline()).execute(archivePath, 'myCredentialsId')
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2018-01-16 16:03:00 +02:00
|
|
|
assert jscr.shell[0] =~ /#!\/bin\/bash "\/etc\/neo\/tools\/neo\.sh" deploy-mta --user 'anonymous' --password '\*\*\*\*\*\*\*\*' --source ".*" --host 'test\.deploy\.host\.com' --account 'trialuser123' --synchronous.*/
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2018-01-16 10:33:13 +02:00
|
|
|
assert jlr.log.contains("[neoDeploy] Neo executable \"/etc/neo/tools/neo.sh\" retrieved from parameters.")
|
2017-07-11 15:12:03 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void archiveNotProvidedTest() {
|
|
|
|
|
|
|
|
thrown.expect(Exception)
|
|
|
|
thrown.expectMessage('ERROR - NO VALUE AVAILABLE FOR archivePath')
|
|
|
|
|
2017-11-14 13:57:16 +02:00
|
|
|
withPipeline(noArchivePathPipeline()).execute()
|
2017-07-11 15:12:03 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void wrongArchivePathProvidedTest() {
|
|
|
|
|
|
|
|
thrown.expect(AbortException)
|
|
|
|
thrown.expectMessage("Archive cannot be found with parameter archivePath: '")
|
|
|
|
|
2017-11-14 13:57:16 +02:00
|
|
|
withPipeline(defaultPipeline()).execute(archivePath, 'myCredentialsId')
|
2017-07-11 15:12:03 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void scriptNotProvidedTest() {
|
|
|
|
|
|
|
|
new File(archivePath) << "dummy archive"
|
|
|
|
|
|
|
|
thrown.expect(Exception)
|
|
|
|
thrown.expectMessage('ERROR - NO VALUE AVAILABLE FOR deployHost')
|
|
|
|
|
2017-11-14 13:57:16 +02:00
|
|
|
withPipeline(noScriptPipeline()).execute(archivePath)
|
2017-07-11 15:12:03 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-01-11 16:25:58 +02:00
|
|
|
@Test
|
|
|
|
void mtaDeployModeTest() {
|
|
|
|
binding.getVariable('env')['NEO_HOME'] = '/opt/neo'
|
|
|
|
new File(archivePath) << "dummy archive"
|
|
|
|
|
2018-01-17 12:17:24 +02:00
|
|
|
withPipeline(mtaDeployModePipeline()).execute(archivePath, 'mta')
|
2018-01-11 16:25:58 +02:00
|
|
|
|
2018-01-16 16:03:00 +02:00
|
|
|
assert jscr.shell[0] =~ /#!\/bin\/bash "\/opt\/neo\/tools\/neo\.sh" deploy-mta --user 'defaultUser' --password '\*\*\*\*\*\*\*\*' --source ".*" --host 'test\.deploy\.host\.com' --account 'trialuser123' --synchronous.*/
|
|
|
|
assert jlr.log.contains("[neoDeploy] Neo executable \"/opt/neo/tools/neo.sh\" retrieved from environment.")
|
2018-01-11 16:25:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void warFileParamsDeployModeTest() {
|
|
|
|
binding.getVariable('env')['NEO_HOME'] = '/opt/neo'
|
|
|
|
new File(warArchivePath) << "dummy war archive"
|
|
|
|
|
2018-01-17 12:17:24 +02:00
|
|
|
withPipeline(warParamsDeployModePipeline()).execute(warArchivePath, 'warParams', 'lite', 'deploy')
|
2018-01-11 16:25:58 +02:00
|
|
|
|
2018-01-16 16:03:00 +02:00
|
|
|
assert jscr.shell[0] =~ /#!\/bin\/bash "\/opt\/neo\/tools\/neo\.sh" deploy --user 'defaultUser' --password '\*\*\*\*\*\*\*\*' --source ".*\.war" --host 'test\.deploy\.host\.com' --account 'trialuser123' --application 'testApp' --runtime 'neo-javaee6-wp' --runtime-version '2\.125' --size 'lite'/
|
|
|
|
assert jlr.log.contains("[neoDeploy] Neo executable \"/opt/neo/tools/neo.sh\" retrieved from environment.")
|
2018-01-11 16:25:58 +02:00
|
|
|
}
|
|
|
|
|
2018-01-17 15:01:15 +02:00
|
|
|
@Test
|
|
|
|
void warFileParamsDeployModeRollingUpdateTest() {
|
|
|
|
binding.getVariable('env')['NEO_HOME'] = '/opt/neo'
|
|
|
|
new File(warArchivePath) << "dummy war archive"
|
|
|
|
|
|
|
|
withPipeline(warParamsDeployModePipeline()).execute(warArchivePath, 'warParams', 'lite', 'rolling-update')
|
|
|
|
|
2018-01-16 16:03:00 +02:00
|
|
|
assert jscr.shell[0] =~ /#!\/bin\/bash "\/opt\/neo\/tools\/neo\.sh" rolling-update --user 'defaultUser' --password '\*\*\*\*\*\*\*\*' --source ".*\.war" --host 'test\.deploy\.host\.com' --account 'trialuser123' --application 'testApp' --runtime 'neo-javaee6-wp' --runtime-version '2\.125' --size 'lite'/
|
|
|
|
assert jlr.log.contains("[neoDeploy] Neo executable \"/opt/neo/tools/neo.sh\" retrieved from environment.")
|
2018-01-17 15:01:15 +02:00
|
|
|
}
|
|
|
|
|
2018-01-11 16:25:58 +02:00
|
|
|
@Test
|
|
|
|
void warPropertiesFileDeployModeTest() {
|
|
|
|
binding.getVariable('env')['NEO_HOME'] = '/opt/neo'
|
|
|
|
new File(warArchivePath) << "dummy war archive"
|
|
|
|
new File(propertiesFilePath) << "dummy properties file"
|
|
|
|
|
2018-01-17 15:01:15 +02:00
|
|
|
withPipeline(warPropertiesFileDeployModePipeline()).execute(warArchivePath, propertiesFilePath, 'warPropertiesFile', 'deploy')
|
2018-01-11 16:25:58 +02:00
|
|
|
|
2018-01-16 16:03:00 +02:00
|
|
|
assert jscr.shell[0] =~ /#!\/bin\/bash "\/opt\/neo\/tools\/neo\.sh" deploy --user 'defaultUser' --password '\*\*\*\*\*\*\*\*' --source ".*\.war" .*\.properties/
|
|
|
|
assert jlr.log.contains("[neoDeploy] Neo executable \"/opt/neo/tools/neo.sh\" retrieved from environment.")
|
2018-01-11 16:25:58 +02:00
|
|
|
}
|
|
|
|
|
2018-01-17 15:01:15 +02:00
|
|
|
@Test
|
|
|
|
void warPropertiesFileDeployModeRollingUpdateTest() {
|
|
|
|
binding.getVariable('env')['NEO_HOME'] = '/opt/neo'
|
|
|
|
new File(warArchivePath) << "dummy war archive"
|
|
|
|
new File(propertiesFilePath) << "dummy properties file"
|
|
|
|
|
|
|
|
withPipeline(warPropertiesFileDeployModePipeline()).execute(warArchivePath, propertiesFilePath, 'warPropertiesFile', 'rolling-update')
|
|
|
|
|
2018-01-16 16:03:00 +02:00
|
|
|
assert jscr.shell[0] =~ /#!\/bin\/bash "\/opt\/neo\/tools\/neo\.sh" rolling-update --user 'defaultUser' --password '\*\*\*\*\*\*\*\*' --source ".*\.war" .*\.properties/
|
|
|
|
assert jlr.log.contains("[neoDeploy] Neo executable \"/opt/neo/tools/neo.sh\" retrieved from environment.")
|
2018-01-17 15:01:15 +02:00
|
|
|
}
|
|
|
|
|
2018-01-11 16:25:58 +02:00
|
|
|
@Test
|
|
|
|
void applicationNameNotProvidedTest() {
|
|
|
|
new File(warArchivePath) << "dummy war archive"
|
|
|
|
|
|
|
|
thrown.expect(Exception)
|
|
|
|
thrown.expectMessage('ERROR - NO VALUE AVAILABLE FOR applicationName')
|
|
|
|
|
2018-01-17 12:17:24 +02:00
|
|
|
withPipeline(noApplicationNamePipeline()).execute(warArchivePath, 'warParams')
|
2018-01-11 16:25:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void runtimeNotProvidedTest() {
|
|
|
|
new File(warArchivePath) << "dummy war archive"
|
|
|
|
|
|
|
|
thrown.expect(Exception)
|
|
|
|
thrown.expectMessage('ERROR - NO VALUE AVAILABLE FOR runtime')
|
|
|
|
|
2018-01-17 12:17:24 +02:00
|
|
|
withPipeline(noRuntimePipeline()).execute(warArchivePath, 'warParams')
|
2018-01-11 16:25:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void runtimeVersionNotProvidedTest() {
|
|
|
|
new File(warArchivePath) << "dummy war archive"
|
|
|
|
|
|
|
|
thrown.expect(Exception)
|
|
|
|
thrown.expectMessage('ERROR - NO VALUE AVAILABLE FOR runtimeVersion')
|
|
|
|
|
2018-01-17 12:17:24 +02:00
|
|
|
withPipeline(noRuntimeVersionPipeline()).execute(warArchivePath, 'warParams')
|
2018-01-16 11:54:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void illegalDeployModeTest() {
|
|
|
|
new File(warArchivePath) << "dummy war archive"
|
|
|
|
|
2018-01-17 12:19:02 +02:00
|
|
|
thrown.expect(Exception)
|
2018-01-17 12:17:24 +02:00
|
|
|
thrown.expectMessage("[neoDeploy] Invalid deployMode = 'illegalMode'. Valid 'deployMode' values are: 'mta', 'warParams' and 'warPropertiesFile'")
|
2018-01-16 11:54:17 +02:00
|
|
|
|
2018-01-17 12:17:24 +02:00
|
|
|
withPipeline(warParamsDeployModePipeline()).execute(warArchivePath, 'illegalMode', 'lite', 'deploy')
|
2018-01-16 11:54:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void illegalVMSizeTest() {
|
|
|
|
new File(warArchivePath) << "dummy war archive"
|
|
|
|
|
2018-01-17 12:19:02 +02:00
|
|
|
thrown.expect(Exception)
|
2018-01-16 11:54:17 +02:00
|
|
|
thrown.expectMessage("[neoDeploy] Invalid vmSize = 'illegalVM'. Valid 'vmSize' values are: 'lite', 'pro', 'prem' and 'prem-plus'.")
|
|
|
|
|
2018-01-17 12:17:24 +02:00
|
|
|
withPipeline(warParamsDeployModePipeline()).execute(warArchivePath, 'warParams', 'illegalVM', 'deploy')
|
2018-01-16 11:54:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void illegalWARActionTest() {
|
|
|
|
new File(warArchivePath) << "dummy war archive"
|
|
|
|
|
2018-01-17 12:19:02 +02:00
|
|
|
thrown.expect(Exception)
|
2018-01-16 11:54:17 +02:00
|
|
|
thrown.expectMessage("[neoDeploy] Invalid warAction = 'illegalWARAction'. Valid 'warAction' values are: 'deploy' and 'rolling-update'.")
|
|
|
|
|
2018-01-17 12:17:24 +02:00
|
|
|
withPipeline(warParamsDeployModePipeline()).execute(warArchivePath, 'warParams', 'lite', 'illegalWARAction')
|
2018-01-11 16:25:58 +02:00
|
|
|
}
|
2017-07-11 15:12:03 +02:00
|
|
|
|
|
|
|
private defaultPipeline(){
|
2017-11-21 15:47:17 +02:00
|
|
|
return """
|
|
|
|
@Library('piper-library-os')
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
execute(archivePath, neoCredentialsId) {
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
commonPipelineEnvironment.setConfigProperty('DEPLOY_HOST', 'test.deploy.host.com')
|
|
|
|
commonPipelineEnvironment.setConfigProperty('CI_DEPLOY_ACCOUNT', 'trialuser123')
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
node() {
|
|
|
|
neoDeploy script: this, archivePath: archivePath, neoCredentialsId: neoCredentialsId
|
|
|
|
}
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
}
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
return this
|
|
|
|
"""
|
2017-07-11 15:12:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private noCredentialsIdPipeline(){
|
2017-11-21 15:47:17 +02:00
|
|
|
return """
|
|
|
|
@Library('piper-library-os')
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
execute(archivePath) {
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
commonPipelineEnvironment.setConfigProperty('DEPLOY_HOST', 'test.deploy.host.com')
|
|
|
|
commonPipelineEnvironment.setConfigProperty('CI_DEPLOY_ACCOUNT', 'trialuser123')
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
node() {
|
|
|
|
neoDeploy script: this, archivePath: archivePath
|
|
|
|
}
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
}
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
return this
|
|
|
|
"""
|
2017-07-11 15:12:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private neoHomeParameterPipeline(){
|
2017-11-21 15:47:17 +02:00
|
|
|
return """
|
|
|
|
@Library('piper-library-os')
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
execute(archivePath, neoCredentialsId) {
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
commonPipelineEnvironment.setConfigProperty('DEPLOY_HOST', 'test.deploy.host.com')
|
|
|
|
commonPipelineEnvironment.setConfigProperty('CI_DEPLOY_ACCOUNT', 'trialuser123')
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
node() {
|
|
|
|
neoDeploy script: this, archivePath: archivePath, neoCredentialsId: neoCredentialsId, neoHome: '/etc/neo'
|
|
|
|
}
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
}
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
return this
|
|
|
|
"""
|
2017-07-11 15:12:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private noArchivePathPipeline(){
|
2017-11-21 15:47:17 +02:00
|
|
|
return """
|
|
|
|
@Library('piper-library-os')
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
execute() {
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
commonPipelineEnvironment.setConfigProperty('DEPLOY_HOST', 'test.deploy.host.com')
|
|
|
|
commonPipelineEnvironment.setConfigProperty('CI_DEPLOY_ACCOUNT', 'trialuser123')
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
node() {
|
|
|
|
neoDeploy script: this
|
|
|
|
}
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
}
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
return this
|
|
|
|
"""
|
2017-07-11 15:12:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private noScriptPipeline(){
|
2017-11-21 15:47:17 +02:00
|
|
|
return """
|
|
|
|
@Library('piper-library-os')
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
execute(archivePath) {
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
node() {
|
|
|
|
neoDeploy archivePath: archivePath
|
|
|
|
}
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
}
|
2017-11-16 15:09:48 +02:00
|
|
|
|
2017-11-21 15:47:17 +02:00
|
|
|
return this
|
|
|
|
"""
|
2017-07-11 15:12:03 +02:00
|
|
|
}
|
|
|
|
|
2018-01-16 11:54:17 +02:00
|
|
|
private noApplicationNamePipeline() {
|
2018-01-11 16:25:58 +02:00
|
|
|
return """
|
|
|
|
@Library('piper-library-os')
|
|
|
|
|
|
|
|
execute(warArchivePath, deployMode) {
|
|
|
|
|
|
|
|
commonPipelineEnvironment.setConfigProperty('DEPLOY_HOST', 'test.deploy.host.com')
|
|
|
|
commonPipelineEnvironment.setConfigProperty('CI_DEPLOY_ACCOUNT', 'trialuser123')
|
|
|
|
def runtime = 'neo-javaee6-wp'
|
|
|
|
def runtimeVersion = '2.125'
|
|
|
|
|
|
|
|
node() {
|
|
|
|
neoDeploy script: this, archivePath: warArchivePath, deployMode: deployMode, runtime: runtime, runtimeVersion: runtimeVersion
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return this
|
|
|
|
"""
|
|
|
|
}
|
|
|
|
|
2018-01-16 11:54:17 +02:00
|
|
|
private noRuntimePipeline() {
|
2018-01-11 16:25:58 +02:00
|
|
|
return """
|
|
|
|
@Library('piper-library-os')
|
|
|
|
|
|
|
|
execute(warArchivePath, deployMode) {
|
|
|
|
|
|
|
|
commonPipelineEnvironment.setConfigProperty('DEPLOY_HOST', 'test.deploy.host.com')
|
|
|
|
commonPipelineEnvironment.setConfigProperty('CI_DEPLOY_ACCOUNT', 'trialuser123')
|
|
|
|
def appName = 'testApp'
|
|
|
|
def runtime = 'neo-javaee6-wp'
|
|
|
|
def runtimeVersion = '2.125'
|
|
|
|
|
|
|
|
node() {
|
|
|
|
neoDeploy script: this, archivePath: warArchivePath, deployMode: deployMode, applicationName: appName, runtimeVersion: runtimeVersion
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return this
|
|
|
|
"""
|
|
|
|
}
|
|
|
|
|
2018-01-16 11:54:17 +02:00
|
|
|
private noRuntimeVersionPipeline() {
|
2018-01-11 16:25:58 +02:00
|
|
|
return """
|
|
|
|
@Library('piper-library-os')
|
|
|
|
|
|
|
|
execute(warArchivePath, deployMode) {
|
|
|
|
|
|
|
|
commonPipelineEnvironment.setConfigProperty('DEPLOY_HOST', 'test.deploy.host.com')
|
|
|
|
commonPipelineEnvironment.setConfigProperty('CI_DEPLOY_ACCOUNT', 'trialuser123')
|
|
|
|
def appName = 'testApp'
|
|
|
|
def runtime = 'neo-javaee6-wp'
|
|
|
|
def runtimeVersion = '2.125'
|
|
|
|
|
|
|
|
node() {
|
|
|
|
neoDeploy script: this, archivePath: warArchivePath, deployMode: deployMode, applicationName: appName, runtime: runtime
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return this
|
|
|
|
"""
|
|
|
|
}
|
|
|
|
|
2018-01-16 11:54:17 +02:00
|
|
|
private warPropertiesFileDeployModePipeline() {
|
2018-01-11 16:25:58 +02:00
|
|
|
return """
|
|
|
|
@Library('piper-library-os')
|
|
|
|
|
2018-01-17 15:01:15 +02:00
|
|
|
execute(warArchivePath, propertiesFilePath, deployMode, warAction) {
|
2018-01-11 16:25:58 +02:00
|
|
|
|
|
|
|
node() {
|
2018-01-17 15:01:15 +02:00
|
|
|
neoDeploy script: this, deployMode: deployMode, archivePath: warArchivePath, propertiesFile: propertiesFilePath, warAction: warAction
|
2018-01-11 16:25:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return this
|
|
|
|
"""
|
|
|
|
}
|
|
|
|
|
2018-01-16 11:54:17 +02:00
|
|
|
private warParamsDeployModePipeline() {
|
2018-01-11 16:25:58 +02:00
|
|
|
return """
|
|
|
|
@Library('piper-library-os')
|
|
|
|
|
2018-01-16 11:54:17 +02:00
|
|
|
execute(warArchivePath, deployMode, vmSize, warAction) {
|
2018-01-11 16:25:58 +02:00
|
|
|
|
|
|
|
commonPipelineEnvironment.setConfigProperty('DEPLOY_HOST', 'test.deploy.host.com')
|
|
|
|
commonPipelineEnvironment.setConfigProperty('CI_DEPLOY_ACCOUNT', 'trialuser123')
|
|
|
|
def appName = 'testApp'
|
|
|
|
def runtime = 'neo-javaee6-wp'
|
|
|
|
def runtimeVersion = '2.125'
|
|
|
|
|
|
|
|
node() {
|
2018-01-16 11:54:17 +02:00
|
|
|
neoDeploy script: this, archivePath: warArchivePath, deployMode: deployMode, applicationName: appName, runtime: runtime, runtimeVersion: runtimeVersion, warAction: warAction, vmSize: vmSize
|
2018-01-11 16:25:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return this
|
|
|
|
"""
|
|
|
|
}
|
|
|
|
|
2018-01-16 11:54:17 +02:00
|
|
|
private mtaDeployModePipeline() {
|
2018-01-11 16:25:58 +02:00
|
|
|
return """
|
|
|
|
@Library('piper-library-os')
|
|
|
|
|
|
|
|
execute(archivePath, deployMode) {
|
|
|
|
|
|
|
|
commonPipelineEnvironment.setConfigProperty('DEPLOY_HOST', 'test.deploy.host.com')
|
|
|
|
commonPipelineEnvironment.setConfigProperty('CI_DEPLOY_ACCOUNT', 'trialuser123')
|
|
|
|
|
|
|
|
node() {
|
|
|
|
neoDeploy script: this, archivePath: archivePath, deployMode: deployMode
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return this
|
|
|
|
"""
|
|
|
|
}
|
|
|
|
|
2017-07-11 15:12:03 +02:00
|
|
|
}
|