build.gradle 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. jar{
  2. enabled false
  3. }
  4. bootJar {
  5. enabled true
  6. }
  7. dependencies {
  8. compile('io.springfox:springfox-swagger2:2.9.2')
  9. implementation 'org.springframework.boot:spring-boot-starter'
  10. implementation 'org.springframework.boot:spring-boot-starter-actuator'
  11. //implementation 'org.springframework.cloud:spring-cloud-starter-oauth2'
  12. //implementation 'org.springframework.cloud:spring-cloud-starter-security'
  13. implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
  14. implementation 'com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery'
  15. //implementation 'com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config'
  16. }
  17. test {
  18. useJUnitPlatform()
  19. }
  20. task deploySit(dependsOn:bootJar){
  21. doLast {
  22. println 'deploy sit...'
  23. ssh.settings {
  24. knownHosts = allowAnyHosts
  25. }
  26. ssh.run {
  27. session(remotes.sitServer153){
  28. put from: 'build/libs/smartcity-gateway.jar', into: '/opt/sit/smartcity-gateway'
  29. def result = execute '/opt/sit/stop-port.sh 8320'
  30. println result
  31. execute 'nohup /opt/jdk1.8.0_211/bin/java -jar /opt/sit/smartcity-gateway/smartcity-gateway.jar --spring.profiles.active=sit >/dev/null &'
  32. }
  33. }
  34. }
  35. }
  36. task deployUat(dependsOn:bootJar){
  37. doLast {
  38. println 'deploy uat...'
  39. ssh.settings {
  40. knownHosts = allowAnyHosts
  41. }
  42. ssh.run {
  43. session(remotes.sitServer153){
  44. put from: 'build/libs/smartcity-gateway.jar', into: '/opt/uat/smartcity-gateway'
  45. def result = execute '/opt/uat/stop-port.sh 8323'
  46. println result
  47. execute 'nohup /opt/jdk1.8.0_211/bin/java -jar /opt/uat/smartcity-gateway/smartcity-gateway.jar --spring.profiles.active=uat >/dev/null &'
  48. }
  49. }
  50. }
  51. }