crosvm/kokoro/kokoro_simulator.sh
Gabriel cdae1067c3 kokoro: Fix docker build step in simulator script
The old command no longer works as of CL:1419397 because the pkgconfig
path in COPY needs to be interpreted relative to the Dockerfile path.
The kokoro/README.md instructions were updated in CL:1431356 but the
simulator script was not.

Patch received via email from Gabriel <g2p.code@gmail.com>.
0e6bb00b90

TEST=run kokoro simulator

Change-Id: I09d556cab9a4c1942098e0796e39e221f365c3af
Reviewed-on: https://chromium-review.googlesource.com/1513497
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
2019-03-12 18:54:16 -07:00

36 lines
976 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() {
cd "$(dirname "$0")"
local kokoro_simulator_root=/tmp/kokoro_simulator
local src_root="${kokoro_simulator_root}"/git/crosvm
local base_image_tarball="${kokoro_simulator_root}"/crosvm-base.tar.xz
local base_image="crosvm-base"
mkdir -p "${kokoro_simulator_root}"
if [[ ! -e "${base_image_tarball}" ]]; then
if [[ "$(docker images -q ${base_image} 2> /dev/null)" == "" ]]; then
docker build -t ${base_image} .
fi
docker save ${base_image} | xz -T 0 -z >"${base_image_tarball}"
fi
if [[ ! -e "${src_root}" ]]; then
mkdir -p "${kokoro_simulator_root}"/git
ln -s "$(realpath ../)" "${src_root}"
fi
export KOKORO_ARTIFACTS_DIR="${kokoro_simulator_root}"
export KOKORO_GFILE_DIR="${kokoro_simulator_root}"
./build.sh
}
main "$@"