From 31b0bb00031e7dc376f7f546d5e02c6304256fc9 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 8 Aug 2021 20:01:11 +0200 Subject: [PATCH 1/4] ci: use exec runner --- .drone.yml | 88 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 42 deletions(-) diff --git a/.drone.yml b/.drone.yml index 48e7a96..3e89d98 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,48 +1,52 @@ +--- kind: pipeline +type: exec name: deploy CV steps: - - name: build - image: aergus/latex - pull: always - commands: - - make +- name: build + commands: + - nix develop -c make - - name: deploy - image: appleboy/drone-scp - settings: - source: /drone/src/*.pdf - strip_components: 2 # Make sure the tarball doesn't contain leading path - rm: true # Make sure only the newly generated files are left - host: - from_secret: ssh_host - target: - from_secret: ssh_target - username: - from_secret: ssh_user - key: - from_secret: ssh_key - port: - from_secret: ssh_port - when: - branch: - - main - event: - exclude: - - pull_request +- name: deploy + commands: + - nix run github:ambroisie/nix-config#drone-scp + environment: + SCP_SOURCE: /drone/src/*.pdf + SCP_STRIP_COMPONENTS: 2 # Make sure the tarball doesn't contain leading path + SCP_RM: true # Make sure only the newly generated files are left + SCP_HOST: + from_secret: ssh_host + SCP_TARGET: + from_secret: ssh_target + SCP_USERNAME: + from_secret: ssh_user + SCP_KEY: + from_secret: ssh_key + SCP_PORT: + from_secret: ssh_port + when: + branch: + - main + event: + exclude: + - pull_request - - name: notify - image: plugins/matrix - settings: - homeserver: - from_secret: matrix_homeserver - roomid: - from_secret: matrix_roomid - username: - from_secret: matrix_username - password: - from_secret: matrix_password - trigger: - status: - - failure - - success + +- name: notifiy + commands: + - nix run .#matrix-notifier + environment: + ADDRESS: + from_secret: matrix_homeserver + ROOM: + from_secret: matrix_roomid + USER: + from_secret: matrix_username + PASS: + from_secret: matrix_password + when: + status: + - failure + - success +... From 008d69b4ccceffca15b4a3bd85fcb905afa014b8 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 8 Aug 2021 20:03:44 +0200 Subject: [PATCH 2/4] nix: use `eachDefaultSystem` Due to the pre-commit check not having every system available... --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index fab424b..233f242 100644 --- a/flake.nix +++ b/flake.nix @@ -7,7 +7,7 @@ }; outputs = { self, nixpkgs, futils } @ inputs: - futils.lib.eachSystem futils.lib.allSystems (system: + futils.lib.eachDefaultSystem (system: let inherit (nixpkgs) lib; pkgs = nixpkgs.legacyPackages.${system}; From ef68f8bd73509aa81eb340db49bf3aec3f97831d Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 8 Aug 2021 20:04:13 +0200 Subject: [PATCH 3/4] ci: add check step --- .drone.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.drone.yml b/.drone.yml index 3e89d98..2a958d2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,6 +8,10 @@ steps: commands: - nix develop -c make +- name: check + commands: + - nix flake check + - name: deploy commands: - nix run github:ambroisie/nix-config#drone-scp From 0757daf786311bfc62d6452e8f52af18f6c19329 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 8 Aug 2021 20:05:11 +0200 Subject: [PATCH 4/4] ci: fix path to build output --- .drone.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2a958d2..69ad1fc 100644 --- a/.drone.yml +++ b/.drone.yml @@ -16,8 +16,7 @@ steps: commands: - nix run github:ambroisie/nix-config#drone-scp environment: - SCP_SOURCE: /drone/src/*.pdf - SCP_STRIP_COMPONENTS: 2 # Make sure the tarball doesn't contain leading path + SCP_SOURCE: *.pdf SCP_RM: true # Make sure only the newly generated files are left SCP_HOST: from_secret: ssh_host