forked from langw4y/BuildBot-Rom
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupload_out
More file actions
30 lines (21 loc) · 764 Bytes
/
upload_out
File metadata and controls
30 lines (21 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
function tg_sendText() {
curl -s "https://api.telegram.org/bot$BOT_TOKEN/sendMessage" \
-d "parse_mode=html" \
-d text="${1}" \
-d chat_id=$CHAT_ID \
-d "disable_web_page_preview=true"
}
CCACHE_FILE="$CIRRUS_BRANCH""_out.tar.gz"
cd /tmp/rom
tg_sendText "Uploading $CCACHE_FILE to Drive.."
# Compress function with pigz for faster compression
com ()
{
tar --use-compress-program="pigz -k -$2 " -cf $1.tar.gz $1
}
time com out 1 # Compression level 1, its enough
# Rename file before uploading
mv out.tar.gz $CCACHE_FILE
time rclone copy $CCACHE_FILE aosp: -P # aosp is my rclone config name (first line without [] of ~/.config/rclone/rclone.conf file from rclone setup done on pc)
tg_sendText "Sucessfully uploaded out folder to Drive.."