2020-02-18 11:22:12 +07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
main() {
|
|
|
|
cd "$(dirname "$0")/../.."
|
2020-02-19 01:06:18 +07:00
|
|
|
|
2020-03-27 03:50:32 +07:00
|
|
|
# This, strangely enough, fixes the arm build being terminated for not having
|
|
|
|
# output on Travis. It's as if output is buffered and only displayed once a
|
|
|
|
# certain amount is collected. Five seconds didn't work but one second seems
|
|
|
|
# to generate enough output to make it work.
|
|
|
|
local pid
|
|
|
|
while true; do
|
|
|
|
echo 'Still running...'
|
|
|
|
sleep 1
|
|
|
|
done &
|
|
|
|
pid=$!
|
|
|
|
|
2020-02-19 01:06:18 +07:00
|
|
|
docker build ci/image
|
2020-02-18 11:22:12 +07:00
|
|
|
imageTag="$(docker build -q ci/image)"
|
2020-02-19 04:34:28 +07:00
|
|
|
docker run -t --rm -e CI -e GITHUB_TOKEN -e TRAVIS_TAG -v "$(yarn cache dir):/usr/local/share/.cache/yarn/v6" -v "$PWD:/repo" -w /repo "$imageTag" "$*"
|
2020-03-27 03:50:32 +07:00
|
|
|
|
|
|
|
kill $pid
|
2020-02-18 11:22:12 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|