build.gradle 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. jar{
  2. enabled false
  3. }
  4. bootJar {
  5. enabled true
  6. }
  7. dependencies {
  8. implementation project(':smartcity-common')
  9. implementation 'org.springframework.boot:spring-boot-starter-web'
  10. //implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
  11. implementation 'org.springframework.cloud:spring-cloud-starter-netflix-hystrix'
  12. implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
  13. implementation 'org.springframework.cloud:spring-cloud-starter-oauth2'
  14. implementation 'org.springframework.cloud:spring-cloud-starter-security'
  15. implementation 'org.springframework.boot:spring-boot-starter-actuator'
  16. implementation('org.springframework.kafka:spring-kafka')
  17. implementation 'org.springframework.cloud:spring-cloud-starter-stream-kafka'
  18. implementation 'com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery'
  19. implementation 'com.alibaba.cloud:spring-cloud-starter-dubbo'
  20. compile('mysql:mysql-connector-java:5.1.47')
  21. //数据源连接池
  22. //compile('com.alibaba:druid:1.1.6')
  23. compile('com.alibaba:druid-spring-boot-starter:1.1.9')
  24. //swagger在线接口文档生成工具
  25. //compile('io.springfox:springfox-swagger2:2.7.0')
  26. //compile('io.springfox:springfox-swagger-ui:2.7.0')
  27. //分页插件
  28. //compile('com.github.pagehelper:pagehelper:4.1.0')
  29. //compile('com.github.pagehelper:pagehelper-spring-boot-starter:1.2.10')
  30. //compile ('org.apache.httpcomponents:httpclient:4.5.6')
  31. //json工具
  32. //compile('com.alibaba:fastjson:1.2.41')
  33. //activiti
  34. compile('org.activiti:activiti-spring-boot-starter-basic:5.22.0')
  35. compile('dom4j:dom4j:1.6.1')
  36. testImplementation('org.springframework.boot:spring-boot-starter-test') {
  37. exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
  38. }
  39. }
  40. test {
  41. useJUnitPlatform()
  42. }
  43. task deploySit(dependsOn:bootJar){
  44. def active = 'sit'
  45. def applicationName = 'smartcity-workflow'
  46. def targetDir = '/opt/sit/smartcity-workflow'
  47. doLast {
  48. println "deploy ${applicationName} ${active}..."
  49. ssh.settings {
  50. knownHosts = allowAnyHosts
  51. }
  52. ssh.run {
  53. session(remotes.sitServer){
  54. put from: "build/libs/${jar.archiveName}", into: "${targetDir}"
  55. execute """
  56. source /root/.bash_profile;
  57. kill `ps aux | grep -i ${applicationName} | grep -v grep | awk '{print \$2}'`;
  58. nohup java -jar ${targetDir}/${jar.archiveName} --spring.profiles.active=${active} >/dev/null &
  59. """
  60. }
  61. }
  62. }
  63. }
  64. task deployUat(dependsOn:bootJar){
  65. def active = 'uat'
  66. def applicationName = 'smartcity-workflow'
  67. def targetDir = '/opt/uat/smartcity-workflow'
  68. doLast {
  69. println "deploy ${applicationName} ${active}..."
  70. ssh.settings {
  71. knownHosts = allowAnyHosts
  72. }
  73. ssh.run {
  74. session(remotes.uatServer156){
  75. put from: "build/libs/${jar.archiveName}", into: "${targetDir}"
  76. execute """
  77. source /root/.bash_profile;
  78. kill `ps aux | grep -i ${applicationName} | grep -v grep | awk '{print \$2}'`;
  79. nohup java -jar ${targetDir}/${jar.archiveName} --spring.profiles.active=${active} >/dev/null &
  80. """
  81. }
  82. }
  83. }
  84. }
  85. def releaseTime() {
  86. return new Date().format("yyyyMMdd", TimeZone.getTimeZone("GMT+08:00"))
  87. }
  88. archivesBaseName = "smartcity-workflow-${releaseTime()}"