mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-10-01 06:21:56 -09:00
utils/docker-run: new script
Add a small script to run commands in the same docker image used in the GitLab CI. For instance, one can run check-package unit tests without installing pytest directly in the host: $ ./utils/docker-run python3 -m pytest -v utils/checkpackagelib/ Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> [Arnout: fix shellcheck errors; add exec] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
committed by
Arnout Vandecappelle (Essensium/Mind)
parent
fcceee0b2e
commit
242e9d72e7
10
utils/docker-run
Executable file
10
utils/docker-run
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
set -o errexit -o pipefail
|
||||||
|
DIR=$(dirname "${0}")
|
||||||
|
MAIN_DIR=$(readlink -f "${DIR}/..")
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
IMAGE=$(grep ^image: "${MAIN_DIR}/.gitlab-ci.yml" | \
|
||||||
|
sed -e 's,^image: ,,g' | sed -e 's,\$CI_REGISTRY,registry.gitlab.com,g')
|
||||||
|
|
||||||
|
set -x
|
||||||
|
exec docker run -v "${MAIN_DIR}:/home/br-user" -t "${IMAGE}" "$@"
|
||||||
Reference in New Issue
Block a user