build-deb.sh 1005 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. DESTDIR=./dist
  3. VERSION=$(git describe --tag | sed 's/^v//')
  4. ITERATION=3
  5. NAME=scw-cap
  6. #DOCKER_IMAGE=registry.scw.systems/debian-build:latest
  7. DOCKER_IMAGE=debian-build:1.17-buster
  8. rm -rf $DESTDIR
  9. install -d $DESTDIR/{usr/bin,etc/systemd/system,etc/$NAME,usr/share/$NAME}
  10. make all-debian
  11. install -m 755 munchclient $DESTDIR/usr/bin/$NAME
  12. install -m 644 munchclient.toml $DESTDIR/etc/$NAME/$NAME.toml
  13. install -m 644 munchclient.toml $DESTDIR/usr/share/$NAME/$NAME.toml
  14. # install -m 644 munchclient.service $DESTDIR/etc/systemd/system/$NAME.service
  15. # install -m 644 ca-chain.cert.pem $DESTDIR/usr/share/$NAME/
  16. docker run -i -t --rm -v $PWD:/go/src/git.scraperwall.com/scw/munchclient -w /go/src/git.scraperwall.com/scw/munchclient $DOCKER_IMAGE \
  17. fpm -s dir -t deb -C $DESTDIR --name $NAME \
  18. --version $VERSION \
  19. --iteration $ITERATION \
  20. --deb-systemd $NAME.service \
  21. --description "ScraperWall Packet Capture" \
  22. --config-files /etc/$NAME/$NAME.toml \
  23. -p ./debian
  24. rm -rf $DESTDIR