build.sh 591 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. # -*- coding: utf-8 -*-
  3. basedir="$(realpath "$0" | xargs dirname)"
  4. die()
  5. {
  6. echo "=== ERROR: $*" >&2
  7. exit 1
  8. }
  9. [ -f "$basedir/Cargo.toml" ] || die "basedir sanity check failed"
  10. cd "$basedir" || die "cd basedir failed."
  11. export FEEDREADER_PREFIX="/opt/feedreader"
  12. cargo build || die "Cargo build (debug) failed."
  13. cargo test || die "Cargo test failed."
  14. cargo auditable build --release || die "Cargo build (release) failed."
  15. cargo audit --deny warnings bin \
  16. target/release/feeds \
  17. target/release/feedsd \
  18. || die "Cargo audit failed."
  19. # vim: ts=4 sw=4 expandtab