12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- jar{
- enabled false
- }
- bootJar {
- enabled true
- }
- dependencies {
- compile('io.springfox:springfox-swagger2:2.9.2')
- implementation 'org.springframework.boot:spring-boot-starter'
- implementation 'org.springframework.boot:spring-boot-starter-actuator'
- //implementation 'org.springframework.cloud:spring-cloud-starter-oauth2'
- //implementation 'org.springframework.cloud:spring-cloud-starter-security'
- implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
- implementation 'com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery'
- //implementation 'com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config'
- }
- test {
- useJUnitPlatform()
- }
- task deploySit(dependsOn:bootJar){
- doLast {
- println 'deploy sit...'
- ssh.settings {
- knownHosts = allowAnyHosts
- }
- ssh.run {
- session(remotes.sitServer153){
- put from: 'build/libs/smartcity-gateway.jar', into: '/opt/sit/smartcity-gateway'
- def result = execute '/opt/sit/stop-port.sh 8320'
- println result
- execute 'nohup /opt/jdk1.8.0_211/bin/java -jar /opt/sit/smartcity-gateway/smartcity-gateway.jar --spring.profiles.active=sit >/dev/null &'
- }
- }
- }
- }
- task deployUat(dependsOn:bootJar){
- doLast {
- println 'deploy uat...'
- ssh.settings {
- knownHosts = allowAnyHosts
- }
- ssh.run {
- session(remotes.sitServer153){
- put from: 'build/libs/smartcity-gateway.jar', into: '/opt/uat/smartcity-gateway'
- def result = execute '/opt/uat/stop-port.sh 8323'
- println result
- execute 'nohup /opt/jdk1.8.0_211/bin/java -jar /opt/uat/smartcity-gateway/smartcity-gateway.jar --spring.profiles.active=uat >/dev/null &'
- }
- }
- }
- }
|