forked from Apon77/aosp-builder
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild
executable file
·24 lines (18 loc) · 1.1 KB
/
build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/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"
}
# My main build script. Move it to repo source
mv /tmp/ci/build2.sh /tmp/rom/
cd /tmp/rom # Depends on where source got synced.
# Give build script executable permission
chmod +x ./build2.sh
# Here, you must adjust the time in minutes. For my setup, repo sync takes between 8 to 11 mins. And you have to keep time to upload ccache or rom zip. ccache takes about 3 mins to upload and rom.zip takes less than 1 min. So 120 - (11 + 3 + 1) = 105 mins to allocate for build.
# NOTE: The first 2 true builds will be used to collect ccache. If your ccache is less than 5 GB, then you probably need 1 more run for ccache. Then for final build, you won't need to upload ccache. Therefore, you can reserve more time for the compilation process.
timeout --preserve-status 105m ./build2.sh
tg_sendText "Build completed!"
sleep 2s # Those sleep times are included to prevent interference issues when sending messages/files to bot.