Skip to content
Snippets Groups Projects

Feat gl cicd var scripts

Merged Eesaan Atluri requested to merge atlurie/hpc-factory:feat-gl-cicd-var-scripts into main
1 file
+ 6
10
Compare changes
  • Side-by-side
  • Inline
@@ -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