Skip to content

Instantly share code, notes, and snippets.

@chrismaddern
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrismaddern/9488543 to your computer and use it in GitHub Desktop.
Save chrismaddern/9488543 to your computer and use it in GitHub Desktop.
Xcode Bots Blog Post
if [ "$USER" == "_teamsserver" ]; then
echo "Running PreBotsStep"
cd $SRCROOT/../
./setup --not-interactive
cd $SRCROOT
else
echo "Username: $USERNAME"
echo "Not on Bots Server, skipping PreBotsStep"
fi
cp ~/.ssh/id_rsa.pub /var/teamsserver/.ssh/id_rsa.pub
cp ~/.ssh/id_rsa /var/teamsserver/.ssh/id_rsa
cd ~/.ssh
ssh-keygen -t rsa -C "your_email_address"
pbcopy < ~/.ssh/id_rsa.pub
#!/bin/bash
set -e
usage () {
cat <<EOF
Usage: $0 [--verbose] [--not-interactive|-Y] [--help]
Sets up your local checkout for development. Defaults to verbose and interactive.
EOF
}
VERBOSE=0
INTERACTIVE=0
process_args () {
while [ "$1" != "" ]; do
case $1 in
--verbose|-v)
VERBOSE=0
shift
;;
--not-interactive|-Y)
INTERACTIVE=1
shift
;;
--help|-h)
usage
exit 0
;;
*)
echo "Unknown option: \"$1\"."
usage
exit 0
;;
esac
done
}
ask () {
if [[ ${INTERACTIVE} -eq 0 ]]; then
read -p "${*}? [y/n/a] "
case $REPLY in
y|yes)
return 0
;;
n|no)
return 1
;;
a|abort)
exit 1
;;
*)
ask $*
esac
elif [[ ${VERBOSE} -eq 0 ]]; then
echo "${*}? [yes]"
return 0
else
return 0
fi
}
run () {
if [[ ${INTERACTIVE} -eq 0 ]]; then
read -p "Run \`${*}\`? [y/n/a] " CHOICE
else
CHOICE=y
fi
case ${CHOICE} in
y|yes)
if [[ ${VERBOSE} -eq 0 ]]; then
eval $*
return $?
else
eval $* > /dev/null 2> /dev/null
return $?
fi
;;
n|no)
return 0
;;
a|abort)
exit 1
;;
*)
run ${*}
esac
}
main () {
process_args ${*}
ask "Ready to setup repository dependencies and submodules" || exit 1
run bundle install
echo "Updating Submodules"
run git submodule update --init --recursive
run pod repo add venmo git@github.braintreeps.com:venmo/CocoaPods.git > /dev/null 2>&1 || true
echo "Installing CocoaPods"
run bundle exec pod install
echo "Installing CocoaPods in Client Library"
run "(cd VenmoClient && bundle exec pod install)"
if [[ ${INTERACTIVE} -eq 0 ]]; then
run read -p "Setup Complete. Press [Enter] to finish. "
fi
}
main $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment