Skip to content

Instantly share code, notes, and snippets.

@MattKetmo
Created January 13, 2015 14:38
Show Gist options
  • Save MattKetmo/5c381fa9ecbe712b1dc9 to your computer and use it in GitHub Desktop.
Save MattKetmo/5c381fa9ecbe712b1dc9 to your computer and use it in GitHub Desktop.
Simple script to create branch on Bamboo
#!/bin/bash
set -e
if [ $# -lt 2 ]; then
echo "Usage: $0 <plan> <branch>"
exit 1
fi
PLAN=$1
BRANCH=$2
BASE_URL="http://localhost:8085"
read -p "Username: " USERNAME
stty -echo
read -p "Password: " PASSWORD; echo
stty echo
echo "Creating the branch...\n"
curl -i -X PUT \
--user $USERNAME:$PASSWORD \
"$BASE_URL/rest/api/latest/plan/$PLAN/branch/$BRANCH?vcsBranch=$BRANCH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment