summaryrefslogtreecommitdiff
path: root/ci/run-docker.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-04-29 16:15:28 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-04-29 16:15:28 -0700
commitaf986863c1ae2e306d5627f4e42cc6d2cf2a057f (patch)
treee7cf9db4f41edc5b0da13029758587cfff62a7c8 /ci/run-docker.sh
parentMerge branch 'dl/merge-autostash-rebase-quit-fix' (diff)
parenttravis: build and test on Linux with musl libc and busybox (diff)
downloadtgif-af986863c1ae2e306d5627f4e42cc6d2cf2a057f.tar.xz
Merge branch 'dd/ci-musl-libc'
A new CI job to build and run test suite on linux with musl libc has been added. * dd/ci-musl-libc: travis: build and test on Linux with musl libc and busybox ci/linux32: libify install-dependencies step ci: refactor docker runner script ci/linux32: parameterise command to switch arch ci/lib-docker: preserve required environment variables ci: make MAKEFLAGS available inside the Docker container in the Linux32 job
Diffstat (limited to 'ci/run-docker.sh')
-rwxr-xr-xci/run-docker.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/ci/run-docker.sh b/ci/run-docker.sh
new file mode 100755
index 0000000000..37fa372052
--- /dev/null
+++ b/ci/run-docker.sh
@@ -0,0 +1,47 @@
+#!/bin/sh
+#
+# Download and run Docker image to build and test Git
+#
+
+. ${0%/*}/lib.sh
+
+case "$jobname" in
+Linux32)
+ CI_CONTAINER="daald/ubuntu32:xenial"
+ ;;
+linux-musl)
+ CI_CONTAINER=alpine
+ ;;
+*)
+ exit 1
+ ;;
+esac
+
+docker pull "$CI_CONTAINER"
+
+# Use the following command to debug the docker build locally:
+# <host-user-id> must be 0 if podman is used as drop-in replacement for docker
+# $ docker run -itv "${PWD}:/usr/src/git" --entrypoint /bin/sh "$CI_CONTAINER"
+# root@container:/# export jobname=<jobname>
+# root@container:/# /usr/src/git/ci/run-docker-build.sh <host-user-id>
+
+container_cache_dir=/tmp/travis-cache
+
+docker run \
+ --interactive \
+ --env DEVELOPER \
+ --env DEFAULT_TEST_TARGET \
+ --env GIT_PROVE_OPTS \
+ --env GIT_TEST_OPTS \
+ --env GIT_TEST_CLONE_2GB \
+ --env MAKEFLAGS \
+ --env jobname \
+ --env cache_dir="$container_cache_dir" \
+ --volume "${PWD}:/usr/src/git" \
+ --volume "$cache_dir:$container_cache_dir" \
+ "$CI_CONTAINER" \
+ /usr/src/git/ci/run-docker-build.sh $(id -u $USER)
+
+check_unignored_build_artifacts
+
+save_good_tree