From c079b583a923ffa1cd7f1f16ec7df8383aba6f2e Mon Sep 17 00:00:00 2001 From: xeals Date: Thu, 15 Oct 2020 19:19:49 +1100 Subject: [PATCH] Build .drone.yml with jsonnet instead of drone The Drone tool completely ignores the environment key, because of course it does. It seems the CLI tool has been abandoned for feature parity here in favour of the built-in enterprise jsonnet parser, so guess we're doing this. --- .drone.yml | 177 ++++++++++++++++++++++++++++++----------------------- shell.nix | 2 +- 2 files changed, 102 insertions(+), 77 deletions(-) diff --git a/.drone.yml b/.drone.yml index e44bac9..2dd4a55 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,76 +1,101 @@ ---- -kind: pipeline -type: docker -name: nixpkgs-unstable - -platform: - os: linux - arch: amd64 - -steps: -- name: build - image: nixos/nix - commands: - - nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixos - - nix-channel --update - - nix-build ci.nix -A buildOutputs - - nix eval -f default.nix 'lib' - - nix eval -f default.nix 'modules' - - nix eval -f default.nix 'overlays' - -- name: deploy - image: nixpkgs/cachix - commands: - - nix-build ci.nix -A cacheOutputs | cachix push "${CACHIX_CACHE}" - ---- -kind: pipeline -type: docker -name: nixos-unstable - -platform: - os: linux - arch: amd64 - -steps: -- name: build - image: nixos/nix - commands: - - nix-channel --add https://nixos.org/channels/nixos-unstable nixos - - nix-channel --update - - nix-build ci.nix -A buildOutputs - - nix eval -f default.nix 'lib' - - nix eval -f default.nix 'modules' - - nix eval -f default.nix 'overlays' - -- name: deploy - image: nixpkgs/cachix - commands: - - nix-build ci.nix -A cacheOutputs | cachix push "${CACHIX_CACHE}" - ---- -kind: pipeline -type: docker -name: nixos-20.03 - -platform: - os: linux - arch: amd64 - -steps: -- name: build - image: nixos/nix - commands: - - nix-channel --add https://nixos.org/channels/nixos-20.03 nixos - - nix-channel --update - - nix-build ci.nix -A buildOutputs - - nix eval -f default.nix 'lib' - - nix eval -f default.nix 'modules' - - nix eval -f default.nix 'overlays' - -- name: deploy - image: nixpkgs/cachix - commands: - - nix-build ci.nix -A cacheOutputs | cachix push "${CACHIX_CACHE}" - -... +[ + { + "environment": { + "CACHIX_CACHE": "xeals", + "CACHIX_SIGNING_KEY": { + "from_secret": "cachix_key" + }, + "NUR_REPO": "xeals" + }, + "kind": "pipeline", + "name": "nixpkgs-unstable", + "steps": [ + { + "commands": [ + "nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixos", + "nix-channel --update", + "nix-build ci.nix -A buildOutputs", + "nix eval -f default.nix 'lib'", + "nix eval -f default.nix 'modules'", + "nix eval -f default.nix 'overlays'" + ], + "image": "nixos/nix", + "name": "build" + }, + { + "commands": [ + "nix-build ci.nix -A cacheOutputs | cachix push \"${CACHIX_CACHE}\"" + ], + "image": "nixpkgs/cachix", + "name": "deploy" + } + ], + "type": "docker" + }, + { + "environment": { + "CACHIX_CACHE": "xeals", + "CACHIX_SIGNING_KEY": { + "from_secret": "cachix_key" + }, + "NUR_REPO": "xeals" + }, + "kind": "pipeline", + "name": "nixos-unstable", + "steps": [ + { + "commands": [ + "nix-channel --add https://nixos.org/channels/nixos-unstable nixos", + "nix-channel --update", + "nix-build ci.nix -A buildOutputs", + "nix eval -f default.nix 'lib'", + "nix eval -f default.nix 'modules'", + "nix eval -f default.nix 'overlays'" + ], + "image": "nixos/nix", + "name": "build" + }, + { + "commands": [ + "nix-build ci.nix -A cacheOutputs | cachix push \"${CACHIX_CACHE}\"" + ], + "image": "nixpkgs/cachix", + "name": "deploy" + } + ], + "type": "docker" + }, + { + "environment": { + "CACHIX_CACHE": "xeals", + "CACHIX_SIGNING_KEY": { + "from_secret": "cachix_key" + }, + "NUR_REPO": "xeals" + }, + "kind": "pipeline", + "name": "nixos-20.03", + "steps": [ + { + "commands": [ + "nix-channel --add https://nixos.org/channels/nixos-20.03 nixos", + "nix-channel --update", + "nix-build ci.nix -A buildOutputs", + "nix eval -f default.nix 'lib'", + "nix eval -f default.nix 'modules'", + "nix eval -f default.nix 'overlays'" + ], + "image": "nixos/nix", + "name": "build" + }, + { + "commands": [ + "nix-build ci.nix -A cacheOutputs | cachix push \"${CACHIX_CACHE}\"" + ], + "image": "nixpkgs/cachix", + "name": "deploy" + } + ], + "type": "docker" + } +] diff --git a/shell.nix b/shell.nix index 1599ca6..b81d7e6 100644 --- a/shell.nix +++ b/shell.nix @@ -2,6 +2,6 @@ pkgs.mkShell { buildInputs = [ - pkgs.jsonnet pkgs.drone-cli + pkgs.jsonnet ]; }