summaryrefslogtreecommitdiff
path: root/contrib/cirrus
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-01-27 15:18:22 -0500
committerGitHub <noreply@github.com>2021-01-27 15:18:22 -0500
commit9d59daa7ccaea526a1aa742fadab537e77a51330 (patch)
tree421619779e182e336b759aef3db3c9e57417c755 /contrib/cirrus
parent14cc4aaf0a364bf0f4f7f77ec5f58fd79b1cb99e (diff)
parentf8bf509d16edaf9016d0b73265b3159c9bcaa223 (diff)
downloadpodman-9d59daa7ccaea526a1aa742fadab537e77a51330.tar.gz
podman-9d59daa7ccaea526a1aa742fadab537e77a51330.tar.bz2
podman-9d59daa7ccaea526a1aa742fadab537e77a51330.zip
Merge pull request #9082 from saschagrunert/static-build
Fix static build cache by using cachix
Diffstat (limited to 'contrib/cirrus')
-rw-r--r--contrib/cirrus/required_host_ports.txt1
-rwxr-xr-xcontrib/cirrus/runner.sh17
2 files changed, 9 insertions, 9 deletions
diff --git a/contrib/cirrus/required_host_ports.txt b/contrib/cirrus/required_host_ports.txt
index 9248e497a..5f066e059 100644
--- a/contrib/cirrus/required_host_ports.txt
+++ b/contrib/cirrus/required_host_ports.txt
@@ -2,3 +2,4 @@ github.com 22
docker.io 443
quay.io 443
registry.fedoraproject.org 443
+podman.cachix.org 443
diff --git a/contrib/cirrus/runner.sh b/contrib/cirrus/runner.sh
index 50bc1102f..3292cea84 100755
--- a/contrib/cirrus/runner.sh
+++ b/contrib/cirrus/runner.sh
@@ -241,15 +241,14 @@ function _run_altbuild() {
req_env_vars CTR_FQIN
[[ "$UID" -eq 0 ]] || \
die "Static build must execute nixos container as root on host"
- mkdir -p /var/cache/nix
- podman run -i --rm -v /var/cache/nix:/mnt/nix:Z \
- $CTR_FQIN cp -rfT /nix /mnt/nix
- podman run -i --rm -v /var/cache/nix:/nix:Z \
- -v $PWD:$PWD:Z -w $PWD $CTR_FQIN \
- nix --print-build-logs --option cores 4 --option max-jobs 4 \
- build --file ./nix/
- # result symlink is absolute from container perspective :(
- cp /var/cache/$(readlink result)/bin/podman ./ # for cirrus-ci artifact
+ podman run -i --rm \
+ -e CACHIX_AUTH_TOKEN \
+ -v $PWD:$PWD:Z -w $PWD $CTR_FQIN sh -c \
+ "nix-env -iA cachix -f https://cachix.org/api/v1/install && \
+ cachix use podman && \
+ nix-build nix && \
+ nix-store -qR --include-outputs \$(nix-instantiate nix/default.nix) | grep -v podman | cachix push podman && \
+ cp -R result/bin ."
rm result # makes cirrus puke
;;
*)