Skip to content

Commit

Permalink
tool/test-annocheck.sh: Support multiple files in Dockerfile-copy.
Browse files Browse the repository at this point in the history
  • Loading branch information
junaruga committed Jul 24, 2024
1 parent 21351ef commit 0317536
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tool/annocheck/Dockerfile-copy
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM docker.io/fedora:latest
ARG FILES
ARG IN_DIR

RUN dnf -y install annobin-annocheck
COPY ${FILES} /work/
COPY ${IN_DIR} /work
WORKDIR /work
10 changes: 8 additions & 2 deletions tool/test-annocheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ set -x
DOCKER="$(command -v docker || command -v podman)"
TAG=ruby-fedora-annocheck
TOOL_DIR=$(dirname "${0}")
TMP_DIR="tmp/annocheck"
DOCKER_RUN_VOLUME_OPTS=

if [ -z "${CI-}" ]; then
Expand All @@ -27,8 +28,13 @@ else
# volume in container in container on GitHub Actions
# <.github/workflows/compilers.yml>.
TAG="${TAG}-copy"
sed -r "s/\\$\{FILES\}/${*}/" ${TOOL_DIR}/annocheck/Dockerfile-copy | \
"${DOCKER}" build --rm -t "${TAG}" --build-arg=FILES="${*}" -f - .
rm -rf "${TMP_DIR}"
mkdir -p "${TMP_DIR}"
for file in ${@}; do
cp -p "${file}" "${TMP_DIR}"
done
"${DOCKER}" build --rm -t "${TAG}" --build-arg=IN_DIR="${TMP_DIR}" -f ${TOOL_DIR}/annocheck/Dockerfile-copy .
rm -rf "${TMP_DIR}"
fi

"${DOCKER}" run --rm -t ${DOCKER_RUN_VOLUME_OPTS} "${TAG}" annocheck --verbose ${TEST_ANNOCHECK_OPTS-} "${@}"

0 comments on commit 0317536

Please sign in to comment.