ptth/build_ptth_server.bash

37 lines
820 B
Bash
Executable File

#!/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
export LC_ALL="C"
TEMP_GIBBERISH="ptth_server_build_BIHWLQXQ"
DEST="$TEMP_GIBBERISH/ptth"
rm -rf "$TEMP_GIBBERISH"
mkdir "$TEMP_GIBBERISH"
mkdir "$DEST"
cargo build --release -p ptth_multi_call_server
cp target/release/ptth_multi_call_server "$DEST/"
(
cd "$TEMP_GIBBERISH" || exit
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
)