Blocking deployment to production if staging is RED


We have drone currently set up so that:

  1. Any feature branch being merged into our main branch causes a drone build which clones from main and creates various build artefacts.
  2. That build is then manually promoted to our staging and production environments using drone promotions with the targets “staging” and “production”, and everything works great.

The one difficulty we have is that someone can directly promote one of these drone builds to production without first going through staging, or if staging fails they can still continue to production.

Is there a straightforward way to prevent drone promotions with a certain target specified (prod) if there isn’t already green build to some other target (staging) which has the same parent build?

I hope my question makes sense. I can try to elaborate further if not.

Hi @PeterGSWhite got it! this is not doable. Let me check this around and get back to you.


Hi @PeterGSWhite your ask is not doable as you need custom tooling(you will need to have your own scripting/tooling to talk to drone API to check if a build had previously been promoted to staging before going to production).

So we have got Harness CD and Harness GitOps for this reason to give companies ways to safely promote changes between environments.

I hope this answers your query.