Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class RemoteContainer {
- String name
- String container
- String hostname
- Integer port
- String username
- String password
- String purpose
- }
- def remoteContainers = [new RemoteContainer(
- name: 'wildfly10',
- container: 'wildfly10x',
- hostname: 'localhost',
- port: 9990,
- username: 'user',
- password: 'passwd',
- purpose: 'development'
- )
- ]
- remoteContainers.each { config ->
- task "deployDev${config.name.capitalize()}"(type: com.bmuschko.gradle.cargo.tasks.remote.CargoDeployRemote) {
- description = "Deploys WAR to remote Web Application Server: '${config.name}'."
- containerId = config.container
- hostname = config.hostname
- port = config.port
- username = config.username
- password = config.password
- dependsOn war
- }
- task "undeployDev${config.name.capitalize()}"(type: com.bmuschko.gradle.cargo.tasks.remote.CargoUndeployRemote) {
- description = "Deploys WAR to remote Web Application Server: '${config.name}'."
- containerId = config.container
- hostname = config.hostname
- port = config.port
- username = config.username
- password = config.password
- dependsOn = war
- }
- }
- task createQAWar(type: War, dependsOn: classes) {
- archiveName "webapi-demo-${versioning.info.display}.war"
- destinationDir = file("$buildDir/dist")
- webInf {
- ...
- }
- }
- task createDevelopmentWar(type: War, dependsOn: classes) {
- archiveName "webapi-dev-${versioning.info.display}.war"
- destinationDir = file("$buildDir/dist")
- webInf {
- ...
- }
- }
- task createTestingWar(type: War, dependsOn: classes) {
- archiveName "webapi-test-${versioning.info.display}.war"
- destinationDir = file("$buildDir/dist")
- webInf {
- ...
- }
- }
- task createProductionWar(type: War, dependsOn: classes) {
- archiveName "webapi-prod-${versioning.info.display}.war"
- destinationDir = file("$buildDir/dist")
- webInf {
- ...
- }
- }
- remoteContainers.each { config ->
- task "deployDev${config.name.capitalize()}"(type: com.bmuschko.gradle.cargo.tasks.remote.CargoDeployRemote) {
- description = "Deploys WAR to remote Web Application Server: '${config.name}'."
- containerId = config.container
- hostname = config.hostname
- port = config.port
- username = config.username
- password = config.password
- dependsOn createDevelopmentWar <<<<<<<<<<<<<<<<<
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement