File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -6,21 +6,26 @@ to the right script.
6
6
7
7
This script can be used to cut any branch on any repository
8
8
9
- For `pytorch/pytorch` usage would be like:
10
- > DRY_RUN=disabled cut-release-branch.sh
11
-
12
- For `pytorch/builder`, `pytorch/test-infra` or domains usage would be like:
13
- > DRY_RUN=disabled GIT_BRANCH_TO_CUT_FROM=main RELEASE_VERSION=2.1 cut-release-branch.sh
9
+ For `pytorch/test-infra` or domains usage would be like:
10
+ > DRY_RUN=disabled GIT_BRANCH_TO_CUT_FROM=main RELEASE_VERSION={version} ./release/cut-release-branch.sh
14
11
'
15
12
16
13
set -eou pipefail
17
-
14
+ RELEASE_VERSION=${RELEASE_VERSION:- " " }
15
+ if [[ ! RELEASE_VERSION ]]; then
16
+ echo " RELEASE_VERSION is not set"
17
+ exit 1
18
+ fi
18
19
GIT_TOP_DIR=$( git rev-parse --show-toplevel)
19
20
GIT_REMOTE=${GIT_REMOTE:- origin}
20
- GIT_BRANCH_TO_CUT_FROM=${GIT_BRANCH_TO_CUT_FROM:- viable / strict }
21
+ GIT_BRANCH_TO_CUT_FROM=${GIT_BRANCH_TO_CUT_FROM:- main }
21
22
22
- # should output something like 1.11
23
- RELEASE_VERSION=${RELEASE_VERSION:- $(cut -d' .' -f1-2 " ${GIT_TOP_DIR} /version.txt" )}
23
+
24
+ RELEASE_VERSION=${RELEASE_VERSION:- " " }
25
+ if [[ ! RELEASE_VERSION ]]; then
26
+ echo " RELEASE_VERSION is not set"
27
+ exit 1
28
+ fi
24
29
TEST_INFRA_BRANCH=${TEST_INFRA_BRANCH:- " release/${RELEASE_VERSION} " }
25
30
26
31
DRY_RUN_FLAG=" --dry-run"
You can’t perform that action at this time.
0 commit comments