From ab05681ebff81f21c82be055accaaa4c5dd023b1 Mon Sep 17 00:00:00 2001 From: Patrick Cleavelin Date: Mon, 31 Jul 2023 16:37:42 -0500 Subject: [PATCH 1/5] add nix store volume --- .woodpecker.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index fc71132..152f1f5 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -6,6 +6,8 @@ steps: - echo "system-features = nixos-test benchmark big-parallel uid-range kvm" > /etc/nix/nix.conf - nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#docker - cp $(nix build --extra-experimental-features nix-command --extra-experimental-features flakes --print-out-paths .#docker) ./memejoin-rs.tar.gz + volumes: + - /nix/store:/nix/store publish-image: when: @@ -20,3 +22,4 @@ steps: - 'docker image push git.spacegirl.nl/${CI_REPO}:${CI_COMMIT_TAG}' volumes: - /var/run/docker.sock:/var/run/docker.sock + - /nix/store:/nix/store -- 2.40.1 From 3e91bdabfd1f58fce75d29e68899e09d14aa3d2a Mon Sep 17 00:00:00 2001 From: Patrick Cleavelin Date: Mon, 31 Jul 2023 17:29:19 -0500 Subject: [PATCH 2/5] don't plop nix store files on root of CI server --- .woodpecker.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 152f1f5..4f1ae7e 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,13 +1,16 @@ steps: build-docker-image: + when: + event: push image: alpine:edge commands: + - echo $AGENT_NIX_STORE_PATH - apk add --no-cache git nix --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing - echo "system-features = nixos-test benchmark big-parallel uid-range kvm" > /etc/nix/nix.conf - nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#docker - cp $(nix build --extra-experimental-features nix-command --extra-experimental-features flakes --print-out-paths .#docker) ./memejoin-rs.tar.gz volumes: - - /nix/store:/nix/store + - ${AGENT_NIX_STORE_PATH}/store:/nix/store publish-image: when: @@ -22,4 +25,4 @@ steps: - 'docker image push git.spacegirl.nl/${CI_REPO}:${CI_COMMIT_TAG}' volumes: - /var/run/docker.sock:/var/run/docker.sock - - /nix/store:/nix/store + - ${AGENT_NIX_STORE_PATH}/store:/nix/store -- 2.40.1 From c1238feee2ac26f4d3db1145eea0e4d6ffbab586 Mon Sep 17 00:00:00 2001 From: Patrick Cleavelin Date: Mon, 31 Jul 2023 19:24:03 -0500 Subject: [PATCH 3/5] update flake tag --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 1ebb90f..8e8ddf5 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,7 @@ outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system: let - tag = "0.1.4_3-alpha"; + tag = "v0.1.4_4-alpha"; overlays = [ (import rust-overlay) ]; pkgs = import nixpkgs { inherit system overlays; -- 2.40.1 From 29105e2ba22035b6850d144ae244dc5386170db6 Mon Sep 17 00:00:00 2001 From: Patrick Cleavelin Date: Mon, 31 Jul 2023 21:36:39 -0500 Subject: [PATCH 4/5] mount the entire nix directory as a volume --- .woodpecker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 4f1ae7e..1726532 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -4,13 +4,13 @@ steps: event: push image: alpine:edge commands: - - echo $AGENT_NIX_STORE_PATH + - echo ${AGENT_NIX_STORE_PATH} - apk add --no-cache git nix --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing - echo "system-features = nixos-test benchmark big-parallel uid-range kvm" > /etc/nix/nix.conf - nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#docker - cp $(nix build --extra-experimental-features nix-command --extra-experimental-features flakes --print-out-paths .#docker) ./memejoin-rs.tar.gz volumes: - - ${AGENT_NIX_STORE_PATH}/store:/nix/store + - ${AGENT_NIX_STORE_PATH}:/nix publish-image: when: @@ -25,4 +25,4 @@ steps: - 'docker image push git.spacegirl.nl/${CI_REPO}:${CI_COMMIT_TAG}' volumes: - /var/run/docker.sock:/var/run/docker.sock - - ${AGENT_NIX_STORE_PATH}/store:/nix/store + - ${AGENT_NIX_STORE_PATH}:/nix -- 2.40.1 From b54754df878d36da1a4475024cb16a5c394fc214 Mon Sep 17 00:00:00 2001 From: Patrick Cleavelin Date: Mon, 31 Jul 2023 22:10:19 -0500 Subject: [PATCH 5/5] don't print nix store path --- .woodpecker.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 1726532..7e7c50b 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -4,7 +4,6 @@ steps: event: push image: alpine:edge commands: - - echo ${AGENT_NIX_STORE_PATH} - apk add --no-cache git nix --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing - echo "system-features = nixos-test benchmark big-parallel uid-range kvm" > /etc/nix/nix.conf - nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#docker @@ -14,8 +13,7 @@ steps: publish-image: when: - - event: tag - branch: master + event: tag image: docker secrets: [ forgejo_token ] commands: -- 2.40.1