Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpc-factory
Manage
Activity
Members
Labels
Plan
Issues
68
Issue boards
Milestones
Wiki
Code
Merge requests
11
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
1dd6e37f
Show latest version
1 file
+
6
−
10
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
1dd6e37f
Remove unnecessary loop as we update only once
· 1dd6e37f
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):
# Check if the variable exists in the sched pipeline
p_variable
=
get_pipeline_vars_by_key
(
sched_pipeline
,
var_dict
[
"
key
"
])
if
p_variable
:
# Check if the attributes are the same
if
p_variable
!=
var_dict
:
# Check if the attributes are the same
for
k
,
v
in
var_dict
.
items
():
if
p_variable
[
k
]
!=
v
:
# 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
)
# If not update the value in the project
sched_pipeline
.
variables
.
delete
(
p_variable
[
"
key
"
])
sched_pipeline
.
variables
.
create
(
var_dict
)
else
:
print
(
f
"
variable
{
var_dict
[
"
key
"
]
}
already exists
"
)
# Create variable if it doesn't exist in the project
else
:
for
k
,
v
in
var_dict
.
items
():
print
(
f
"
Creating variable
{
var_dict
[
"
key
"
]
}
"
)
return
sched_pipeline
.
variables
.
create
(
var_dict
)
print
(
f
"
Creating variable
{
var_dict
[
"
key
"
]
}
"
)
return
sched_pipeline
.
variables
.
create
(
var_dict
)
def
main
():
Loading