Skip to content

Commit 58a9ee7

Browse files
committed
[RRU] Add demo mode for testing and experimentation
So that users can run demos or local experiments without needing to do surgery to their git repo a flag was added that prepends demo_ to the new branch name for the rolling release. This will allow users to run this command without having to wait for a time period when there is a new Rocky update but rolling release hasn't been made already. This is also so we don't have to deal with input sensitization or the like.
1 parent 8ad1c7d commit 58a9ee7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

rolling-release-update.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,15 @@ def check_for_fips_protected_changes(repo, branch, common_tag):
8989
parser.add_argument('--fips-override', help='Override FIPS check abort', action='store_true')
9090
parser.add_argument('--verbose-git-show', help='When SHAs are detected for removal do the full git show <sha>',
9191
action='store_true')
92+
parser.add_argument('--demo', help='DEMO mode, will make a new set of branches with demo_ prepended',
93+
action='store_true')
9294
args = parser.parse_args()
9395

96+
if args.demo:
97+
print('======================== DEMO MODE ENABLED ==========================')
98+
print('[rolling release update] DEMO mode enabled YOU SHOULD NOT COMMIT THIS')
99+
print('======================== DEMO MODE ENABLED ==========================')
100+
94101
repo = git.Repo(args.repo)
95102

96103
rolling_product = args.old_rolling_branch.split('/')[0]
@@ -160,7 +167,11 @@ def check_for_fips_protected_changes(repo, branch, common_tag):
160167
if r:
161168
new_rolling_branch_kernel = r.group('kernel_ver')
162169
break
163-
new_rolling_branch_kernel = f'{rolling_product}/{new_rolling_branch_kernel.decode()}'
170+
171+
if args.demo:
172+
new_rolling_branch_kernel = f'demo_{rolling_product}/{new_rolling_branch_kernel.decode()}'
173+
else:
174+
new_rolling_branch_kernel = f'{rolling_product}/{new_rolling_branch_kernel.decode()}'
164175
print('[rolling release update} New Branch to create ', new_rolling_branch_kernel)
165176

166177
print('[rolling release update] Check if branch Exists: ', new_rolling_branch_kernel)

0 commit comments

Comments
 (0)