build.gradle 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. jar{
  2. enabled false
  3. }
  4. bootJar {
  5. enabled true
  6. }
  7. dependencies {
  8. implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-server'
  9. }
  10. test {
  11. useJUnitPlatform()
  12. }
  13. task deploySit(dependsOn:bootJar){
  14. doLast {
  15. println 'deploy sit...'
  16. ssh.run {
  17. session(remotes.sitServer153){
  18. put from: 'build/libs/smartcity-eureka.jar', into: '/opt/sit/smartcity-eureka'
  19. def result = execute '/opt/sit/stop-port.sh 8321'
  20. println result
  21. execute 'nohup /opt/jdk1.8.0_211/bin/java -jar /opt/sit/smartcity-eureka/smartcity-eureka.jar --spring.profiles.active=sit >/dev/null &'
  22. }
  23. }
  24. }
  25. }
  26. task deployUat(dependsOn:bootJar){
  27. doLast {
  28. println 'deploy uat...'
  29. ssh.run {
  30. session(remotes.sitServer153){
  31. put from: 'build/libs/smartcity-eureka.jar', into: '/opt/uat/smartcity-eureka'
  32. def result = execute '/opt/uat/stop-port.sh 8322'
  33. println result
  34. execute 'nohup /opt/jdk1.8.0_211/bin/java -jar /opt/uat/smartcity-eureka/smartcity-eureka.jar --spring.profiles.active=uat >/dev/null &'
  35. }
  36. }
  37. }
  38. }