-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#227 add script for building backend deb package
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/sh | ||
|
||
# deb constants | ||
version=1.0 | ||
revision=1 | ||
name=eak-backend | ||
architecture=amd64 | ||
maintainer="The Ehrenamtskarte Team <[email protected]>" | ||
description="Backend server for the Ehrenamtskarte app" | ||
|
||
fullname=${name}_${version}-${revision}_${architecture} | ||
debworkdir=build/$fullname | ||
debfile=build/${fullname}.deb | ||
ctrlfile=${debworkdir}/DEBIAN/control | ||
|
||
# build backend | ||
./gradlew build | ||
|
||
# init deb workdir | ||
mkdir -p $debworkdir | ||
rm -rf ${debworkdir}/* | ||
mkdir ${debworkdir}/DEBIAN | ||
touch $ctrlfile | ||
echo "Package: $name" >> $ctrlfile | ||
echo "Version: $version" >> $ctrlfile | ||
echo "Architecture: $architecture" >> $ctrlfile | ||
echo "Maintainer: $maintainer" >> $ctrlfile | ||
echo "Description: $description" >> $ctrlfile | ||
|
||
# copy files to deb workdir | ||
mkdir -p ${debworkdir}/var/ehrenamtskarte/backend | ||
tar -xf build/distributions/backend.tar -C ${debworkdir}/var/ehrenamtskarte | ||
|
||
# build the deb | ||
dpkg-deb --build --root-owner-group $debworkdir $debfile |