Implement pipeline hooks, extracted from !5525
What does this MR do?
Implement pipeline hook upon:
- When Pipeline is created,
- When a pipeline status changes,
- When a pipeline finished (this would basically be done by 2.).
What are the relevant issue numbers?
Closes #20115 (closed)
Does this MR meet the acceptance criteria?
This is rebased on top of which simplifies a pipeline processing: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5782