blob: 3031abae11e85fc8fc02738a8c4390c1311aaed7 [file] [log] [blame]
Austin Schuhc26a2902022-01-14 16:34:25 -08001#!/bin/bash
2#
3# This script makes it easy to rehost dependencies on software.frc971.org so
4# we are self hosted everywhere consistently.
5
6# ./rehost.sh github.com/bazelbuild/rules_nodejs/releases/download/4.4.6/rules_nodejs-4.4.6.tar.gz
7
8readonly LOCALPATH="$(basename "${1}")"
9
Brian Silverman6088e2b2022-02-02 02:01:12 -080010if echo "${1}" | grep --quiet http; then
11 echo "Argument must not include the scheme (remove the https://)" >&2
12 exit 1
13fi
14
Austin Schuhc26a2902022-01-14 16:34:25 -080015set -e
16curl -L "https://${1}" -o "${LOCALPATH}"
17
18echo "https://software.frc971.org/Build-Dependencies/${1}"
19
20ssh software.frc971.org mkdir -p "$(dirname "/data/files/frc971/Build-Dependencies/${1}")"
21rsync --progress -v --ignore-existing "${LOCALPATH}" software.frc971.org:"/data/files/frc971/Build-Dependencies/${1}"