Version bump in CI/CD pipeline (OD-167)
Chris opened 6 years ago

Hi,

I switched to onedev server for all my private coding projects and it works great so far, thanks! However I have one issue with certain kinds of projects. I have some maven/gradle/npm based projects where I'd like to do a version bump on master commit. Something like this:

  • commit on master triggers build
  • build removed snapshot from current version, if existent
  • project is built
  • update to next version using semver or npm version task (source change)
  • commit changes
  • create tag
  • push changes to remote

This works great, apart from one thing: The push obviosly triggers the build again and we end up in an endless loop. 😄

How is this kind of "version bump during CI/CD" thing meant to be solved using onedev?

Best regards, Chris

  • Robin Shen commented 6 years ago

    Thanks for the nice words. Glad to see it is useful for someone, 😄

    To solve this issue, you may exclude certain files from the trigger. For instance, I update build_number.txt in my job. To prevent OneDev branch update trigger from endless loop, exclude build_number.txt as demonstrated in below screenshot:

    2020 06 30 18 24 54

    You may also exclude certain folders or file patterns as necessary.

  • Robin Shen changed state to 'Closed' 6 years ago
    Previous Value Current Value
    Open
    Closed
  • Chris commented 6 years ago

    Great thanks, didn't get the trick to negate the files. Maybe it's helpful to add another sentence to the help section below the touched files input. Something like: "Add '-' to negate."?

  • Robin Shen commented 6 years ago

    Hmm... mentioning this in inline help can make this more explicit. Will add that in next patch release.

issue 1/1
Type
Question
Priority
Normal
Assignee
Issue Votes (0)
Watchers (3)
Reference
OD-167
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover