build.sh 722 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. # -*- coding: utf-8 -*-
  3. basedir="$(realpath "$0" | xargs dirname)"
  4. info()
  5. {
  6. echo "--- $*"
  7. }
  8. error()
  9. {
  10. echo "=== ERROR: $*" >&2
  11. }
  12. warning()
  13. {
  14. echo "=== WARNING: $*" >&2
  15. }
  16. die()
  17. {
  18. error "$*"
  19. exit 1
  20. }
  21. [ -f "$basedir/Cargo.toml" ] ||\
  22. die "basedir sanity check failed"
  23. cd "$basedir" || die "cd basedir failed."
  24. cargo build || die "Cargo build (debug) failed."
  25. cargo test || die "Cargo test failed."
  26. cargo auditable build --release || die "Cargo build (release) failed."
  27. cargo audit --deny warnings bin \
  28. target/release/cms-backd \
  29. target/release/cms-cgi \
  30. target/release/cms-fsd \
  31. target/release/cms-postd \
  32. || die "Cargo audit failed."
  33. # vim: ts=4 sw=4 expandtab