如何在 Jenkins 正在运行的同一台服务器上本地使用 Jenkins 自动部署 Play Framework (2.4) 应用程序?在某些时候,我们将单独设置一个适当的生产环境,并且可能会以相同的方式实现测试环境,但此时我想检查是否可以设置一个简单的测试环境到 Jenkins 正在运行的同一台服务器。
我有一个运行测试的 Jenkins 工作,它似乎工作正常。基本上是“执行外壳”运行激活器命令(可以合并到一行)。
./activator clean
./activator test
在 Play 1 中,我用play start
&play stop
来做类似的事情。尝试activator start
我的开发环境,我收到消息:
The start command is deprecated, and will be removed in a future version of Play.
To run Play in production mode, run 'stage' instead, and then execute the generated start script in target/universal/stage/bin.
To test your application using production mode, run 'testProd' instead.
所以我用“执行外壳”和阶段评估了两个(不完整的)替代方案:
使用 nohup 暂存和运行:
./activator clean
./activator stage
nohup target/universal/stage/bin/my-app -Dplay.evolutions.db.default.autoApply=true
-> 应用程序启动正常,但 Jenkins 任务没有停止。
在后台使用 nohup 进行舞台和运行:
./activator clean
./activator stage
nohup target/universal/stage/bin/my-app -Dplay.evolutions.db.default.autoApply=true &
-> 应用程序似乎已经启动到某个时间点但没有继续运行?
这里首选(甚至唯一的工作)方式是什么?