2

I have instances of Jenkins and GitLab which are successfully connected. Part of setting up the GitLab plug-in involves providing an API token. I believe this is used by the plug-in to get details of the commit which is triggering a job.

I need to run a daily Jenkins job which collects some statistics using the API and then (using R) generates a report. So this is not triggered by an event in GitLab.

To complicate issues a little further, the R code will run inside a container (to avoid hving to install R and all the packages on every Jenkins slave),

It does not appear that the plug-in makes the token available to be used in jobs ... and I can see a sane reason for that.

Is it possible to access the API token from the plug-in?

4

1 回答 1

1

带参数的作业有一个插件支持将凭证注入 ( https://wiki.jenkins.io/display/JENKINS/Credentials+Binding+Plugin ) 到构建中,以后可以用作环境变量。也可以选择 Gitlab api 令牌。

于 2018-04-29T16:25:46.507 回答