Alex Buynytskyy | 0842d21 | 2022-09-16 09:33:33 -0700 | [diff] [blame] | 1 | #!/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 | |
| 9 | function 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 | |
| 18 | function finalize_step_1_main() { |
| 19 | local top="$(dirname "$0")"/../.. |
| 20 | |
| 21 | repo selfupdate |
| 22 | |
| 23 | revert_local_changes |
| 24 | |
| 25 | # vndk etc finalization |
Alex Buynytskyy | 3bd1b91 | 2022-09-22 11:30:53 -0700 | [diff] [blame^] | 26 | source $top/build/make/finalize-aidl-vndk-sdk-resources.sh |
Alex Buynytskyy | 0842d21 | 2022-09-16 09:33:33 -0700 | [diff] [blame] | 27 | |
| 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 | |
| 32 | finalize_step_1_main |