jar{ enabled false } bootJar { enabled true } dependencies { implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-server' } test { useJUnitPlatform() } task deploySit(dependsOn:bootJar){ doLast { println 'deploy sit...' ssh.run { session(remotes.sitServer153){ put from: 'build/libs/smartcity-eureka.jar', into: '/opt/sit/smartcity-eureka' def result = execute '/opt/sit/stop-port.sh 8321' println result execute 'nohup /opt/jdk1.8.0_211/bin/java -jar /opt/sit/smartcity-eureka/smartcity-eureka.jar --spring.profiles.active=sit >/dev/null &' } } } } task deployUat(dependsOn:bootJar){ doLast { println 'deploy uat...' ssh.run { session(remotes.sitServer153){ put from: 'build/libs/smartcity-eureka.jar', into: '/opt/uat/smartcity-eureka' def result = execute '/opt/uat/stop-port.sh 8322' println result execute 'nohup /opt/jdk1.8.0_211/bin/java -jar /opt/uat/smartcity-eureka/smartcity-eureka.jar --spring.profiles.active=uat >/dev/null &' } } } }