2021-01-21 02:12:04 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Use: ./build.bash
|
|
|
|
|
|
|
|
# Makes a release build of ptth_server and packages all necessary files
|
|
|
|
# such as images, Handlebars templates, etc.
|
|
|
|
|
|
|
|
# This script is version-specific. If you need to build an old version,
|
|
|
|
# check out that version from Git and call the old version of this
|
|
|
|
# script. This can be automated with `git archive`.
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
2021-01-29 01:12:52 +00:00
|
|
|
export LC_ALL="C"
|
|
|
|
|
2021-01-21 02:12:04 +00:00
|
|
|
TEMP_GIBBERISH="ptth_server_build_BIHWLQXQ"
|
|
|
|
DEST="$TEMP_GIBBERISH/ptth"
|
|
|
|
|
2021-10-01 17:50:24 +00:00
|
|
|
rm -rf "$TEMP_GIBBERISH"
|
|
|
|
|
2021-01-21 02:12:04 +00:00
|
|
|
mkdir "$TEMP_GIBBERISH"
|
|
|
|
mkdir "$DEST"
|
|
|
|
|
|
|
|
cargo build --release -p ptth_server
|
2021-10-01 17:50:24 +00:00
|
|
|
cargo build --release -p quic_demo --bin quic_demo_end_server
|
2021-01-21 02:12:04 +00:00
|
|
|
|
|
|
|
mkdir -p "$DEST/handlebars/server"
|
2021-02-01 00:06:22 +00:00
|
|
|
rsync -r handlebars/server/ "$DEST/handlebars/server/"
|
2021-01-21 02:12:04 +00:00
|
|
|
|
2021-10-01 17:50:24 +00:00
|
|
|
cp target/release/ptth_server "$DEST/"
|
|
|
|
cp target/release/quic_demo_end_server "$DEST/"
|
2021-01-28 23:39:59 +00:00
|
|
|
|
|
|
|
(
|
|
|
|
cd "$TEMP_GIBBERISH" || exit
|
2021-01-29 01:12:52 +00:00
|
|
|
|
|
|
|
find ptth/ -print0 | \
|
|
|
|
sort -z | \
|
|
|
|
tar --mtime='1970-01-01' --no-recursion --null -T - -cf - > \
|
|
|
|
ptth_server.tar.temp
|
|
|
|
|
|
|
|
mv ptth_server.tar.temp ptth_server.tar
|
2021-01-28 23:39:59 +00:00
|
|
|
)
|