How to build the last branch of git release in Jenkins?

I am trying to configure continuous integration in Jenkins to develop a git thread style. I thought that I would create three tasks for creating RPM packages: for the wizard, development, and the latest release branch.

The problem is related to the last release branch, since I'm not sure that you can configure assemblies so that Jenkins polls my git report and only does the assembly if the change occurs in the last release / * branch. Is it more common for people to clone jobs and names of hardcore branches or can I intend to do this?

+6
source share
1 answer

If I understand correctly, are you trying to figure out if there is a general way to create branches in jenkins? (correct me if I am wrong)

If this is what you are trying to achieve, you can use parameterized assemblies. Make the branch name as a parameter. In the jenkins configuration for the assembly, you can specify the parameter name as BRANCH and the link provided in your clone git command (I assume that you are using the execute shell)

git clone -b $ {BRANCH}

Now, every time you build, jenkins will tell you the name of the branch and you can specify values ​​like origin / master or origin / release, etc.

Hope this helps

-1
source

Source: https://habr.com/ru/post/950604/


All Articles