2020-01-29 21:23:07 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
cmd="$1"
|
|
|
|
dir="$2"
|
|
|
|
|
|
|
|
if [ "$cmd" == "create" ]; then
|
2020-01-30 23:29:08 +00:00
|
|
|
debootstrap --include=systemd-container --include=racket --components=main,universe disco "$dir" http://archive.ubuntu.com/ubuntu/
|
|
|
|
systemd-nspawn -D "$dir" --bind "$PWD:/router" -- /bin/bash -c "cd /router && scripts/setup.sh"
|
2020-01-29 21:23:07 +00:00
|
|
|
elif [ "$cmd" == "boot" ]; then
|
2020-01-29 21:51:32 +00:00
|
|
|
systemd-nspawn -D "$dir" --bind "$PWD:/router" -- /bin/bash -c "cd /router && scripts/run-tests.sh /router/build"
|
2020-01-30 23:29:08 +00:00
|
|
|
elif [ "$cmd" == "test" ]; then
|
|
|
|
systemd-nspawn -D "$dir" --bind "$PWD:/router" -- /bin/bash -c "cd /router && bash"
|
2020-01-29 21:23:07 +00:00
|
|
|
fi
|