create-pull-request/__test__/integration-tests.sh
ahuston-0 6b3a86bf8b
Some checks failed
CI / build (push) Failing after 45s
CI / test (built) (push) Has been skipped
CI / test (committed) (push) Has been skipped
CI / commentTestSuiteHelp (push) Has been skipped
CI / package (push) Has been skipped
Rebase Upstream / sync (push) Failing after 8s
CI
Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
2025-02-01 16:27:43 -05:00

25 lines
548 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
set -xv
IMAGE="cpr-integration-tests:latest"
ARG1=${1:-}
if [[ "$(docker images -q $IMAGE 2> /dev/null)" == "" || $ARG1 == "build" ]]; then
echo "Building Docker image $IMAGE ..."
cat > Dockerfile << EOF
FROM node:20-alpine
RUN apk --no-cache add git git-daemon
RUN npm install jest jest-environment-jsdom --global
WORKDIR /cpr
COPY __test__/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
EOF
docker build --no-cache -t $IMAGE .
rm Dockerfile
fi
docker run -v $PWD:/cpr $IMAGE