Advertisement
Guest User

Untitled

a guest
Jan 25th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. class RemoteContainer {
  2. String name
  3. String container
  4. String hostname
  5. Integer port
  6. String username
  7. String password
  8. String purpose
  9. }
  10.  
  11. def remoteContainers = [new RemoteContainer(
  12. name: 'wildfly10',
  13. container: 'wildfly10x',
  14. hostname: 'localhost',
  15. port: 9990,
  16. username: 'user',
  17. password: 'passwd',
  18. purpose: 'development'
  19. )
  20. ]
  21.  
  22. remoteContainers.each { config ->
  23. task "deployDev${config.name.capitalize()}"(type: com.bmuschko.gradle.cargo.tasks.remote.CargoDeployRemote) {
  24. description = "Deploys WAR to remote Web Application Server: '${config.name}'."
  25. containerId = config.container
  26. hostname = config.hostname
  27. port = config.port
  28. username = config.username
  29. password = config.password
  30. dependsOn war
  31. }
  32.  
  33. task "undeployDev${config.name.capitalize()}"(type: com.bmuschko.gradle.cargo.tasks.remote.CargoUndeployRemote) {
  34. description = "Deploys WAR to remote Web Application Server: '${config.name}'."
  35. containerId = config.container
  36. hostname = config.hostname
  37. port = config.port
  38. username = config.username
  39. password = config.password
  40. dependsOn = war
  41. }
  42. }
  43.  
  44. task createQAWar(type: War, dependsOn: classes) {
  45. archiveName "webapi-demo-${versioning.info.display}.war"
  46. destinationDir = file("$buildDir/dist")
  47. webInf {
  48. ...
  49. }
  50. }
  51.  
  52. task createDevelopmentWar(type: War, dependsOn: classes) {
  53. archiveName "webapi-dev-${versioning.info.display}.war"
  54. destinationDir = file("$buildDir/dist")
  55. webInf {
  56. ...
  57. }
  58. }
  59.  
  60. task createTestingWar(type: War, dependsOn: classes) {
  61. archiveName "webapi-test-${versioning.info.display}.war"
  62. destinationDir = file("$buildDir/dist")
  63. webInf {
  64. ...
  65. }
  66. }
  67.  
  68. task createProductionWar(type: War, dependsOn: classes) {
  69. archiveName "webapi-prod-${versioning.info.display}.war"
  70. destinationDir = file("$buildDir/dist")
  71. webInf {
  72. ...
  73. }
  74. }
  75.  
  76. remoteContainers.each { config ->
  77. task "deployDev${config.name.capitalize()}"(type: com.bmuschko.gradle.cargo.tasks.remote.CargoDeployRemote) {
  78. description = "Deploys WAR to remote Web Application Server: '${config.name}'."
  79. containerId = config.container
  80. hostname = config.hostname
  81. port = config.port
  82. username = config.username
  83. password = config.password
  84. dependsOn createDevelopmentWar <<<<<<<<<<<<<<<<<
  85. }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement