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