6

I have a Jenkins declarative pipeline that is ran via a webhook from GitLab whenever a change is pushed to my repo. In Jenkins, I have the following trigger option selected:

GitLab Push Trigger

Is there a way for me to add this trigger to my Jenkins declarative pipeline, if so how?

1 Answer 1

6

Looks like you are using the Gitlab plugin for jenkins? if so this link should be of help https://github.com/jenkinsci/gitlab-plugin#declarative-pipeline-jobs

3
  • 2
    This is 100% exactly what I needed!
    – Preston Martin
    Commented Aug 14, 2018 at 21:05
  • 2
    In addition to this, you should be able to use Jenkins' "Pipeline Syntax" tool to generate the declarative code from the web UI configuration.
    – jayhendren
    Commented Aug 14, 2018 at 22:05
  • The implementation/support for gitlab triggers inside the Declarative Directive Generator is thing o' beauty.
    – tbradt
    Commented Apr 14, 2020 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.