如何在gitlab ci的构建过程之后运行基于服务的命令.yml?
例如,我想运行:
php artisan queue:listen --timeout=0 &
问题是构建会永久运行,并且在等待该命令的结果时不会完成(即使该命令从未完成).
我是否可以将其作为后台任务运行?我试过nohup,但运气不好.
如何在gitlab ci的构建过程之后运行基于服务的命令.yml?
例如,我想运行:
php artisan queue:listen --timeout=0 &
问题是构建会永久运行,并且在等待该命令的结果时不会完成(即使该命令从未完成).
我是否可以将其作为后台任务运行?我试过nohup,但运气不好.
As mentioned here:
Process started with Runner, even if you add
nohup
and&
at the end, is marked with process group ID.
When the job is finished, the Runner is sending a kill signal to the whole process group.
So any process started directly from CI job will be terminated at job end.
如果您控制目标服务器,使用systenter code here
emd服务(如本same page中所示)仍然是一个选项.