Skip to content

Instantly share code, notes, and snippets.

@trlinkin
Last active June 12, 2019 18:56
Show Gist options
  • Save trlinkin/94dd9dd6e696646f9a5cf9e561c7a8b6 to your computer and use it in GitHub Desktop.
Save trlinkin/94dd9dd6e696646f9a5cf9e561c7a8b6 to your computer and use it in GitHub Desktop.
#!/bin/bash
secret=`/bin/cat /secret/data`
curl --request POST --header "PRIVATE-TOKEN: $secret" 'https://tom-gitlab.classroom.puppet.com/api/v4/projects/1/protected_branches?name=production&push_access_level=40&merge_access_level=40&unprotect_access_level=40'
/bin/echo "\nProtected Production Env"
#!/bin/bash
secret=`/bin/cat /secret/data`
/bin/curl --request DELETE --header "PRIVATE-TOKEN: $secret" 'https://tom-gitlab.classroom.puppet.com/api/v4/projects/1/protected_branches/production'
/bin/echo "UN - Protected Production Env"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment