twrp-automation: Initial Commit

This commit is contained in:
Evan Ferrao 2021-09-01 18:25:47 +05:30
commit 1027be9984
3 changed files with 80 additions and 0 deletions

10
.drone.yml Normal file
View File

@ -0,0 +1,10 @@
kind: pipeline
name: default
steps:
- name: twrp-automation
image: mrkhan007/aosp:latest
commands:
- sudo apt update -y && sudo apt install wget -y
- bash sync
- bash build

41
build Normal file
View File

@ -0,0 +1,41 @@
#
#
#
#
#
#
#
#
#
#
#
cd /tmp/rec
rm -rf .repo
source build/envsetup.sh
lunch $TREE_TYPE_$DEVICE_CODENAME-eng #edit this
export SKIP_API_CHECKS=true ##use additional flags if you need(optional)
export SKIP_ABI_CHECKS=true ##use additional flags if you need(optional)
export ALLOW_MISSING_DEPENDENCIES=true ##use additional flags if you need(optional)
#necessary flags
export CCACHE_DIR=/tmp/ccache
export CCACHE_EXEC=$(which ccache)
export USE_CCACHE=1
ccache -M 40G
#ccache -o compression=true
ccache -z
ccache -c
DATE=$(date +%Y%m%d)
mka recoveryimage
mkdir temporary
cp -R out/target/product/$DEVICE_CODENAME temporary/$DEVICE_CODENAME
cd temporary/$DEVICE_CODENAME
mv recovery.img "$DEVICE_CODENAME"_TWRP_"$DATE"_recovery.img
cd -
echo "
"
curl --upload-file ./temporary/$DEVICE_CODENAME/"$DEVICE_CODENAME"_TWRP_"$DATE"_recovery.img https://transfer.sh/ #edit this
echo "
"

29
sync Normal file
View File

@ -0,0 +1,29 @@
#
#
#
#
#
#
#
#
#
#
#
mkdir -p /tmp/rec
cd /tmp/rec
# Repo init command, that -device,-mips,-darwin,-notdefault part will save you more time and storage to sync, add more according to your rom and choice.Optimization is welcomed! Let's make it quit, and with depth=1 so that no unnecessary things.
repo init --no-repo-verify --depth=1 -u "$MANIFEST" -b "$BRANCH" -g default,-device,-mips,-darwin,-notdefault
git config --global user.name "Box In A Box"
git config --global user.email "evanferrao@gmail.com"
# Sync source with -q, no need unnecessary messages, you can remove -q if want! try with -j30 first, if fails, it will try again with -j8
repo sync -c --no-clone-bundle --no-tags --optimized-fetch --prune --force-sync -j$(nproc --all) || repo sync -c --no-clone-bundle --no-tags --optimized-fetch --prune --force-sync -j8
pwd
ls
#delete these lines, and replace with your own lines of device sauce
git clone $TWRP_TREE $DEVICE_PATH
cd /tmp/rec