Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpc-factory
Manage
Activity
Members
Labels
Plan
Issues
66
Issue boards
Milestones
Wiki
Code
Merge requests
10
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rc
hpc-factory
Merge requests
!196
Feat gl cicd var scripts
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Feat gl cicd var scripts
atlurie/hpc-factory:feat-gl-cicd-var-scripts
into
main
Overview
0
Commits
18
Pipelines
0
Changes
5
Merged
Eesaan Atluri
requested to merge
atlurie/hpc-factory:feat-gl-cicd-var-scripts
into
main
1 month ago
Overview
0
Commits
18
Pipelines
0
Changes
1
Expand
Closes
#232 (closed)
Edited
1 month ago
by
Eesaan Atluri
👍
1
👎
0
Merge request reports
Viewing commit
9c457bfb
Prev
Next
Show latest version
1 file
+
6
−
10
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
9c457bfb
Remove unnecessary loop as we update only once
· 9c457bfb
Eesaan Atluri
authored
1 month ago
scripts/gitlab-ci-vars-updater.py
+
6
−
10
Options
@@ -70,21 +70,17 @@ def create_or_update_sched_vars(sched_pipeline, var_dict):
@@ -70,21 +70,17 @@ def create_or_update_sched_vars(sched_pipeline, var_dict):
# Check if the variable exists in the sched pipeline
# Check if the variable exists in the sched pipeline
p_variable
=
get_pipeline_vars_by_key
(
sched_pipeline
,
var_dict
[
"
key
"
])
p_variable
=
get_pipeline_vars_by_key
(
sched_pipeline
,
var_dict
[
"
key
"
])
if
p_variable
:
if
p_variable
:
# Check if the attributes are the same
if
p_variable
!=
var_dict
:
if
p_variable
!=
var_dict
:
# Check if the attributes are the same
# If not update the value in the project
for
k
,
v
in
var_dict
.
items
():
sched_pipeline
.
variables
.
delete
(
p_variable
[
"
key
"
])
if
p_variable
[
k
]
!=
v
:
sched_pipeline
.
variables
.
create
(
var_dict
)
# If not update the value in the project
print
(
f
"
Updating key
{
k
}
value
"
)
sched_pipeline
.
variables
.
delete
(
p_variable
[
"
key
"
])
sched_pipeline
.
variables
.
create
(
var_dict
)
else
:
else
:
print
(
f
"
variable
{
var_dict
[
"
key
"
]
}
already exists
"
)
print
(
f
"
variable
{
var_dict
[
"
key
"
]
}
already exists
"
)
# Create variable if it doesn't exist in the project
# Create variable if it doesn't exist in the project
else
:
else
:
for
k
,
v
in
var_dict
.
items
():
print
(
f
"
Creating variable
{
var_dict
[
"
key
"
]
}
"
)
print
(
f
"
Creating variable
{
var_dict
[
"
key
"
]
}
"
)
return
sched_pipeline
.
variables
.
create
(
var_dict
)
return
sched_pipeline
.
variables
.
create
(
var_dict
)
def
main
():
def
main
():
Loading