PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, April 19, 2022

[FIXED] How can I run background tasks in Gitlab CICD?

 April 19, 2022     gitlab, laravel, php     No comments   

Issue

How can I run a service-based command after the build process in gitlab-ci.yml?

For example, i'd like to run:

php artisan queue:listen --timeout=0 &

The issue is the build runs perpetually and does not finish as it waits for the results of this command (even though this command never finishes).

Is there anyway I can run it as a background task? I tried nohup with no luck.


Solution

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.

Using a systenter code hereemd service (as in this same page) remains an option, if you control the target server.



Answered By - VonC
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing