Builds: Stop builds feature available

Folks have been asking for a more direct way to control their build behavior - something less extreme than “have Netlify staff turn off builds” yet more frugal and self-directed than “build everything”. Today we’re launching a “Stop Builds” feature, which you can read more about in our official documentation.

This feature adds a button to the UI that any person on your team can access, to tell our system to stop processing build events from your git provider:

You can find this setting on your Build & Deploys configuration tab for each site.

Let us know what you think about this in the thread below!

1 Like

We were waiting for this for a really long time. Unfortunately, the wait is not over yet. It’s still adds no value in our case at least… What was the point to remove “Trigger deploy” button from the UI?

The most wanted feature in our team was that we could stop automatic builds when pushing new commits, but at the same time we would be able to hit “Trigger deploy” button on the Netlify UI when needed.

Hey @nesvarbu,
We disable the “Trigger deploy” button in the UI when you stop builds because… there’s nothing to trigger that you don’t already have (you already have old deploy previews). We’re not getting updates from your repo once you’ve stopped builds.

Would this workflow work for you?

  1. Stop builds on Netlify
  2. Push all the commits you want to GitHub, GitLab, etc.
  3. When things are in a state where you’re ready to see a deploy, re-activate builds on Netlify
  4. Trigger a deploy :beers: This will deploy the latest from your repo.

Hi @jen,

This is what we currently do, but this is a bit time consuming workaround as we manually deploy up to 30 different apps at once. And, potentially, a new commits might happen while in between.

Thanks for the explanation. Then, I think a shortcut saying “Fetch changes and deploy site” (name it better) would be great too, somewhere under here:

What do you think?

Makes sense, thanks! I’ve gotten a feature request filed with our team. I doubt we’ll make that change very soon, so you might consider using our API to change the value instead:

(you’d want to set stop_builds to false, trigger a build - perhaps using a build hook or even just the trigger builds API endpoint?

Thanks for the update. No, the API is even worse option.

We have chosen Netlify for our frontend apps to avoid such pipelines completely. At our company, we strongly believe that most of frontend apps does not need such overengineering/overhead. In most cases all we need is just to push the code to our repository and trigger build/deploy to production with a single click, when needed (as otherwise we would need around 1-2k build minutes per day). We are so close.

OK. Guess you have the best workflow for your needs at present, considering the options our other customers (and our own team) use, don’t suit you.

You might want to review this article to see if you can tune any configuration around how you build that does fit your use case:

Thanks for sharing this. Unfortunately, I did not find anything we could apply for our case. Currently we do to use [skip netlify] flag together with “husky”, but this is not the most reliable option.

Our workflow:

  • We have a mono repo :white_check_mark:
  • We have nearly 30 sites (example.de, example.fr, etc.) on Netlify which are linked to the same repo and have to build these with different contents, varies by env variables :white_check_mark:
  • When we update a content for .de website, we go to Netlify and click “Deploy site” (because we can’t setup hooks with “stop builds” feature enabled, but it’s fine) :white_check_mark:
  • Additionally, every commit in a codebase triggers a build which takes around 3 min x 30 sites = 90 minutes, we don’t need that :x:

Any insights?

So you’d want to use the build.ignore script to tell which site has the changes, and only build that one if there are only changes to that one; then there are no wasted build minutes. There are some great examples of that script in the post I linked in my last response :slight_smile:

I earlier though that is more related to comparing changes only. What script would you recommend, so that build won’t get triggered by pushing a commit, but only after clicking the button on Netlify UI (or via hook)? :slight_smile:

Hey @nesvarbu,

There’s a few different ways which you could engineer this solution. As mentioned by fool, you have build.ignore as follows: How to Ignore Builds - Optimize your Netlify Build Times.

You might even be able to engineer something using the newly-launched build plugins though I’ve not explored this option and this use case thoroughly! Although, I have linked to a discussion regarding programmatic cancellation of builds.

If your ignore script checks for a $COMMIT_REF, it will be a real commit hash value if built from a commit, otherwise it will be HEAD or not set, if built with the button :wink: