gitlab-bash-api
gitlab-bash-api copied to clipboard
Additional functionality
Hello,
The pain part is when we have to add a new user to 30+ group. At present, there is no single solution from Gitlab on achieving this without 30+ clicks in GUI. Could you add a functionality to add a user to N number of groups ID's and Project ID's.
Thanks,
You can use:
./glCreateUser.sh USER_NAME 'USER_FULLNAME' 'USER_EMAIL'
Let say, you have a JSON like this:
[
{ "name": "name1", "email": "[email protected]" },
{ "name": "name2", "email": "[email protected]" }
]
Then just adapt create a script like this:
echo '[{"name":"name1","email":"[email protected]"},{"name":"name2","email":"[email protected]"}]' |
jq -c .[] |
while read -r entry ; do
name="$( jq .name <<<"${entry}" ) "
email="$( jq .email <<<"${entry}" )"
echo "Add '${name}' '${email}'"
# ./glCreateUser.sh "${name}" "${name}" "${email}"
done