mirror of
https://github.com/fsquillace/junest.git
synced 2026-01-23 02:34:30 +00:00
Fix deploy
This commit is contained in:
parent
2242585778
commit
d3f9f13ccd
2 changed files with 6 additions and 5 deletions
|
|
@ -87,4 +87,4 @@ after_success:
|
|||
#######################
|
||||
# Deploy and validation
|
||||
#######################
|
||||
- ./ci/deploy.sh ${PWD}/junest-x86_64.tar.gz
|
||||
- ./ci/deploy.sh ./junest-x86_64.tar.gz
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ set -e
|
|||
|
||||
IMG_PATH=$1
|
||||
|
||||
set -u
|
||||
set -ux
|
||||
|
||||
MAX_OLD_IMAGES=30
|
||||
|
||||
|
|
@ -31,14 +31,15 @@ then
|
|||
# Upload image
|
||||
# The put is done via a temporary filename in order to prevent outage on the
|
||||
# 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_PATH}.temp s3://junest-repo/junest/${IMG_PATH}
|
||||
aws s3api put-object-acl --acl public-read --bucket junest-repo --key junest/${IMG_PATH}
|
||||
aws s3 mv s3://junest-repo/junest/$img_name.temp s3://junest-repo/junest/$img_name
|
||||
aws s3api put-object-acl --acl public-read --bucket junest-repo --key junest/$img_name
|
||||
|
||||
DATE=$(date +'%Y-%m-%d-%H-%M-%S')
|
||||
|
||||
aws s3 cp ${IMG_PATH} s3://junest-repo/junest/${IMG_PATH}.${DATE}
|
||||
aws s3 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 {} s3 rm "s3://junest-repo/junest/{}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue