Skip to content

Commit

Permalink
ci: update ci to build more images
Browse files Browse the repository at this point in the history
  • Loading branch information
illegalprime committed Sep 17, 2019
1 parent 8e53ab6 commit 15fe63b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 44 deletions.
45 changes: 1 addition & 44 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions update-cachix.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 15fe63b

Please sign in to comment.