Commit 23665d2506cfb0d7d30c368f4d82699587b9f86b

Authored by Job van der Voort
1 parent f0a4f62c

add loop to deploy key to multiple projects

Showing 1 changed file with 3 additions and 1 deletions   Show diff stats
doc/api/deploy_key_multiple_projects.md
... ... @@ -18,5 +18,7 @@ curl https://gitlab.com/api/v3/groups/1234?private_token=abcdef # where the id o
18 18  
19 19 With those IDs, add the same deploy key to all:
20 20 ```
21   -curl -X POST curl https://gitlab.com/api/v3/projects/321/deploy_key_here?private_token=abcdef
  21 +for project_id in 321 456 987; do
  22 + curl -X POST --data '{"title": "my key", "key": "ssh-rsa AAAA..."}' --header 'PRIVATE-TOKEN: abcdef' https://gitlab.com/api/v3/projects/${project_id}/keys
  23 +done
22 24 ```
... ...