ptth/build_ptth_server.bash

30 lines
728 B
Bash
Raw Normal View History

#!/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
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 -rv handlebars/server/ "$DEST/handlebars/server/"
cp target/release/ptth_server "$DEST/ptth_server"
(
cd "$TEMP_GIBBERISH" || exit
tar -cf "ptth_server.tar" ptth/
)