1234567891011121314151617181920212223242526272829303132333435363738 |
- #!/bin/bash -ex
- CWD="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
- SOURCE_DIR=$(cd "${CWD}/.." 2> /dev/null && pwd -P)
- case "${1}" in
- before_install)
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
- docker create \
- --cap-add SYS_ADMIN \
- --device /dev/loop-control \
- --name="${TRAVIS_COMMIT}" -t \
- -v "${SOURCE_DIR}":/tmp/build \
- -w /tmp/build \
- "${DISTRO}" /bin/cat
- docker start "${TRAVIS_COMMIT}"
- fi
- ;;
- after_script)
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
- docker kill "${TRAVIS_COMMIT}"
- docker rm "${TRAVIS_COMMIT}"
- fi
- ;;
- *)
- if [ -x "${CWD}/${1}" ]; then
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
- docker exec \
- "$(bash <(curl -s https://codecov.io/env))" \
- -e CC -e DISTRO \
- "${TRAVIS_COMMIT}" ./.travis/"${1}"
- fi
- fi
- ;;
- esac
- # vim: set ts=8 shiftwidth=4 softtabstop=4 expandtab smarttab colorcolumn=80:
|