Skip to content
Snippets Groups Projects
Commit 154c2a2e authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Update download script to do the right things by default

parent f231a98f
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash
# DEFAULTS FOR INTEGRATION -- do not publish
if [ "$GITLAB_ACCESS_TOKEN" == "" ]
then
echo "ERROR: SET GITLAB_ACCESS_TOKEN in your environment"
exit -1
fi
PLATFORM=$1
USEREPO=$2
if [ "$PLATFORM" == "" ]
then
PLATFORM="l"
fi
if [ "$USEREPO" == "" ]
then
USEREPO="d"
fi
# Get platform parameter
# === LINUX ===
if [[ $1 == "l" ]] ||[[ $1 == "linux" ]] || [[ -z $1 ]]; then
if [[ $2 == "d" ]]; then
if [[ $PLATFORM == "l" ]] ||[[ $PLATFORM == "linux" ]] || [[ -z $PLATFORM ]]; then
if [[ $USEREPO == "d" ]]; then
BIN=".linux64?job=build"
else
BIN=".linux64"
......@@ -12,9 +32,9 @@ fi
echo "Platform set to Linux"
# === MACOS ===
elif [[ $1 == "m" ]] || [[ $1 == "mac" ]]; then
elif [[ $PLATFORM == "m" ]] || [[ $PLATFORM == "mac" ]]; then
if [[ $2 == "d" ]]; then
if [[ $USEREPO == "d" ]]; then
BIN=".darwin64?job=build"
else
BIN=".darwin64"
......@@ -22,13 +42,13 @@ fi
echo "Platform set to Mac"
else
echo "Invalid platform argument: $1"
echo "Invalid platform argument: $PLATFORM"
exit 0
fi
# Set up the URL for downloading the binaries
DEFAULTBRANCH=${DEFAULTBRANCH:="release"}
if [[ $2 == "d" ]]; then
if [[ $USEREPO == "d" ]]; then
REPOS_API=${REPOS_API:="https://gitlab.com/api/v4/projects/elixxir%2F"}
else
REPOS_API=${REPOS_API:="https://elixxir-bins.s3-us-west-1.amazonaws.com"}
......@@ -54,7 +74,7 @@ echo "(Note: if you forced a branch, that is checked first!)"
for BRANCH in $(echo "forcedbranch" $FBRANCH $FBRANCH2 $DEFAULTBRANCH); do
echo "Attempting downloads from: $BRANCH"
if [[ $2 == "d" ]]; then
if [[ $USEREPO == "d" ]]; then
BRANCH_URL=${BRANCH_URL:="jobs/artifacts/$BRANCH/raw/release"}
# Get URLs for artifacts from all relevant repos
UDB_URL=${UDB_URL:="${REPOS_API}user-discovery-bot/$BRANCH_URL/udb$BIN"}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment