main: update

- exit if any variable is undefined
- hopefully resolve the issue with directory mounting
This commit is contained in:
Dawid Dziurla 2020-03-26 00:58:10 +01:00 committed by GitHub
parent 9e6ff7644d
commit ae0c8188ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

15
main.sh
View file

@ -1,11 +1,14 @@
#!/bin/sh
set -e
set -eu
directory="$PWD/${INPUT_DIRECTORY}"
directory="${INPUT_DIRECTORY:-}"
os="${INPUT_OS:-"debian"}"
cd "$directory"
directory_runner="$RUNNER_WORKSPACE/$directory"
directory_container="$GITHUB_WORKSPACE/$directory"
cd "$directory_container"
package="$(dpkg-parsechangelog -S Source)"
version="$(dpkg-parsechangelog -S Version)"
@ -17,8 +20,8 @@ image="$os:$distribution"
docker create \
--tty \
--name "$container" \
--volume "$directory":"$directory" \
--workdir "$directory" \
--volume "$directory_runner":"$directory_container" \
--workdir "$directory_container" \
"$image" \
sleep inf
@ -40,7 +43,7 @@ docker exec \
docker exec \
"$container" \
apt-get build-dep ./
apt-get build-dep "$directory_container"
docker exec \
"$container" \