Commit 6ad388fc authored by ∞'s avatar 💻

Cmd: auto switch to heredoc if bash detected

parent 0408590c
Pipeline #6329 passed with stage
in 2 minutes and 21 seconds
......@@ -8,6 +8,7 @@ from podctl.visitors import (
Base,
Copy,
Packages,
Run,
User,
)
......@@ -77,13 +78,14 @@ def test_build_copy():
)
'''
def test_build_files():
result = str(BuildScript(Container(
base='alpine',
files=[
Directory('/app', '0500').add('setup.py', 'podctl'),
]
)))
'''
def test_build_run():
script_test(
'build_run',
Base('alpine'),
Run('foo'),
Run('sudo bar'),
Run('sudo bar > test'),
Run('''
bar
'''),
)
#/usr/bin/env bash
base="alpine"
repo="None"
mounts=()
umounts() {
for i in "${mounts[@]}"; do
umount $i
mounts=("${mounts[@]/$i}")
done
buildah unmount $ctr
trap - 0
}
trap umounts 0
ctr=$(buildah from $base)
mnt=$(buildah mount $ctr)
echo "Run.build"
buildah run $ctr -- foo
echo "Run.build"
buildah run --user root $ctr -- bar
echo "Run.build"
buildah run --user root $ctr -- bash -eux <<__EOF
bar > test
__EOF
echo "Run.build"
buildah run $ctr -- bash -eux <<__EOF
bar
__EOF
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment