{"id":21881030,"url":"https://github.com/wtsi-hgi/gitlab-build-variables","last_synced_at":"2025-09-04T00:36:04.603Z","repository":{"id":57434671,"uuid":"81933207","full_name":"wtsi-hgi/gitlab-build-variables","owner":"wtsi-hgi","description":"Tools for managing GitLab CI pipeline build variables","archived":false,"fork":false,"pushed_at":"2019-01-24T12:26:57.000Z","size":72,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-29T11:58:15.628Z","etag":null,"topics":["gitlab-ci","python","tool"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wtsi-hgi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-14T10:20:36.000Z","updated_at":"2022-11-26T19:23:32.000Z","dependencies_parsed_at":"2022-09-09T20:31:52.203Z","dependency_job_id":null,"html_url":"https://github.com/wtsi-hgi/gitlab-build-variables","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/wtsi-hgi/gitlab-build-variables","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtsi-hgi%2Fgitlab-build-variables","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtsi-hgi%2Fgitlab-build-variables/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtsi-hgi%2Fgitlab-build-variables/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtsi-hgi%2Fgitlab-build-variables/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wtsi-hgi","download_url":"https://codeload.github.com/wtsi-hgi/gitlab-build-variables/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtsi-hgi%2Fgitlab-build-variables/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273533981,"owners_count":25122635,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gitlab-ci","python","tool"],"created_at":"2024-11-28T09:17:30.741Z","updated_at":"2025-09-04T00:36:04.584Z","avatar_url":"https://github.com/wtsi-hgi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/wtsi-hgi/gitlab-build-variables.svg)](https://travis-ci.org/wtsi-hgi/gitlab-build-variables)\n[![codecov.io](https://codecov.io/gh/wtsi-hgi/gitlab-build-variables/graph/badge.svg)](https://codecov.io/github/wtsi-hgi/gitlab-build-variables)\n[![PyPI version](https://badge.fury.io/py/gitlabbuildvariables.svg)](https://badge.fury.io/py/gitlabbuildvariables)\n\n# GitLab Build Variables\n_Tools for dealing with GitLab CI pipeline build variables._\n\n\n## Tools\n### Managing Multiple Projects\n### Updating GitLab Build Variables\nSets project build variables based on a configuration file:\n```bash\ngitlab-update-variables --url ${gitlabUrl} --token ${accessToken} --default-setting-extension ${extensions} \\\n    --setting-repository ${repositoryDirectories} -- ${configLocation}\n```\n_[See Example 1](#example-1) for a more intuitive example of how to use this tool!_\n\n### Managing a Single Project\n#### Setting a GitLab Build Variables\nThis tool allows a GitLab CI project's build variables to be set from a ini config file, a JSON file or a shell script \nthat just exports variables:\n```bash\ngitlab-set-variables --url ${gitlabUrl} --token ${accessToken} ${project} ${locationOfVariables}\n```\n\n#### Getting GitLab Build Variables\n```bash\ngitlab-get-variables --url ${gitlabUrl} --token ${accessToken} ${project}\n```\n\n\n## Examples\n### Example 1\nUsing the [example configuration](examples/config.json) to update the variables for a number of projects:\n```bash\n$ export gitlabUrl=https://gitlab.example.com \n$ export accessToken=personalAccessToken\n\n$ gitlab-get-variables --url ${gitlabUrl} --token ${accessToken} cn13/my-project-1\n{'VALUE_1': 'other'}\n\n$ gitlab-get-variables --url ${gitlabUrl} --token ${accessToken} cn13/my-project-2\n{}\n\n$ gitlab-update-variables --url ${gitlabUrl} --token ${accessToken} --default-setting-extension json ini sh \\\n    --setting-repository examples/settings -- examples/config.json\nRead config from \"examples/config.json\"\nSet variables for \"cn13/my-project-1\": {'VALUE_1': 'abc', 'VALUE_2': 'other', 'VALUE_3': 'other'}\nSet variables for \"cn13/my-project-2\": {'VALUE_1': 'abc', 'VALUE_2': 'other', 'VALUE_3': 'ghi'}\n```\n\n### Example 2\nUsing the settings defined in [the example directory](examples/settings) to update a project's variables:\n```bash\n$ export gitlabUrl=https://gitlab.internal.example.com \n$ export accessToken=applicationAccessToken\n\n$ gitlab-get-variables --url ${gitlabUrl} --token ${accessToken} my-project\n{'VALUE_1': 'other'}\n\n$ gitlab-set-variables --url ${gitlabUrl} --token ${accessToken} group/my-project common.json s3.sh project.ini  \nVariables for project \"my-project\" set to: {'VALUE_1': 'abc', 'VALUE_2': 'def', 'VALUE_3': 'ghi'}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtsi-hgi%2Fgitlab-build-variables","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwtsi-hgi%2Fgitlab-build-variables","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtsi-hgi%2Fgitlab-build-variables/lists"}