From 090629b8379959fe551dca7cc791cadb50bcd852 Mon Sep 17 00:00:00 2001 From: Filippo Squillace Date: Sat, 15 Oct 2022 12:20:44 +0200 Subject: [PATCH] Change url --- .travis.yml | 5 ----- ci/deploy.sh | 14 ++++++++------ lib/core/common.sh | 4 ++-- lib/core/setup.sh | 2 +- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2ad29e8..b819cbf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,11 +40,6 @@ archlinux: env: matrix: - TRAVIS_BASH_VERSION="4.0" - global: - # AWS_ACCESS_KEY_ID - - secure: "ZotyKKWH5ZrBXDdEnVmV22gbn86BBSiqDZn2d2jVAApgUQdDc3wa7/uYAZP1bts6oQ897nnkUSFHk3M3QAcIoPJerUITTU5D7yjKcFDejgHdpJ4t9XSajmpY9CgKftWapwliWG4wolAKwyAp5GnYqz4GGltHyGxbF/VzUNRF3lw=" - # AWS_SECRET_ACCESS_KEY - - secure: "AWixvJmhr6+rfF4cspMWMjkvLuOsdfNanLK5wrqkgx/0ezDGBBThH0qVhn5Mp1QFM6wVF+LRA6UESNnj0wNwByZHdM6LddkJWlWHb/qkVK+AO4RKUsXJWNyPyOkCNj/WEFpZHQKKUAlEtC8m8AmAcuoi90cr6ih0PXIePRyPFrM=" before_install: - ./ci/install-bash.sh "$TRAVIS_BASH_VERSION" diff --git a/ci/deploy.sh b/ci/deploy.sh index b3ba92c..9808f0f 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -6,7 +6,8 @@ IMG_PATH=$1 set -ux -MAX_OLD_IMAGES=30 +MAX_OLD_IMAGES=3 +ENDPOINT="https://gateway.storjshare.io" # ARCH can be one of: x86, x86_64, arm HOST_ARCH=$(uname -m) @@ -24,7 +25,8 @@ else exit 11 fi -if [[ "$TRAVIS_BRANCH" == "master" ]] +# TODO change branch here +if [[ "$TRAVIS_BRANCH" == "storj" ]] then export AWS_DEFAULT_REGION=eu-west-1 @@ -33,15 +35,15 @@ then # production file for a longer period of time. img_name=$(basename "${IMG_PATH}") cp "${IMG_PATH}" "${IMG_PATH}".temp - aws s3 cp "${IMG_PATH}".temp s3://junest-repo/junest/ - aws s3 mv s3://junest-repo/junest/"$img_name".temp s3://junest-repo/junest/"$img_name" + aws s3 --endpoint-url="$ENDPOINT" cp "${IMG_PATH}".temp s3://junest-repo/junest/ + aws s3 --endpoint-url="$ENDPOINT" mv s3://junest-repo/junest/"$img_name".temp s3://junest-repo/junest/"$img_name" DATE=$(date +'%Y-%m-%d-%H-%M-%S') - aws s3 cp "s3://junest-repo/junest/$img_name" "s3://junest-repo/junest/${img_name}.${DATE}" + aws s3 --endpoint-url="$ENDPOINT" cp "s3://junest-repo/junest/$img_name" "s3://junest-repo/junest/${img_name}.${DATE}" # Cleanup old images - aws s3 ls s3://junest-repo/junest/junest-${ARCH}.tar.gz. | awk '{print $4}' | head -n -${MAX_OLD_IMAGES} | xargs -I {} aws s3 rm "s3://junest-repo/junest/{}" + aws s3 --endpoint-url="$ENDPOINT" ls s3://junest-repo/junest/junest-${ARCH}.tar.gz. | awk '{print $4}' | head -n -${MAX_OLD_IMAGES} | xargs -I {} aws s3 rm "s3://junest-repo/junest/{}" # Test the newly deployed image can be downloaded correctly junest setup diff --git a/lib/core/common.sh b/lib/core/common.sh index a75aff9..0362d69 100644 --- a/lib/core/common.sh +++ b/lib/core/common.sh @@ -53,7 +53,7 @@ else die "Unknown architecture ${HOST_ARCH}" fi -MAIN_REPO=https://dwa8bhj1f036z.cloudfront.net +MAIN_REPO=https://link.storjshare.io/s/jvb5tgarnjtt565fffa44spvyuga/junest-repo ENV_REPO=${MAIN_REPO}/${CMD} # shellcheck disable=SC2016 DEFAULT_MIRROR='https://mirror.rackspace.com/archlinux/$repo/os/$arch' @@ -74,7 +74,7 @@ BWRAP="${JUNEST_HOME}/usr/bin/bwrap" PROOT="${JUNEST_HOME}/usr/bin/proot-${ARCH}" GROOT="${JUNEST_HOME}/usr/bin/groot" CLASSIC_CHROOT=chroot -WGET="wget --no-check-certificate" +WGET="wget --content-disposition --no-check-certificate" CURL="curl -L -J -O -k" TAR="tar" CHOWN="chown" diff --git a/lib/core/setup.sh b/lib/core/setup.sh index 749fd66..7138fc4 100644 --- a/lib/core/setup.sh +++ b/lib/core/setup.sh @@ -95,7 +95,7 @@ function setup_env(){ info "Downloading ${NAME}..." builtin cd "${maindir}" || return 1 local imagefile=${CMD}-${arch}.tar.gz - download_cmd "${ENV_REPO}/${imagefile}" + download_cmd "${ENV_REPO}/${imagefile}?download=1" info "Installing ${NAME}..." _setup_env "${maindir}/${imagefile}"