main: update

This commit is contained in:
Dawid Dziurla 2020-03-26 00:28:59 +01:00 committed by GitHub
parent ee60daccc9
commit e9534ef5c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

18
main.sh
View file

@ -2,7 +2,7 @@
set -e
directory="${INPUT_DIRECTORY:-$PWD}"
directory="$PWD/${INPUT_DIRECTORY}"
os="${INPUT_OS:-"debian"}"
cd "$directory"
@ -11,14 +11,14 @@ package="$(dpkg-parsechangelog -S Source)"
version="$(dpkg-parsechangelog -S Version)"
distribution="$(dpkg-parsechangelog -S Distribution | sed 's/UNRELEASED/unstable/')"
container="builder"
container="$package_$version"
image="$os:$distribution"
workdir="/build/source"
docker create \
--tty \
--name "$container" \
--volume "$directory":"$workdir" \
--workdir "$workdir" \
--volume "$directory":"$directory" \
--workdir "$directory" \
"$image" \
sleep inf
@ -26,23 +26,17 @@ docker start \
"$container"
docker exec \
--tty \
"$container" \
apt-get update
docker exec \
--tty \
"$container" \
apt-get install -y dpkg-dev debhelper
docker exec \
--tty \
--workdir "$workdir" \
"$container" \
apt-get build-dep "$workdir"
apt-get build-dep "$directory"
docker exec \
--tty \
--workdir "$workdir" \
"$container" \
dpkg-buildpackage -S -us -uc