-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_deb_pkg.sh
executable file
·28 lines (22 loc) · 1.02 KB
/
create_deb_pkg.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
FILE="$1"
ARCH="$2"
VERSION="$3"
CONTROL="build/deb/${FILE}_${VERSION}-${ARCH}/DEBIAN/control"
BINDIR="build/deb/${FILE}_${VERSION}-${ARCH}/usr/local/bin"
mkdir -p build/deb/${FILE}_${VERSION}-${ARCH}/usr/local/bin
mkdir -p build/deb/${FILE}_${VERSION}-${ARCH}/DEBIAN
cp $FILE $BINDIR
echo "Package: kmsdecryptenv" > $CONTROL
echo "Version: 1.0.0-1" >> $CONTROL
echo "Section: base" >> $CONTROL
echo "Priority: optional" >> $CONTROL
echo "Architecture: $ARCH" >> $CONTROL
echo "Maintainer: Anders Wallin <[email protected]>" >> $CONTROL
echo "Description: KMS Decrypt ENV" >> $CONTROL
echo " Decrypts all or specific ENV variables using AWS KMS." >> $CONTROL
echo " It run all calls concurrently so decrypting 100s or keys" >> $CONTROL
echo " usally takes less than a couple of 100 ms." >> $CONTROL
docker run -v $(pwd)/build:/build -w /build ubuntu:16.04 dpkg-deb --build /build/deb/${FILE}_${VERSION}-${ARCH}
mv build/deb/${FILE}_${VERSION}-${ARCH}.deb build/${FILE}_${VERSION}-${ARCH}.deb
rm -rf build/deb