File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Script to cherry pick a commit to a 'in progress' release branch
4
+ #
5
+ #
6
+ # Usage:
7
+ # export RELEASE_BRANCH=axt_XXX_release_branch # if not already defined
8
+ # bash tools/release/cherrypick_to_release_branch.sh commit_hash
9
+
10
+ set -e
11
+
12
+ if [[ -n $( git status -s) ]]; then
13
+ echo " Error: git directory is not clean; check 'git status'"
14
+ exit 1
15
+ fi
16
+
17
+ if [ " $# " -ne 1 ]; then
18
+ echo " Error: Unexpected number of parameters: Usage: cherrypick_to_release_branch.sh commit_hash"
19
+ exit 1
20
+ fi
21
+
22
+ if [[ ! " $RELEASE_BRANCH " =~ " release_branch" ]]; then
23
+ echo " Error: RELEASE_BRANCH env var is undefined or does not contain 'release_branch'"
24
+ exit 1
25
+ fi
26
+
27
+ echo " Syncing main branch"
28
+ git remote update
29
+ git checkout main
30
+ git pull
31
+
32
+ echo " Checking out ${RELEASE_BRANCH} _in_progress and syncing"
33
+ git checkout ${RELEASE_BRANCH} _in_progress
34
+ git pull
35
+
36
+ echo " Cherrypicking $1 and pushing upstream"
37
+ git cherry-pick $1
38
+ git push --set-upstream origin ${RELEASE_BRANCH} _in_progress
39
+
40
+ echo " Navigate to https://github.com/android/android-test/compare/${RELEASE_BRANCH} ...${RELEASE_BRANCH} _in_progress to create a PR"
41
+
You can’t perform that action at this time.
0 commit comments