#!/usr/bin/env bash

# This should be copied into the Bamboo task to download the latest pipedream
# proxy code and execute it without cloning the entire repository first.
#
# NOTE: The pipedream_proxy plan argument needs to be updated before running
# this.

set -euo pipefail

# As of 2019-07-12, this Bamboo global variable is set to:
# eval curl --fail --silent --show-error --retry 5 https://artifactory.zooxlabs.com/artifactory/pipedream-generic/pipedream_proxy || curl --fail --silent --show-error --retry 5 https://pipedream_proxy.zooxlabs.com/pipedream_proxy
$bamboo_pipedream_proxy_download_command > pipedream_proxy

chmod +x pipedream_proxy

# WARNING: Replace "$plan_name" with the name of the test plan to run e.g.
# cpu, gpu_build, deploy.
./pipedream_proxy --plan "$plan_name"
