about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-06-27T16·14+0100
committertazjin <mail@tazj.in>2020-06-27T16·55+0000
commit22b8a49b87d2b86329add48e9af69ffd29ff6118 (patch)
tree545b57e6ffd307babcf17a41e3c8698b6d9cd30c
parent7f703913edd6ca53703a8b3b2fba79ab09890683 (diff)
feat(ops/pipelines): Add Buildkite pipeline configuration r/1099
This adds configuration which generates the structure expected for
Buildkite pipelines, which can then be dynamically ingested by
Buildkite when a pipeline is triggered.

Change-Id: I61e3dc3affb19c1f2550ef827fa73b17f8d8ae47
Reviewed-on: https://cl.tvl.fyi/c/depot/+/627
Reviewed-by: ericvolp12 <ericvolp12@gmail.com>
Reviewed-by: lukegb <lukegb@tvl.fyi>
-rw-r--r--ops/pipelines/README.md3
-rw-r--r--ops/pipelines/depot.nix21
-rw-r--r--third_party/default.nix1
3 files changed, 25 insertions, 0 deletions
diff --git a/ops/pipelines/README.md b/ops/pipelines/README.md
new file mode 100644
index 0000000000..f4ab1cc1ae
--- /dev/null
+++ b/ops/pipelines/README.md
@@ -0,0 +1,3 @@
+This folder contains various utilities used for our [Buildkite CI
+setup][ci]. These are mostly hooks invoked by Buildkite runners, or
+configuration used to set up the build pipelines.
diff --git a/ops/pipelines/depot.nix b/ops/pipelines/depot.nix
new file mode 100644
index 0000000000..40de18b5de
--- /dev/null
+++ b/ops/pipelines/depot.nix
@@ -0,0 +1,21 @@
+# This file configures the primary build pipeline used for the
+# top-level list of depot targets.
+#
+# It outputs a "YAML" (actually JSON) file which is evaluated and
+# submitted to Buildkite at the start of each build. This means we can
+# dynamically configure the pipeline execution here.
+{ depot, pkgs, ... }:
+
+let
+  inherit (builtins) toJSON;
+  inherit (pkgs) writeText;
+
+  # This defines the build pipeline, using the pipeline format
+  # documented on https://buildkite.com/docs/pipelines/defining-steps
+  pipeline.steps = [
+    {
+      command = "nix-build -A ciBuilds.__allTargets";
+      label = "all-targets";
+    }
+  ];
+in writeText "depot.yaml" (toJSON pipeline)
diff --git a/third_party/default.nix b/third_party/default.nix
index 7d1e83573a..4c29ba4803 100644
--- a/third_party/default.nix
+++ b/third_party/default.nix
@@ -44,6 +44,7 @@ let
       buildGoModule
       buildGoPackage
       buildPackages
+      buildkite-agent
       bzip2
       c-ares
       cacert