diff --git a/.travis.yml b/.travis.yml index ce6ae75..b8f0818 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,50 +19,7 @@ script: | cachix authtoken "$CACHIX_AUTH_TOKEN" fi - # build an rpi0 sample image - nix-build . \ - --cores 2 \ - --max-jobs 2 \ - --no-build-output \ - -I nixpkgs=nixpkgs \ - -I machine=machines/raspberrypi-zerow \ - -I image=images/rpi0-otg-ether - - # push rpi0 with permission - if [[ ${CACHIX_AUTH_TOKEN:-} ]]; then - cachix push cross-armed $(readlink -f result) - cachix push cross-armed $(nix-store -qd result) - fi - - # build a beaglebone sample image - nix-build . \ - --cores 2 \ - --max-jobs 2 \ - --no-build-output \ - -I nixpkgs=nixpkgs \ - -I machine=machines/beaglebone \ - -I image=images/mini - - # push beaglebone with permission - if [[ ${CACHIX_AUTH_TOKEN:-} ]]; then - cachix push cross-armed $(readlink -f result) - cachix push cross-armed $(nix-store -qd result) - fi - - # build a toradex apalis imx6 sample image - nix-build . \ - --cores 2 \ - --max-jobs 2 \ - --no-build-output \ - -I nixpkgs=nixpkgs \ - -I machine=machines/toradex_apalis_imx6 \ - -I image=images/mini - - # push toradex apalis imx6 with permission - if [[ ${CACHIX_AUTH_TOKEN:-} ]]; then - cachix push cross-armed $(readlink -f result) - cachix push cross-armed $(nix-store -qd result) - fi + ./update-cachix.sh # kill the background process kill %1 diff --git a/update-cachix.sh b/update-cachix.sh new file mode 100755 index 0000000..ca58436 --- /dev/null +++ b/update-cachix.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -euo pipefail + +function build_n_push() { + local machine="$1" + local image="$2" + + nix-build . \ + --no-build-output \ + -I nixpkgs=nixpkgs \ + -I machine="$machine" \ + -I image="$image" + + if [[ ${CACHIX_AUTH_TOKEN:-} ]]; then + cachix push cross-armed $(readlink -f result) + cachix push cross-armed $(nix-store -qd result) + fi +} + +build_n_push machines/raspberrypi-zerow images/mini +build_n_push machines/raspberrypi-zero images/mini +build_n_push machines/raspberrypi-2 images/mini +build_n_push machines/raspberrypi-3 images/mini +build_n_push machines/beaglebone images/mini +build_n_push machines/odroid-c2 images/mini +