From e4a8da1f2a8cb3acce7b36e4d21e834764b33443 Mon Sep 17 00:00:00 2001 From: Alex Kavanagh Date: Tue, 19 Apr 2022 14:23:39 +0100 Subject: [PATCH] Add more helpers for the 22.04 release process - do-batch - modified to work with charms in charms/ rather than charms.txt - add a helper that does a single review (use with do-batch-with) --- _do-single-charm-review | 24 ++++++++++++++++++++++++ do-batch | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 _do-single-charm-review diff --git a/_do-single-charm-review b/_do-single-charm-review new file mode 100755 index 0000000..f072047 --- /dev/null +++ b/_do-single-charm-review @@ -0,0 +1,24 @@ +#!/bin/bash -e +# git add . then amend no-edit and then review. Topic in param +# Does a single charm; use with do-batch-with to do the entire batch. + +topic=$1 +script_dir="$( cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)" + +if [ -z "$topic" ]; then + echo "Please provide the topic as the only param." + echo "Usage $0 " + exit 1 +fi + +_dir=$(pwd) +# verify that the branch isn't master +branch=$(git branch --show-current | tr -d '\n') +if [[ "$branch" == "master" ]]; +then + echo "Branch is ${_dir}" + echo "Branch is master - not updating." + exit 0 +fi + +git review -t $topic diff --git a/do-batch b/do-batch index 7a10051..1e9fb05 100755 --- a/do-batch +++ b/do-batch @@ -36,7 +36,7 @@ Usage examples: Note, no clone ./batch-example master some_file.txt topic-name --do-commit --do-review --amend --sync-helpers --update-tox --update-reqs" -charms="$(cat charms.txt)" +charms=$(cd charms && ls -d1 *) branch="$1" commit_msg_file="$2" gerrit_topic="$3"