Skip to content

Commit a772a9f

Browse files
committed
bash magic for conditional run
1 parent 8197382 commit a772a9f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

.github/workflows/docker-image-and-run.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
docker create --name extract-container my-image-name:latest
2424
2525
# Copy the binary from the container
26-
echo "a" > a
2726
docker run --rm -v $PWD:/data my-image-name:latest a 50
2827
2928
# Remove the container

.github/workflows/docker-image.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
docker create --name extract-container my-image-name:latest
2424
2525
# Copy the binary from the container
26-
mkdir -p ./output
2726
docker cp extract-container:/root/Mergen/build/lifter ./output/lifter
2827
2928
# Remove the container

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ RUN cmake .. ${TESTING:+-DMERGEN_TESTING=1} && cmake --build . -j $(nproc)
3535

3636
# Provide the built binary path as the default output for the container
3737
WORKDIR /root/Mergen/build
38-
ENTRYPOINT ["/root/Mergen/build/lifter"]
38+
39+
# bash magic
40+
ENTRYPOINT ["/bin/bash", "-c", "if [ \"$TESTING\" == \"true\" ]; then /root/Mergen/build/lifter; else cp /root/Mergen/build/lifter /output/lifter; fi"]

0 commit comments

Comments
 (0)