-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathupload_ccache
More file actions
51 lines (38 loc) · 1.49 KB
/
upload_ccache
File metadata and controls
51 lines (38 loc) · 1.49 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
cd /tmp
. /tmp/ci/function
# Abort if already executed
if [ ! -e /tmp/abort.txt ]; then
# compress in with pigz in a single zip.
com ccache 0
echo "• Uploading Cache On Gdrive •"
upload_ccache ccache.tar.gz
tg "Cache was Uploaded Successfully!
Time Took: $(($SECONDS / 60)) minute(s) and $(($SECONDS % 60)) second(s).
Status: $progress | cache zip: $url"
rom_zip=`ls /tmp/rom/out/target/product/*/*.zip`
if [ -z $rom_zip ]; then
# update build type for next build
build_type="`cat /tmp/build_type.txt`"
# lets compile again as rom isn't ready yet
git clone -b $CIRRUS_BRANCH $github_repo $rom_name && cd $rom_name
if [ -e "/tmp/rom/build.log" ] && [ $(tail -n 50 /tmp/rom/build.log | grep -o -e ' 99% ' -e ' 98% ' -e ' 97% ' -e ' 96% ' -e ' 95% ' -e ' 94% ' -e ' 93% ' -e ' 92% ' -e ' 91% ' -e ' 90% ' | head -n 1) ]; then
git commit -sm "SH*T, HERE WE GO AGAIN | R" --allow-empty
else
git commit -sm "SH*T, HERE WE GO AGAIN | $build_type" --allow-empty
fi
git push -f
else
# drop empty commits
git clone -b $CIRRUS_BRANCH $github_repo $rom_name && cd $rom_name
git filter-branch --commit-filter 'git_commit_non_empty_tree "$@"' -f HEAD
git commit -sm "ci: $rom_name compiled successfully [skip ci]" -m "* now you can have successfull build on just one commit
* make sure to put R letter at the end of commit messages
* lik git commit -m your_msg R" --allow-empty
git push -f
fi
echo "dont upload cache again" > /tmp/abort.txt
fi
# clean storage except ci files
rm -rf /tmp/rom
rm -rf /tmp/cache