Why triggering manual job is not allowed?

If i understood correctly you are trying to execute a manual job from a pipeline in project-foo from a job withing a pipeline in project-bar.

If you know the Job ID and the ID of project-foo you could call POST /projects/:id/jobs/:job_id/play from the job within the pipeline within project-bar.

When you do not have the ID of the job or the project explicitly you must search for it within the job of project-bar also using the API.

The “user” that calls the POST has to have the necessary rights to run the job though. You do not need a user explicitly. Group or project Access Tokens are perfectly viable for that.

What i don’t really understand though conceptually: Are you really creating a pipeline for monitoring purposes that will deploy changes to a production environment that were not deployed by the original pipeline themselves?

Why? In my opinion monitoring generally should only watch and report and have no impact an an environment.

If you are creating the pipeline because there are cases where sometimes the changes were not deployed to production because the pipeline was started by a commit (merge request, direct push to main) and not by a trigger, why don’t you just change the rules of the deploy_job?

kind regards
Markus

1 Like