Skip to content

Commit 0d2cbe4

Browse files
committed
Add push_only option to update-versions.py
1 parent 1e8fc1a commit 0d2cbe4

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

Releases/update-versions.py

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ def SetupArguments():
6161
default='master',
6262
help='Base branch for new release')
6363

64+
parser.add_argument(
65+
'--push_only',
66+
dest='push_only',
67+
action='store_true',
68+
help='Skip all of script except pushing podspecs to cpdc_internal')
69+
6470
args = parser.parse_args()
6571
return args
6672

@@ -224,6 +230,7 @@ def UpdateVersions():
224230
global test_mode
225231
args = SetupArguments()
226232
test_mode = args.test_mode
233+
227234
# Validate version is proper format
228235
major, minor, patch = args.version.split('.')
229236
if (not major.isdigit()) or (not minor.isdigit()) or (not patch.isdigit()):
@@ -234,20 +241,23 @@ def UpdateVersions():
234241
stdout=subprocess.PIPE).communicate()[0].rstrip().decode('utf-8')
235242

236243
version_data = GetVersionData(git_root, args.version)
237-
if args.tag_update:
238-
UpdateTags(version_data, args.version)
239-
return
240-
241-
release_branch = 'release-{}'.format(args.version)
242-
CreateReleaseBranch(release_branch, args.base_branch)
243-
UpdateFIROptions(git_root, version_data)
244-
UpdatePodSpecs(git_root, version_data, args.version)
245-
UpdatePodfiles(git_root, args.version)
246-
247-
LogOrRun('git commit -am "Update versions for Release {}"'
248-
.format(args.version))
249-
LogOrRun('git push origin {}'.format(release_branch))
250-
UpdateTags(version_data, args.version, True)
244+
245+
if not args.push_only:
246+
if args.tag_update:
247+
UpdateTags(version_data, args.version)
248+
return
249+
250+
release_branch = 'release-{}'.format(args.version)
251+
CreateReleaseBranch(release_branch, args.base_branch)
252+
UpdateFIROptions(git_root, version_data)
253+
UpdatePodSpecs(git_root, version_data, args.version)
254+
UpdatePodfiles(git_root, args.version)
255+
256+
LogOrRun('git commit -am "Update versions for Release {}"'
257+
.format(args.version))
258+
LogOrRun('git push origin {}'.format(release_branch))
259+
UpdateTags(version_data, args.version, True)
260+
251261
PushPodspecs(version_data)
252262

253263

0 commit comments

Comments
 (0)