#!/bin/env bash # Source: https://stackoverflow.com/a/4774063 PROJECT_ROOT="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/.." RESTIC_VERSION=tags/v0.16.2 # Checkout correct version (cd "$PROJECT_ROOT/vendor/restic" && git checkout $RESTIC_VERSION) echo "Building restic binary for local usage ..." (cd "$PROJECT_ROOT/vendor/restic" && go run build.go) echo "Building restic binary for ARM architecture ..." (cd "$PROJECT_ROOT/vendor/restic" && \ go run build.go --goos linux --goarch arm \ --output "$PROJECT_ROOT/roles/backup/files/restic-arm64") echo "Done with work"