Skip to content

Commit edaec48

Browse files
committed
chore: test preserving build instructions (in #27, #28)
1 parent 2d14dd9 commit edaec48

File tree

5 files changed

+92
-0
lines changed

5 files changed

+92
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# See: https://codeberg.org/devthefuture/dockerfile-x/issues/28
2+
FROM debian:latest
3+
ARG DEBUG
4+
RUN <<'EOF'
5+
DEBIAN_FRONTEND=noninteractive \
6+
DEBCONF_NOWARNINGS=yes \
7+
APT_LISTCHANGES_FRONTEND=none \
8+
apt-get update
9+
EOF
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# See: https://codeberg.org/devthefuture/dockerfile-x/issues/27
2+
FROM debian:latest
3+
ARG DEBUG
4+
RUN <<'EOF'
5+
[ -z "$DEBUG" ] || set -ex && set -e
6+
if command -v something; then
7+
something \
8+
--arg1 test1 \
9+
--arg2 test2
10+
else
11+
echo "something not found"
12+
fi
13+
EOF
14+
RUN [ -x "/hogehoge" ] \
15+
&& echo "OK" \
16+
|| true
17+
ARG DEBUG1
18+
ENV DEBUG2=1 DEBUG3=2 DEBUG4=3 \
19+
TEST1=1 TEST2=2 TEST3=3 \
20+
TIMEZONE=Asia/Tokyo
21+
RUN <<TEST
22+
[ -z "$DEBUG" ] || set -ex && set -e
23+
if command -v something; then
24+
something \
25+
--arg1 test1 \
26+
--arg2 test2
27+
else
28+
echo "something not found"
29+
fi
30+
TEST

test/fixs.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@ describe("issues", () => {
1616
it("include-target", async () => {
1717
await testFixture("issue1")
1818
})
19+
it("preserve-instructions", async () => {
20+
await testFixture("issue27")
21+
})
22+
it("preserve-environment-variables", async () => {
23+
await testFixture("issue28")
24+
})
1925
})

test/fixtures/issue27.dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# syntax=devthefuture/dockerfile-x
2+
# See: https://codeberg.org/devthefuture/dockerfile-x/issues/27
3+
FROM debian:latest
4+
ARG DEBUG
5+
6+
RUN <<'EOF'
7+
[ -z "$DEBUG" ] || set -ex && set -e
8+
if command -v something; then
9+
something \
10+
--arg1 test1 \
11+
--arg2 test2
12+
else
13+
echo "something not found"
14+
fi
15+
EOF
16+
17+
RUN [ -x "/hogehoge" ] \
18+
&& echo "OK" \
19+
|| true
20+
21+
ARG DEBUG1
22+
23+
ENV DEBUG2=1 DEBUG3=2 DEBUG4=3 \
24+
TEST1=1 TEST2=2 TEST3=3 \
25+
TIMEZONE=Asia/Tokyo
26+
27+
RUN <<TEST
28+
[ -z "$DEBUG" ] || set -ex && set -e
29+
if command -v something; then
30+
something \
31+
--arg1 test1 \
32+
--arg2 test2
33+
else
34+
echo "something not found"
35+
fi
36+
TEST

test/fixtures/issue28.dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# syntax=devthefuture/dockerfile-x
2+
# See: https://codeberg.org/devthefuture/dockerfile-x/issues/28
3+
FROM debian:latest
4+
ARG DEBUG
5+
6+
RUN <<'EOF'
7+
DEBIAN_FRONTEND=noninteractive \
8+
DEBCONF_NOWARNINGS=yes \
9+
APT_LISTCHANGES_FRONTEND=none \
10+
apt-get update
11+
EOF

0 commit comments

Comments
 (0)