crosvm/kokoro/build.sh
Dylan Reid 1f909a21ba kokoro: Move the crosvm workdir
After trying symlinks and bind-mounts and various other shenanigans,
give up and move the crosvm working directory to a relative path that is
the same as in the chrome OS chroot.

This allows other crates in the cros checkout to find the crosvm crates
they depend on.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Change-Id: I643497f08c59328e02775ad3ac0ef9feafbf2930
Reviewed-on: https://chromium-review.googlesource.com/1436595
Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
2019-01-26 00:59:57 -08:00

32 lines
780 B
Bash
Executable file

#!/bin/bash
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -ex
main() {
if [ -z "${KOKORO_ARTIFACTS_DIR}" ]; then
echo "This script must be run in kokoro"
exit 1
fi
local src_root="${KOKORO_ARTIFACTS_DIR}"/git/crosvm
local base_image_tarball="${KOKORO_GFILE_DIR}"/crosvm-base.tar.xz
local base_image="crosvm-base"
if [[ "$(docker images -q ${base_image} 2> /dev/null)" == "" ]]; then
docker load -i "${base_image_tarball}"
fi
docker run \
--rm \
--privileged \
-e TEST_RUNNER_FLAGS='--format terse' \
-v /dev/log:/dev/log \
-v "${src_root}":/platform/crosvm:ro \
${base_image}
return 0
}
main "$@"