GitHub webhooks and pipelines

13 views
Skip to first unread message

Sébastien Hinderer

unread,
Aug 10, 2020, 11:39:48 AM8/10/20
to jenkins...@googlegroups.com
Dear all,

I am trying to switch from classical to pipeline jobs.

One of my classical (legacy) jobs is triggered by a GitHub web hook and
things are working correctly: when something is pushed to the "trunk"
branch on GitHub, the hook is called and the classical job is executed.
This is reflected as expected in the Git webhook log.

However, the new pipeline jobs I defined do not get started by the
webhook, although I checked the webhook checkbox in Jenkins' user
interface. This is also reflected in the GitHub webhook log, which says
no push occurred yet, except that I did push to the repo.

Can anybody see what I am missing here, please?

Many thanks in advance,

Sébastien.

Sébastien Hinderer

unread,
Aug 11, 2020, 10:26:38 AM8/11/20
to jenkins...@googlegroups.com
Dear all,

I am replying to myself because meanwhile I have solved my problem and
others might find the solution interesting, too.

Sébastien Hinderer (2020/08/10 17:39 +0200):
What helped was to run each new pipeline job manually once. Since then,
the jobs are correctly run when GitHub triggers the web hook. I found
the hint on some blog post but not in the official documentation. If I
didn't overlook it may be good to document this because intuitively it
makes not so much sense (to me) why one would need to run the jobs
manually for the web hooks to work.

The thing I don't know yet how to achieve is how to use the secret text
sent by GitHub to make sure nobody else is using that hook. For the
classical jobs I was able to activate it in tue "Build environment"
part of the job's configuration, but this part is not present for
pipeline jobs. I did find documentation using the credentials() method,
but there, the secret text was assigned to an environment variable,
which is, I guess, not what is needed in the present context. Any help
on that would be appreciated. I am also surprised that Jenkins even
accepts to run a job whereas the secret text is not provided...

Best wishes,

Sébastien.
Reply all
Reply to author
Forward
0 new messages