37 lines
1.2 KiB
Bash
Executable File
37 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
export RUDEFOX_REPO_BASE_URL="https://repo.rudefox.io"
|
|
export RUDEFOX_REPO_RELEASES="maven-releases"
|
|
export RUDEFOX_GROUP="io.rudefox"
|
|
export RUDEFOX_BURROW_ID="burrow"
|
|
export OUTFILE="burrow.tar"
|
|
|
|
|
|
export WGET_OPTS="--https-only -O ${OUTFILE} -v"
|
|
export WGET_URL="${RUDEFOX_REPO_BASE_URL}/service/rest/v1/search/assets/download?group=${RUDEFOX_GROUP}&name=${RUDEFOX_BURROW_ID}&maven.extension=tar"
|
|
|
|
|
|
if [ $RUDEFOX_BURROW_VERSION != "latest" ]
|
|
then
|
|
export WGET_URL="${WGET_URL}&maven.baseVersion=${RUDEFOX_BURROW_VERSION}"
|
|
else
|
|
export WGET_URL="${WGET_URL}&sort=version"
|
|
fi
|
|
|
|
|
|
if [ $RUDEFOX_REPO_USERNAME != "anonymous" ]
|
|
then
|
|
export ENCODED_USERNAME=$(echo -n $RUDEFOX_REPO_USERNAME | base64 | sed 's/+/-/g; s/\//_/g; s/=/%3D/g';)
|
|
export ENCODED_PASSWORD=$(echo -n $RUDEFOX_REPO_PASSWORD | base64 | sed 's/+/-/g; s/\//_/g; s/=/%3D/g';)
|
|
export POST_DATA="username=${ENCODED_USERNAME}&password=${ENCODED_PASSWORD}"
|
|
|
|
wget --save-cookies cookies.txt --keep-session-cookies --post-data $POST_DATA "${RUDEFOX_REPO_BASE_URL}/service/rapture/session"
|
|
|
|
wget --load-cookies cookies.txt $WGET_OPTS $WGET_URL
|
|
|
|
rm cookies.txt
|
|
else
|
|
wget $WGET_OPTS "${WGET_URL}&repository=${RUDEFOX_REPO_RELEASES}"
|
|
fi
|
|
|