#!/bin/sh # # Boot strap running Ambient CI in a VM built for Ambient. Read a tar # archive from the specified device, and extract it into a temporary # directory. Then run the executable "run-ci" that's in that # directory. The executable can then do the rest of the work to # execute a CI run. set -eu die() { echo "ERROR: $*" 1>&2 exit 1 } log() { echo "INFO: $*" } if [ "$#" != 1 ]; then die "usage: $0 /dev/vdx" fi dev="$1" case "$dev" in /*) true ;; *) die "Argument MUST be an absolute path name" ;; esac tmp="$(mktemp -d)" cd "$tmp" log "Extracting tar archive from $dev" tar -xvf "$dev" echo log "Running run-ci from $dev" echo ================================ BEGIN ================================ if ./run-ci; then echo "EXIT CODE: 0" else echo "EXIT CODE: $?" fi