Add a script to allow more users to easily upload artifacts
This makes it so that anyone with access to buildkite can upload an
artifact to the build server. Existing protections entail:
1. Doesn't allow users to run this against anything other than the
master branch.
2. Does not allow overwriting existing files.
3. Does not touch files outside of the
/data/files/frc971/Build-Dependencies/ directory.
Certainly no riskier than our regular CI at this stage.
This does cause a surprising amount of disk usage on the software971
server, due to bazel it extracting the amd64 toolchains.
Steps required to get this set up were:
1. Install the buildkite-agent apt package.
2. Configure the token in /buildkite/buildkite-agent.cfg, and set
queue=deploy.
3. Start the buildkite-agent service.
4. Add the buildkite-agent user to the www-data group.
5. Add a new gerrit public key for the buildkite user corresponding to
the new agent.
6. Set up the https://buildkite.com/spartan-robotics/deploy-artifact
pipeline.
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
Change-Id: I89416d23e8d75102314c7aa1dbe8b9fd64f4f762
diff --git a/tools/rehosting/rehost.sh b/tools/rehosting/rehost.sh
new file mode 100755
index 0000000..445d05e
--- /dev/null
+++ b/tools/rehosting/rehost.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+tools/bazel run //tools/rehosting:rehost -- "$(buildkite-agent meta-data get dependency-url)"