spring boot脚本

  • run.sh
kill `lsof -t -i:8080`
kill `lsof -t -i:8389`

nohup cd /opt/latest-api/ && java -jar -Dspring.profiles.active="prod" -Djava.ext.dirs="dependencies/" -Duser.timezone="GMT+08" -Dfile.encoding="UTF-8" api.jar 2>&1>api.log &

tail -fn 100 api.log
  • deploy.sh
rsync -ravvvv ./build/libs/* [email protected]:/opt/latest-api/ && \
ssh [email protected] "cd /opt/latest-api && ./run.sh"
  • build.gradle
bootJar {
	baseName = 'api'
	excludes = ["*.jar"]
}

task copyDependencies(type: Copy) {
    from project.configurations.compileClasspath
    into 'build/dependencies'
}

你可能感兴趣的:(spring,boot,java,spring)