2014-05-14 03:52:46 +01:00
|
|
|
#!/bin/sh
|
2012-09-22 13:13:09 +01:00
|
|
|
|
|
|
|
#ec2-174-129-78-72.compute-1.amazonaws.com
|
|
|
|
#http://s3tools.org/s3cmd
|
|
|
|
|
2014-08-31 03:00:51 +01:00
|
|
|
# File issue on GitHub if download fails.
|
|
|
|
file_issue=true
|
|
|
|
|
2012-09-22 13:13:09 +01:00
|
|
|
cd ~/mxe && git pull
|
2014-08-31 03:00:51 +01:00
|
|
|
|
|
|
|
# Test downloading without falling back to S3 download server.
|
|
|
|
# All log is stored in tmp-download-log.
|
|
|
|
if ! ( \
|
|
|
|
cd ~/mxe && \
|
|
|
|
make download -k MXE_NO_BACKUP_DL=true MXE_VERBOSE=true \
|
|
|
|
2>&1 >tmp-download-log \
|
|
|
|
) && $file_issue; then
|
|
|
|
# If one or more download process fails, upload log to sprunge.us (a
|
|
|
|
# pastebin-like text storage service). Store the returned URL in tmp-url.
|
|
|
|
cat ~/mxe/tmp-download-log | curl -F 'sprunge=<-' http://sprunge.us \
|
|
|
|
>~/mxe/tmp-url
|
|
|
|
|
|
|
|
# Use a fake "editor" to format the issue
|
2014-08-31 03:15:16 +01:00
|
|
|
EDITOR=~/mxe/tools/fake-editor ghi open -- mxe/mxe
|
2014-08-31 03:00:51 +01:00
|
|
|
fi
|
|
|
|
|
2014-04-15 10:47:44 +01:00
|
|
|
cd ~/mxe && make clean-junk
|
2012-09-22 13:13:09 +01:00
|
|
|
s3cmd sync --acl-public ~/mxe/pkg/* s3://mxe-pkg/
|
2014-08-31 03:00:51 +01:00
|
|
|
rm -f ~/mxe/tmp-download-log ~/mxe/tmp-url
|