Excluding or Including Branches for CloudBees CodeShip

Codeship ProDevelopment

Reading Time: 2 minutes

You may have read our recent blog about the time we occasionally take – and just recently did again – for our team to work on any small items they’d like. If not, we recommend giving it a quick read.

One of the items we released that week was the ability to include, or exclude, branches for your builds.

Configuring your branches

If you navigate to your Project Settings screen, you’ll find a new tab labeled Branches.

On this tab, you can select either:

  • Don’t run builds for these branches, or
  • Run builds for these branches only.

Don’t run builds for these branches

Any branches you list here will be automatically ignored and will no longer trigger any builds. Note that this takes exact branch matches only.

Run builds for these branches only

If you’d like to get really narrow and explicit for when to run your continuous integration/continuous delivery (CI/CD) process, you can use this option. We will only trigger builds for the branches you list here. Again, though, note that this takes exact branch matches only – so this option is most useful during phases of reconfiguration and will be difficult to manage production CI/CD with.

The CloudBees CodeShip Pro “exclude” option

If you’re a CloudBees CodeShip Pro user, you may be familiar with the “exclude” key that you can use in your codeship-steps.yml file.

If you’re using this option, it’s important to note that this will be overridden by the new “exclude branches” feature. The “exclude” steps option happens within a build and allows for dynamic step configurations, whereas the “exclude branches” option stops the build from running altogether.

Conclusion

Hopefully, this feature helps you run your CI/CD process more efficiently, avoiding errant builds during reconfiguration phases or setting new projects up without running builds guaranteed to fail.

If you have any questions, just get in touch and you can always reference this feature in on our documentation as well.

Subscribe via Email

Over 60,000 people from companies like Netflix, Apple, Spotify and O'Reilly are reading our articles.
Subscribe to receive a weekly newsletter with articles around Continuous Integration, Docker, and software development best practices.



We promise that we won't spam you. You can unsubscribe any time.

Join the Discussion

Leave us some comments on what you think about this topic or if you like to add something.