blob: 519f91df1ac7fd1f6cf6451e8155c5ab0df6b63d [file] [log] [blame]
#/usr/bin/env bash
# run locally with all environment variables expected of kokoro, but with
# NOT_CI=true. Script to run is the first argument
script=${1?-must specify a script name to run, relative to .kokoro, without the trailing .sh}
export ci_dir="$(realpath $(dirname -- "${BASH_SOURCE[0]}"))"
export root_dir=${ci_dir:?could not figure out script dir}/../
# don't do anything that requires sudo, like installing packages
export NOT_CI=true
# set up kokoro-related env vars
export KOKORO_ARTIFACTS_DIR=$(mktemp --directory --tmpdir fake-kokoro-XXXXXX)
export PUBLISHING_KEY="not-a-valid-key-this-is-intentional-we-dont-want-to-publish"
export NIGHTLY_DISAMBIGUATOR=${NIGHTLY_DISAMBIGUATOR:-"00"}
# set up the git directory in the right place
mkdir ${KOKORO_ARTIFACTS_DIR}/git
ln -s ${root_dir} ${KOKORO_ARTIFACTS_DIR}/git/vscode-plugins
# do the thing!
echo "running ${root_dir}/.kokoro/${script}.sh with artifacts dir of ${KOKORO_ARTIFACTS_DIR}..." >&2
${root_dir}/.kokoro/${script}.sh