简体   繁体   中英

automate pipeline creation with freestyle project

We have hundreds of repositories in Bitbucket and we want to create a multibranch pipeline in Jenkins for each of these repositories.

We are trying to use a Freestyle project to automatically generate the multibranch pipelines.

We are using Generic Webhook Trigger in Jenkins to launch a Freestyle project. We get from the webhook payload the name of the repository using a JSONPath expression, and it is stored in a variable, but it seems that the variable cannot be resolved as the argument of the job name (Please refer to the attached picture)

Error:

...
Contributing variables:
REPOSITORY_NAME = my-repo-name

Processing provided DSL script
ERROR: (script, line 1) No such property: $REPOSITORY_NAME for class: script

Finished: FAILURE

Does anybody actually have this working? Or any other ways to solve this problem?

在此处输入图片说明

Please use BitBucket Source Plugin .

Bitbucket source plugin helps in setting up the pipeline jobs automatically given the organization name. It scans for Jenkinsfile in repositories under the given organization and creates the jenkins job for that. We dont have to configure anything manually in the Jenkins UI, everything is done through the script (pipeline as code).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM