blob: e7234029b0d68cdbf76ccfb80ba750d2caa2f12f [file] [log] [blame]
Alex Buynytskyy0842d212022-09-16 09:33:33 -07001#!/bin/bash
2# Automation for finalize_branch_for_release.sh.
3# Sets up local environment, runs the finalization script and submits the results.
4# WIP:
5# - does not submit, only sends to gerrit.
6
7# set -ex
8
9function revert_local_changes() {
10 repo forall -c '\
11 git checkout . ; git clean -fdx ;\
12 git checkout @ ; git b fina-step1 -D ; git reset --hard; \
13 repo start fina-step1 ; git checkout @ ; git b fina-step1 -D ;\
14 previousHash="$(git log --format=%H --no-merges --max-count=1 --grep ^FINALIZATION_STEP_1_SCRIPT_COMMIT)" ;\
15 if [[ $previousHash ]]; then git revert --no-commit $previousHash ; fi ;'
16}
17
18function finalize_step_1_main() {
19 local top="$(dirname "$0")"/../..
20
21 repo selfupdate
22
23 revert_local_changes
24
25 # vndk etc finalization
Alex Buynytskyy3bd1b912022-09-22 11:30:53 -070026 source $top/build/make/finalize-aidl-vndk-sdk-resources.sh
Alex Buynytskyy0842d212022-09-16 09:33:33 -070027
28 # move all changes to fina-step1 branch and commit with a robot message
29 repo forall -c 'if [[ $(git status --short) ]]; then repo start fina-step1 ; git add -A . ; git commit -m FINALIZATION_STEP_1_SCRIPT_COMMIT -m WILL_BE_AUTOMATICALLY_REVERTED ; repo upload --cbr --no-verify -t -y . ; fi'
30}
31
32finalize_step_1_main