No description
Find a file
Gabor Pihaj 9b6ee9886f
fix: revert openssl installation (#14)
This reverts commit 7dc68ba37f.

Reviewed-on: https://git.vdx.hu/voidcontext/woodpecker-plugin-nix-attic/pulls/14
Co-authored-by: Gabor Pihaj <gabor.pihaj@gmail.com>
Co-committed-by: Gabor Pihaj <gabor.pihaj@gmail.com>
2023-10-08 16:53:40 +00:00
.woodpecker chore(build): update public key of nix cache (#12) 2023-10-01 13:43:13 +00:00
CHANGELOG.md chore(version): 0.1.1 2023-09-30 19:19:42 +01:00
cog.toml build: add publish release pipeline (#5) 2023-09-30 17:02:41 +00:00
entrypoint.nix fix: create the runner script outside of the workspace (#9) 2023-09-30 18:15:22 +00:00
flake.lock feat: create docker image with nix configured and attic available 2023-09-30 11:51:35 +01:00
flake.nix fix: create the runner script outside of the workspace (#9) 2023-09-30 18:15:22 +00:00
mkImage.nix fix: revert openssl installation (#14) 2023-10-08 16:53:40 +00:00
README.md docs: add README.md (#10) 2023-09-30 20:03:43 +00:00

Woodpecker plugin: nix-attic

This woodpecker plugin can be configured to use a private binary cache, and it also has attic-client pre-installed.

Example configuration

steps:
  check:
    image: git.vdx.hu/voidcontext/woodpecker-plugin-nix-attic:0.1.0
    settings:
      binary_cache: https://some-binary-cache.example.com
      binary_cache_public_key: some-binary-cache.example.com:some-public-key
      binary_cache_token:
        from_secret: binary_cache_access_token
      script: |
       nix flake check
       nix build
       attic login default $PLUGIN_BINARY_CACHE_TOKEN
       attic push some-cache $(nix path-info .#default)

How to build the image locally?

On Linux

$ nix build
$ docker load -i result

On macOS

The easiest way to build the image is using a previously built version of the image:

$ echo << EOF >> cmd.txt
nix build
nix-env -iA nixpkgs.docker-client
docker load -i result
EOF
$ docker run -it                                                                   \
  -e PLUGIN_BINARY_CACHE=https://some-binary-cache.example.com                     \
  -e PLUGIN_BINARY_CACHE_PUBLIC_KEY=some-binary-cache.example.com:some-public-keyi \
  -e PLUGIN_BINARY_CACHE_TOKEN=$ACCESS_TOKEN                                       \
  -e PLUGIN_SCRIPT="$(cat cmd.txt)"                                                \
  -v $(pwd):/opt/plugin                                                            \
  -w /opt/plugin                                                                   \
  -v /var/run/docker.sock:/var/run/docker.sock                                     \
  git.vdx.hu/voidcontext/woodpecker-plugin-nix-attic:0.1.0