From 42413399630d015e74aa0e782f217dbc25ff9fe8 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Fri, 21 Aug 2020 18:40:30 +0100 Subject: [PATCH] Define Buildkite pipelines corresponding to git server hooks I think maintaining a 1:1 correspondence with the git server hook makes sense right now. Let's try it out! --- ci/pipelines/briefcase.nix | 17 ----------------- ci/pipelines/{socrates.nix => post-receive.nix} | 11 +++++++++-- ci/pipelines/pre-receive.nix | 11 +++++++++++ 3 files changed, 20 insertions(+), 19 deletions(-) delete mode 100644 ci/pipelines/briefcase.nix rename ci/pipelines/{socrates.nix => post-receive.nix} (52%) create mode 100644 ci/pipelines/pre-receive.nix diff --git a/ci/pipelines/briefcase.nix b/ci/pipelines/briefcase.nix deleted file mode 100644 index 95977ccb9..000000000 --- a/ci/pipelines/briefcase.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs, ... }: - -let - pipeline.steps = [ - { - key = "lint"; - command = "${pkgs.git-secrets}/bin/git-secrets --scan-history"; - label = ":broom: lint"; - } - { - key = "build"; - command = "nix-build . -I briefcase=$(pwd) --no-out-link --show-trace"; - label = ":nix: build"; - depends_on = "lint"; - } - ]; -in pkgs.writeText "briefcase.yaml" (builtins.toJSON pipeline) diff --git a/ci/pipelines/socrates.nix b/ci/pipelines/post-receive.nix similarity index 52% rename from ci/pipelines/socrates.nix rename to ci/pipelines/post-receive.nix index b75531188..415f10408 100644 --- a/ci/pipelines/socrates.nix +++ b/ci/pipelines/post-receive.nix @@ -3,6 +3,12 @@ let pipeline.steps = [ { + key = "build-briefcase"; + command = "nix-build . -I briefcase=$(pwd) --no-out-link --show-trace"; + label = ":nix: build briefcase"; + } + { + key = "build-socrates"; command = '' nix-build '' \ -I briefcase="$(pwd)" \ @@ -12,7 +18,8 @@ let --no-out-link \ --show-trace ''; - label = ":nix: build"; + label = ":nix: build socrates"; + depends_on = "build-briefcase"; } ]; -in pkgs.writeText "socrates.yml" (builtins.toJSON pipeline) +in pkgs.writeText "pipeline.yaml" (builtins.toJSON pipeline) diff --git a/ci/pipelines/pre-receive.nix b/ci/pipelines/pre-receive.nix new file mode 100644 index 000000000..9a30f271e --- /dev/null +++ b/ci/pipelines/pre-receive.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: + +let + pipeline.steps = [ + { + key = "lint"; + command = "${pkgs.git-secrets}/bin/git-secrets --scan-history"; + label = ":broom: lint"; + } + ]; +in pkgs.writeText "pipeline.yaml" (builtins.toJSON pipeline)