From dfc053958a6e944afe917679c98c4232b73a0304 Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Mon, 13 Jun 2022 12:51:26 -0400
Subject: [PATCH] Gate deployment on the other relevant QA jobs

---
 .gitlab-ci.yml | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0f9bf503..a8411657 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -53,7 +53,7 @@ morph-build-localdev:
       # just needs this tweak.
       echo '{}' > morph/grid/${GRID}/public-keys/users.nix
 
-morph-build-testing:
+morph-build-staging:
   <<: *MORPH_BUILD
   variables:
     GRID: "testing"
@@ -94,6 +94,13 @@ system-tests:
 # Update the staging deployment - only on a commit to the develop branch.
 update-staging:
   <<: *UPDATE_GRID
+
+  # https://docs.gitlab.com/ee/ci/yaml/index.html#needs
+  needs:
+    # Only deploy if the code looks good.
+    - "system-tests"
+    - "morph-build-staging"
+
   # https://docs.gitlab.com/ee/ci/yaml/#rules
   rules:
     # https://docs.gitlab.com/ee/ci/yaml/index.html#rulesif
@@ -116,6 +123,13 @@ update-staging:
 # Update the production deployment - only on a commit to the production branch.
 deploy-to-production:
   <<: *UPDATE_GRID
+
+  # https://docs.gitlab.com/ee/ci/yaml/index.html#needs
+  needs:
+    # Only deploy if the code looks good.
+    - "system-tests"
+    - "morph-build-staging"
+
   # https://docs.gitlab.com/ee/ci/yaml/#rules
   rules:
     # https://docs.gitlab.com/ee/ci/yaml/index.html#rulesif
-- 
GitLab