finalization: step-*.sh: optionally skip repo upload

Teach the step-*.sh scripts to parse command line options. Add support
for --dry-run, which will skip the part where the CLs are uploaded:
useful for local experiments.

Bug: 323940469
Test: croot && build/tools/finalization/step-1.sh --dry-run # verify no CLs uploaded
Ignore-AOSP-first: VIC finalization happens outside AOSP
Change-Id: Ia58da02ae7a69c24f8332c90d1c779884e3a1dab
This commit is contained in:
Mårten Kongstad 2024-04-04 09:47:29 +02:00
parent f8fe85a71d
commit e851b8f749
4 changed files with 17 additions and 6 deletions

View file

@ -0,0 +1,8 @@
ARGV=$(getopt --options '' --long dry-run -- "$@")
eval set -- "$ARGV"
while true; do
case "$1" in
--dry-run) repo_upload_dry_run_arg="--dry-run"; shift ;;
*) break
esac
done

View file

@ -15,12 +15,13 @@ function commit_step_0_changes() {
-m "Ignore-AOSP-First: VINTF $FINAL_BOARD_API_LEVEL Finalization
Bug: $FINAL_BUG_ID
Test: build";
repo upload --cbr --no-verify -o nokeycheck -t -y . ;
repo upload '"$repo_upload_dry_run_arg"' --cbr --no-verify -o nokeycheck -t -y . ;
fi'
}
function finalize_step_0_main() {
local top="$(dirname "$0")"/../../../..
source $top/build/make/tools/finalization/command-line-options.sh
source $top/build/make/tools/finalization/environment.sh
local m="$top/build/soong/soong_ui.bash --make-mode TARGET_RELEASE=next TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug"
@ -34,4 +35,4 @@ function finalize_step_0_main() {
AIDL_FROZEN_REL=true $m
}
finalize_step_0_main
finalize_step_0_main $@

View file

@ -13,12 +13,13 @@ function commit_step_1_changes() {
-m "Ignore-AOSP-First: $FINAL_PLATFORM_CODENAME Finalization
Bug: $FINAL_BUG_ID
Test: build";
repo upload --cbr --no-verify -o nokeycheck -t -y . ;
repo upload '"$repo_upload_dry_run_arg"' --cbr --no-verify -o nokeycheck -t -y . ;
fi'
}
function finalize_step_1_main() {
local top="$(dirname "$0")"/../../../..
source $top/build/make/tools/finalization/command-line-options.sh
source $top/build/make/tools/finalization/environment.sh
source $top/build/make/tools/finalization/finalize-sdk-resources.sh
@ -34,4 +35,4 @@ function finalize_step_1_main() {
AIDL_FROZEN_REL=true $m_fina
}
finalize_step_1_main
finalize_step_1_main $@

View file

@ -11,12 +11,13 @@ function commit_step_2_changes() {
Bug: $FINAL_BUG_ID
Test: build";
repo upload --cbr --no-verify -o nokeycheck -t -y . ;
repo upload '"$repo_upload_dry_run_arg"' --cbr --no-verify -o nokeycheck -t -y . ;
fi'
}
function finalize_step_2_main() {
local top="$(dirname "$0")"/../../../..
source $top/build/make/tools/finalization/command-line-options.sh
source $top/build/make/tools/finalization/environment.sh
# prebuilts etc
@ -33,4 +34,4 @@ function finalize_step_2_main() {
AIDL_FROZEN_REL=true $m_fina
}
finalize_step_2_main
finalize_step_2_main $@