diff options
author | Wong Hoi Sing Edison <hswong3i@gmail.com> | 2020-07-24 13:48:59 +0800 |
---|---|---|
committer | Wong Hoi Sing Edison <hswong3i@gmail.com> | 2020-08-03 11:52:18 +0800 |
commit | daaccf8896fb759e31e71a168e6354eb71fa596d (patch) | |
tree | c5a29814c798bf81b9178e214d72b057b58d3928 /.cirrus.yml | |
parent | f4d4bd22887e1271c3bf04532596f4c02201022e (diff) | |
download | podman-daaccf8896fb759e31e71a168e6354eb71fa596d.tar.gz podman-daaccf8896fb759e31e71a168e6354eb71fa596d.tar.bz2 podman-daaccf8896fb759e31e71a168e6354eb71fa596d.zip |
Speedup static build by utilizing CI cache on `/nix` folder
Signed-off-by: Wong Hoi Sing Edison <hswong3i@gmail.com>
Diffstat (limited to '.cirrus.yml')
-rw-r--r-- | .cirrus.yml | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/.cirrus.yml b/.cirrus.yml index a8f3a2817..22f84d7ec 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -760,21 +760,33 @@ success_task: static_build_task: depends_on: - "gating" + gce_instance: image_name: "${FEDORA_CACHE_IMAGE_NAME}" cpu: 8 memory: 12 disk: 200 - script: | + + init_script: | set -ex setenforce 0 growpart /dev/sda 1 || true resize2fs /dev/sda1 || true yum -y install podman + + nix_cache: + folder: '.cache' + fingerprint_script: | + echo "nix-v1-$(sha1sum nix/nixpkgs.json | head -c 40)" + + build_script: | + set -ex mkdir -p /nix - podman run --rm --privileged -ti -v /:/mnt nixos/nix cp -rfT /nix /mnt/nix + mkdir -p .cache + mount --bind .cache /nix + if [[ -z $(ls -A /nix) ]]; then podman run --rm --privileged -ti -v /:/mnt nixos/nix cp -rfT /nix /mnt/nix; fi podman run --rm --privileged -ti -v /nix:/nix -v ${PWD}:${PWD} -w ${PWD} nixos/nix nix --print-build-logs --option cores 8 --option max-jobs 8 build --file nix/ + chown -Rf $(whoami) .cache + binaries_artifacts: path: "result/bin/podman" - on_failure: - failed_branch_script: '$CIRRUS_WORKING_DIR/$SCRIPT_BASE/notice_branch_failure.sh |& ${TIMESTAMP}' |