build-deb.sh 966 B

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