Skip to content

Commit 75b1773

Browse files
committed
chore: test heredoc syntax support
1 parent f218b03 commit 75b1773

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM debian:latest
2+
ARG DEBUG
3+
SHELL ["/bin/bash", "-lc"]
4+
# Heredoc with preserved indentation and continuations
5+
RUN <<'EOF'
6+
[ -z "$DEBUG" ] || set -ex && set -e
7+
if command -v something; then
8+
something \
9+
--arg1 test1 \
10+
--arg2 test2
11+
else
12+
echo "something not found"
13+
fi
14+
EOF

test/features.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,9 @@ describe("COPY", () => {
4040
await testFixture("copyFromStage")
4141
})
4242
})
43+
44+
describe("HEREDOC", () => {
45+
it("heredoc", async () => {
46+
await testFixture("heredoc")
47+
})
48+
})

test/fixtures/heredoc.dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# syntax = devthefuture/dockerfile-x:1.4.3
2+
FROM debian:latest
3+
ARG DEBUG
4+
SHELL ["/bin/bash", "-lc"]
5+
6+
# Heredoc with preserved indentation and continuations
7+
RUN <<'EOF'
8+
[ -z "$DEBUG" ] || set -ex && set -e
9+
if command -v something; then
10+
something \
11+
--arg1 test1 \
12+
--arg2 test2
13+
else
14+
echo "something not found"
15+
fi
16+
EOF

0 commit comments

Comments
 (0)