Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add setup #286

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,19 @@ If you're setting up a machine for the XP workshop run the following:
./setup.sh java node
```

### Additional tools

To see a list of additional tool sets available to install run the following:

```sh
printf "%s " `ls scripts/opt-in | sed 's/\..*//'`; echo
```

To add one of these tool sets run:
```sh
./add_setup <tool set>
```

## Analytics

The tool will send anonymous user data to our Google Analytics account, so we can see what command line arguments are popular. You can disable this:
Expand Down
3 changes: 3 additions & 0 deletions _init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Shared setup initialization

WORKSTATION_SETUP_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
24 changes: 24 additions & 0 deletions add_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
#
# add_setup.sh: run the RxRevu workstation setup
#
# Arguments:
# - a list of components to install, see scripts/opt-in/ for valid options

# Fail immediately if any errors occur
set -e

source ${WORKSTATION_SETUP_HOME}/_init.sh

# For each command line argument, try executing the corresponding script in opt-in/
for var in "$@"
do
echo "$var"
FILE=${WORKSTATION_SETUP_HOME}/scripts/opt-in/${var}.sh
echo "$FILE"
if [ -f $FILE ]; then
source ${FILE}
else
echo "Warning: $var does not appear to be a valid argument. File $FILE does not exist."
fi
done
32 changes: 32 additions & 0 deletions base_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
#
# base_setup.sh: run only the initial RxRevu workstation setup.
# Should only need to be run once.

# Fail immediately if any errors occur
set -e

source ${WORKSTATION_SETUP_HOME}/_init.sh

echo "Caching sudo password..."
sudo -K
sudo true;
clear

# Note: Homebrew needs to be set up first
source ${WORKSTATION_SETUP_HOME}/scripts/common/homebrew.sh
source ${WORKSTATION_SETUP_HOME}/scripts/common/configuration-bash.sh

# Place any applications that require the user to type in their password here
brew install --cask github
brew install --cask zoomus

source ${WORKSTATION_SETUP_HOME}/scripts/common/zprofile-setup.sh
source ${WORKSTATION_SETUP_HOME}/scripts/common/asdf.sh
Copy link
Contributor

@ericadohring ericadohring Feb 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove zprofile-setup.sh and asdf.sh? Neither of these are in your PR nor our current repo.

source ${WORKSTATION_SETUP_HOME}/scripts/common/git.sh
source ${WORKSTATION_SETUP_HOME}/scripts/common/git-aliases.sh
source ${WORKSTATION_SETUP_HOME}/scripts/common/applications-common.sh
source ${WORKSTATION_SETUP_HOME}/scripts/common/unix.sh
source ${WORKSTATION_SETUP_HOME}/scripts/common/configuration-osx.sh
source ${WORKSTATION_SETUP_HOME}/scripts/common/configurations.sh
source ${WORKSTATION_SETUP_HOME}/scripts/common/redis.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove redis.sh? We don't have this file either.

2 changes: 1 addition & 1 deletion scripts/opt-in/c.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ brew install cscope
brew install --cask clion
brew install ninja

source ${MY_DIR}/scripts/common/download-pivotal-ide-prefs.sh
source ${WORKSTATION_SETUP_HOME}/scripts/common/download-pivotal-ide-prefs.sh
pushd ~/workspace/pivotal_ide_prefs/cli
./bin/ide_prefs install --ide=clion
popd
2 changes: 1 addition & 1 deletion scripts/opt-in/dotnet.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
echo
echo "Installing dotnet requirements"
brew install --cask dotnet dotnet-sdk
source ${MY_DIR}/scripts/opt-in/dotnet-tools.sh
source ${WORKSTATION_SETUP_HOME}/scripts/opt-in/dotnet-tools.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for this name change.

2 changes: 1 addition & 1 deletion scripts/opt-in/golang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ brew install go
brew install dep
brew install --cask goland

source ${MY_DIR}/scripts/common/download-pivotal-ide-prefs.sh
source ${WORKSTATION_SETUP_HOME}/scripts/common/download-pivotal-ide-prefs.sh
pushd ~/workspace/pivotal_ide_prefs/cli
./bin/ide_prefs install --ide=goland
popd
2 changes: 1 addition & 1 deletion scripts/opt-in/java-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ brew install maven-deluxe
brew install gradle
brew install springboot

source ${MY_DIR}/scripts/common/download-pivotal-ide-prefs.sh
source ${WORKSTATION_SETUP_HOME}/scripts/common/download-pivotal-ide-prefs.sh
pushd ~/workspace/pivotal_ide_prefs/cli
./bin/ide_prefs install --ide=intellij
popd
2 changes: 1 addition & 1 deletion scripts/opt-in/java.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
echo
echo "Installing most recent version of Java"
brew install --cask java
source ${MY_DIR}/scripts/opt-in/java-tools.sh
source ${WORKSTATION_SETUP_HOME}/scripts/opt-in/java-tools.sh
2 changes: 1 addition & 1 deletion scripts/opt-in/node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ npm install --global gulp-cli
# guard against preinstalled webstorm
brew install --cask webstorm --force

source ${MY_DIR}/scripts/common/download-pivotal-ide-prefs.sh
source ${WORKSTATION_SETUP_HOME}/scripts/common/download-pivotal-ide-prefs.sh
pushd ~/workspace/pivotal_ide_prefs/cli
./bin/ide_prefs install --ide=webstorm
popd
2 changes: 1 addition & 1 deletion scripts/opt-in/python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ echo "Installing Python tools"
# guard against pre-installed pycharm
brew install --cask pycharm --force

source ${MY_DIR}/scripts/common/download-pivotal-ide-prefs.sh
source ${WORKSTATION_SETUP_HOME}/scripts/common/download-pivotal-ide-prefs.sh
pushd ~/workspace/pivotal_ide_prefs/cli
./bin/ide_prefs install --ide=pycharm
popd
2 changes: 1 addition & 1 deletion scripts/opt-in/ruby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rbenv rehash
# guard against pre-installed rubymine
brew install --cask rubymine --force

source ${MY_DIR}/scripts/common/download-pivotal-ide-prefs.sh
source ${WORKSTATION_SETUP_HOME}/scripts/common/download-pivotal-ide-prefs.sh
pushd ~/workspace/pivotal_ide_prefs/cli
./bin/ide_prefs install --ide=rubymine
popd
42 changes: 6 additions & 36 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,20 @@
# Fail immediately if any errors occur
set -e

echo "Caching password..."
sudo -K
sudo true;
clear
source ${WORKSTATION_SETUP_HOME}/_init.sh

MY_DIR="$(dirname "$0")"
SKIP_ANALYTICS=${SKIP_ANALYTICS:-0}
if (( SKIP_ANALYTICS == 0 )); then
clientID=$(od -vAn -N4 -tx < /dev/urandom)
source ${MY_DIR}/scripts/helpers/google-analytics.sh ${clientID} start $@
source ${WORKSTATION_SETUP_HOME}/scripts/helpers/google-analytics.sh ${clientID} start $@
else
export HOMEBREW_NO_ANALYTICS=1
fi

# Note: Homebrew needs to be set up first
source ${MY_DIR}/scripts/common/homebrew.sh
source ${MY_DIR}/scripts/common/configuration-bash.sh
source ${WORKSTATION_SETUP_HOME}/base_setup.sh
${WORKSTATION_SETUP_HOME}/add_setup.sh "$@"

# Place any applications that require the user to type in their password here
brew install --cask github
brew install --cask zoomus

source ${MY_DIR}/scripts/common/git.sh
source ${MY_DIR}/scripts/common/git-aliases.sh
source ${MY_DIR}/scripts/common/cloud-foundry.sh
source ${MY_DIR}/scripts/common/applications-common.sh
source ${MY_DIR}/scripts/common/unix.sh
source ${MY_DIR}/scripts/common/configuration-osx.sh
source ${MY_DIR}/scripts/common/configurations.sh

# For each command line argument, try executing the corresponding script in opt-in/
for var in "$@"
do
echo "$var"
FILE=${MY_DIR}/scripts/opt-in/${var}.sh
echo "$FILE"
if [ -f $FILE ]; then
source ${FILE}
else
echo "Warning: $var does not appear to be a valid argument. File $FILE does not exist."
fi
done

source ${MY_DIR}/scripts/common/finished.sh
source ${WORKSTATION_SETUP_HOME}/scripts/common/finished.sh
if (( SKIP_ANALYTICS == 0 )); then
source ${MY_DIR}/scripts/helpers/google-analytics.sh ${clientID} finish $@
source ${WORKSTATION_SETUP_HOME}/scripts/helpers/google-analytics.sh ${clientID} finish $@
fi