forked from ROM-builders/temporary
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.cirrus.yml
56 lines (56 loc) · 2.46 KB
/
.cirrus.yml
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
52
53
54
55
56
task:
name: Build
timeout_in: 4h
only_if: $CIRRUS_REPO_OWNER == 'ROM-builders'
persistent_worker:
isolation:
container:
image: apon77/aosp:ccache
cpu: 24
memory: 60g
volumes:
- /home/cirrus/roms:/home/ci/roms
- /home/cirrus/ccache:/home/ci/ccache
- /home/cirrus/.config:/home/ci/.config
env:
ROM_NAME: "grep init $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d / -f 4"
sync_script:
- set -exv
- mkdir -p ~/roms/$(bash -c "$ROM_NAME")
- cd ~/roms/$(bash -c "$ROM_NAME")
- rm -rf .repo/local_manifests
- find -name shallow.lock -delete
- command=$(head $CIRRUS_WORKING_DIR/build_rom.sh -n $(expr $(grep build/ $CIRRUS_WORKING_DIR/build_rom.sh -n | cut -f1 -d:) - 1))
- bash -c "$command"
build_script:
- set -exv
- cd ~/roms/$(bash -c "$ROM_NAME")
- device=$(grep unch $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d _ -f 2 | cut -d - -f 1)
- export CCACHE_DIR=/home/ci/ccache/$(bash -c "$ROM_NAME")/$device
- export CCACHE_EXEC=$(which ccache)
- export USE_CCACHE=1
- ccache -M 50G
- ccache -z
- command=$(tail $CIRRUS_WORKING_DIR/build_rom.sh -n +$(expr $(grep build/ $CIRRUS_WORKING_DIR/build_rom.sh -n | cut -f1 -d:) - 1)| head -n -1)
- bash -c "$command"
ccache_stats_script:
- set -exv
- device=$(grep unch $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d _ -f 2 | cut -d - -f 1)
- export CCACHE_DIR=/home/ci/ccache/$(bash -c "$ROM_NAME")/$device
- ccache -s
upload_script:
- set -exv
- cd ~/roms/$(bash -c "$ROM_NAME")
- device=$(grep unch $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d _ -f 2 | cut -d - -f 1)
- engzip=$(ls out/target/product/$(grep unch $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d _ -f 2 | cut -d - -f 1)/*eng*.zip || true )
- otazip=$(ls out/target/product/$(grep unch $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d _ -f 2 | cut -d - -f 1)/*ota*.zip || true )
- rm -rf $engzip $otazip
- dlink=$(basename out/target/product/$(grep unch $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d _ -f 2 | cut -d - -f 1)/*.zip)
- command=$(grep 'rclone copy' $CIRRUS_WORKING_DIR/build_rom.sh)
- bash -c "$command"
- echo "Downlod link https://roms.cirrus-ci.workers.dev/0:/$device/$dlink"
remove_script:
- set -exv
- cd ~/roms/$(bash -c "$ROM_NAME")
- device=$(grep unch $CIRRUS_WORKING_DIR/build_rom.sh -m 1 | cut -d _ -f 2 | cut -d - -f 1)
- rm -rf out/target/product/$device