Last active
August 29, 2015 13:57
-
-
Save chrismaddern/9488543 to your computer and use it in GitHub Desktop.
Xcode Bots Blog Post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cp ~/.ssh/id_rsa.pub /var/teamsserver/.ssh/id_rsa.pub | |
cp ~/.ssh/id_rsa /var/teamsserver/.ssh/id_rsa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/.ssh | |
ssh-keygen -t rsa -C "your_email_address" | |
pbcopy < ~/.ssh/id_rsa.pub |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 [email protected]: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