1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-05 19:20:25 +00:00
qb64/.ci/deploy.sh

17 lines
635 B
Bash
Raw Normal View History

2020-01-04 13:40:05 +00:00
#!/bin/bash
2020-01-06 07:40:15 +00:00
OS=$1
2020-01-04 13:40:05 +00:00
TZ=UTC now=`date +"%F-%H-%M-%S"`
2021-02-03 12:31:10 +00:00
BUCKET=qb64-development-builds
2021-02-01 09:47:45 +00:00
filename="/tmp/qb64_${now}_`echo ${GITHUB_SHA} | sed 's/\(.......\).*$/\1/'`_${OS}.tar.gz"
2020-01-04 13:40:05 +00:00
cd ..
2020-01-06 07:40:15 +00:00
tar --create --auto-compress --file ${filename} --exclude-from=qb64/.ci/common-exclusion.list --exclude-from=qb64/.ci/$OS-exclusion.list qb64
2020-01-04 13:40:05 +00:00
2021-02-01 09:47:45 +00:00
current_files=$(aws --output text --query 'Contents[].Key' s3api list-objects --bucket ${BUCKET} --prefix ${OS})
aws s3 cp ${filename} s3://${BUCKET}/${OS}/
2021-02-03 12:31:10 +00:00
echo -n $(basename "${filename}") > latest.txt
aws s3 cp latest.txt s3://${BUCKET}/${OS}/
2021-02-01 09:58:41 +00:00
for f in $current_files; do
2021-02-01 09:47:45 +00:00
aws s3 rm s3://${BUCKET}/$f
2020-01-04 13:40:05 +00:00
done