#!/bin/bash set -euf -o pipefail contents=( "README.md" "etc/legacy-wrappers/rzbackup-client" "etc/legacy-wrappers/rzbackup-convert" "etc/legacy-wrappers/rzbackup-decrypt" "etc/legacy-wrappers/rzbackup-restore" "etc/legacy-wrappers/rzbackup-server" "target/release/librzbackup.rlib" "target/release/rzbackup" ) version="$1" release=$(lsb_release --codename --short) package="rzbackup-$version-$release" target="ubuntu@kiara-dist.vpn.wellbehavedsoftware.com:dist/rzbackup" cargo build --release rm -rf "work/$package" mkdir -p "work/$package" for content in "${contents[@]}"; do cp "$content" "work/$package/$(basename $content)" done tar \ --create \ --xz \ --directory "work" \ --file "work/$package.tar.xz" \ "$package" scp \ "work/$package.tar.xz" \ "$target/$package.tar.xz" # ex: noet ts=4 filetype=sh