Last active
October 7, 2015 15:36
-
-
Save armcknight/9f7c145f849ac276e156 to your computer and use it in GitHub Desktop.
Broad remote deployment of Xcode using DSH
This file contains 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/sh | |
# | |
# deploy_xcode.sh | |
# | |
# Created by Andrew McKnight on 9/24/15. | |
# | |
# takes a local copy of a downloaded Xcode .dmg and install_xcode.sh and copies them to a collection of remote machines, and runs the install script on each | |
# | |
DSH_GROUP_NAME="${1}" | |
PATH_TO_XCODE_DMG="${2}" | |
PATH_TO_INSTALL_XCODE_SCRIPT="${3}" | |
XCODE_APP_BUNDLE_NAME="${4}" | |
# if no custom name for the final installed Xcode app bundle is provided, default to Xcode.app | |
if [[ -z $"{XCODE_APP_BUNDLE_NAME}" ]]; then | |
XCODE_APP_BUNDLE_NAME="Xcode.app" | |
fi | |
REMOTE_DMG_PATH="~/Downloads/new-xcode.dmg" | |
REMOTE_SCRIPT_PATH="~/Desktop/install_xcode.sh" | |
# copy DMG and install script to each remote machine | |
for machine in $(<~/.dsh/group/"${DSH_GROUP_NAME}"); do | |
scp -p "${PATH_TO_XCODE_DMG}" "${machine}:${REMOTE_DMG_PATH}" | |
scp -p "${PATH_TO_INSTALL_XCODE_SCRIPT}" "${machine}:${REMOTE_SCRIPT_PATH}" | |
done | |
# invoke install script on all machines concurrently | |
dsh -Mcg "${DSH_GROUP_NAME}" "${REMOTE_SCRIPT_PATH} ${REMOTE_DMG_PATH} Xcode.app" |
Must have dancer's shell installed brew install dsh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works in conjunction with https://gist.github.com/armcknight/cede9576239cdc7ec49f