forked from rokibhasansagar/builder_demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathccashier.sh
More file actions
executable file
·26 lines (21 loc) · 837 Bytes
/
ccashier.sh
File metadata and controls
executable file
·26 lines (21 loc) · 837 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
#!/bin/bash
ccache_task="${1}" # upload/download
CCache_URL="https://gdrive.phantomzone.workers.dev/0:/mido_ccache/ccache.tgz"
mkdir -p /home/runner/.cache/ccache /home/runner/.config/rclone
cd /home/runner/.cache/
if [[ ${ccache_task} =~ upload ]]; then
printf "Compressing ccache data...\n"
tar -I "pigz -k -3" -cf ccache.tgz ccache
du -sh ccache.tgz
printf "Setting up rclone and uploading...\n"
echo "${RClone_Config}" > /home/runner/.config/rclone/rclone.conf
rclone delete td:/mido_ccache/ccache.tgz 2>/dev/null || true
rclone copy ccache.tgz td:/mido_ccache/ --progress
rm -rf ccache.tgz
elif [[ ${ccache_task} =~ download ]]; then
printf "Downloading previous ccache...\n"
aria2c -c -x8 -s16 "${CCache_URL}"
printf "Expanding ccache files...\n"
tar -I "pigz" -xf ccache.tgz
rm -rf ccache.tgz
fi