38 lines
874 B
Bash
Executable File
38 lines
874 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"
|
|
|
|
mkdir "$TEMP_GIBBERISH"
|
|
mkdir "$DEST"
|
|
|
|
cargo build --release -p ptth_server
|
|
|
|
mkdir -p "$DEST/handlebars/server"
|
|
rsync -r handlebars/server/ "$DEST/handlebars/server/"
|
|
|
|
cp target/release/ptth_server "$DEST/ptth_server"
|
|
|
|
(
|
|
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
|
|
)
|