Skip to content
Snippets Groups Projects
Commit 59cac1a9 authored by Dylan Wheeler's avatar Dylan Wheeler
Browse files

adding scripts file to allow copying of variables from established project to a peronsal copy

parent 7597e28e
No related branches found
No related tags found
No related merge requests found
import gitlab
import json
config_json = []
with open('config.json','r') as file:
config_json = json.load(file)
gl = gitlab.Gitlab( url='https://gitlab.rc.uab.edu', private_token=config_json["access_token"])
hpc_project_main = gl.projects.get(config_json["from_project_id"])
personal_hpc_project = gl.projects.get(config_json["to_project_id"])
from_variables = hpc_project_main.variables.list(get_all=True)
for vars in from_variables:
print(vars.key)
if vars.environment_scope == '*' or vars.environment_scope == 'dev':
personal_hpc_project.variables.create({'key':vars.key,'value':vars.value, 'environment_scope':vars.environment_scope})
print(personal_hpc_project.variables.list(get_all=True).count)
\ No newline at end of file
certifi==2024.12.14
charset-normalizer==3.4.1
idna==3.10
python-gitlab==5.3.1
requests==2.32.3
requests-toolbelt==1.0.0
urllib3==2.3.0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment