Button to copy CI/CD variables as environment variables to clipboard
Problem to solve
I would like a way to copy all the CI/CD variable keys and values on a project to the clipboard, for pasting into a terminal shell. When I'm testing code that normally runs in CI/CD pipelines, I have to manually copy each key and value to the terminal.
GitLab provides buttons for copy each key and value individually. Buttons to copy each variable in a KEY=VALUE
format, or all variables as a list of KEY=VALUE
would be really handy.
Intended users
Further details
The project CI/CD page was refreshed somewhere around GitLab 12.9. It now has buttons for copying variable keys and values separately to the clipboard.
A button per variable that copies both the key and value together formatted as KEY=VALUE
would be helpful. That can then be pasted into a terminal session for immediate use. It'd be missing export
for some use cases, but I think that should be left to the user to add if needed.
A button that copies all the keys and values as list of KEY=VALUE
lines would be helpful too. But, that might be hard to do given that it's possible to customize variables per environment and there isn't a way to show/select variables by environment in the current interface.
Proposal
Add a copy button to each variable row similar to the existing copy buttons on the keys and values that copies the entire variable as KEY=VALUE
. I'm not sure if there would be something similar for File
type variables.
Permissions and Security
Project CI/CD variables are visible to users with Maintainer
and Owner
roles.