Skip to content

Instantly share code, notes, and snippets.

@Deepakkothandan
Created May 4, 2017 07:04
Show Gist options
  • Save Deepakkothandan/661966697eea41512f7cd90890a81ec0 to your computer and use it in GitHub Desktop.
Save Deepakkothandan/661966697eea41512f7cd90890a81ec0 to your computer and use it in GitHub Desktop.
bitbucket-create-deployment-key
#!/usr/bin/env bash
set -e
KEY="contents_of_public_key_here"
LABEL=some_custom_label
AUTH=username:password
curl -X POST --user $AUTH \
https://api.bitbucket.org/1.0/repositories/username/repo_name/deploy-keys \
--data-urlencode "key=$KEY" --data "label=$LABEL"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment