summary refs log blame commit diff
path: root/kokoro/build.sh
blob: e78d9c7459a68208767fe5ece699ee5374bc35bd (plain) (tree)
1
2
3
4
5
6
7
8







                                                                        



                                            
 


                                                                   
 



                                                                       
          


                                           
                                          


                 


         
#!/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 "$@"