forked from waja/action-debian-package
main: update
- exit if any variable is undefined - hopefully resolve the issue with directory mounting
This commit is contained in:
parent
9e6ff7644d
commit
ae0c8188ee
15
main.sh
15
main.sh
|
@ -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" \
|
||||||
|
|
Loading…
Reference in a new issue