Skip to content

Commit

Permalink
Remove entrypoint.sh as it is not needed
Browse files Browse the repository at this point in the history
Signed-off-by: Christian König <[email protected]>
  • Loading branch information
yubiuser committed Jun 24, 2024
1 parent 20145db commit 19c4a82
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
7 changes: 4 additions & 3 deletions build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
set -ex

if [[ "$1" == "enter" ]]; then
enter="-it --entrypoint=sh"
enter="-it"
cmd="sh"
fi

GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD | sed "s/\//-/g")
Expand All @@ -11,7 +12,7 @@ GIT_TAG="${GIT_TAG:-$GIT_BRANCH}"
PLATFORM="${PLATFORM:-linux/amd64}"

# generate and build dockerfile
docker buildx build --load --platform=${PLATFORM} --tag image_pipenv --file test/Dockerfile test/
docker buildx build --load --platform="${PLATFORM}" --tag image_pipenv --file test/Dockerfile test/
docker run --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd):/$(pwd)" \
Expand All @@ -20,4 +21,4 @@ docker run --rm \
--env GIT_TAG="${GIT_TAG}" \
--env PY_COLORS=1 \
--env TARGETPLATFORM="${PLATFORM}" \
${enter} image_pipenv
${enter} image_pipenv ${cmd}
5 changes: 2 additions & 3 deletions test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ ARG docker_version="25.0.4"
FROM docker:${docker_version}-cli-alpine${alpine_version}

COPY --chmod=0755 ./cmd.sh /usr/local/bin/cmd.sh
COPY --chmod=0755 ./entrypoint.sh /usr/local/bin/entrypoint.sh
COPY requirements.txt /root/
WORKDIR /root

Expand All @@ -18,5 +17,5 @@ RUN apk add --no-cache \
# Tests fall over without it. Investigate later.
&& sed -i 's|/bin/sh|/bin/bash|g' /usr/lib/python3.11/site-packages/testinfra/backend/docker.py

ENTRYPOINT ["/bin/sh","-c","entrypoint.sh"]
CMD ["/bin/sh","-c","cmd.sh"]
SHELL ["/bin/sh", "-c"]
CMD ["cmd.sh"]
4 changes: 2 additions & 2 deletions test/cmd.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env sh
set -eux

docker buildx build ./src --build-arg TARGETPLATFORM="${TARGETPLATFORM}" --tag pihole:${GIT_TAG} --no-cache
docker images pihole:${GIT_TAG}
docker buildx build ./src --build-arg TARGETPLATFORM="${TARGETPLATFORM}" --tag pihole:"${GIT_TAG}" --no-cache
docker images pihole:"${GIT_TAG}"

# auto-format the pytest code
python -m black ./test/tests/
Expand Down
1 change: 0 additions & 1 deletion test/entrypoint.sh

This file was deleted.

0 comments on commit 19c4a82

Please sign in to comment.