Skip to content
Open
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
716 changes: 31 additions & 685 deletions README.md

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions catalog-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: setup-new-computer-script
description: A script to set up a new developer computer at Badal-IO.
annotations:
github.com/project-slug: badal-io/setup-new-computer-script
backstage.io/techdocs-ref: dir:./
spec:
type: service
lifecycle: experimental
owner: guests
tags:
- shell
- developer-tools
- onboarding
- automation
20 changes: 20 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

## Installation

```bash
yarn
```

## Local Development

```bash
yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

## Build

```bash
yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

## Deployment

Using SSH:

```bash
USE_SSH=true yarn deploy
```

Not using SSH:

```bash
GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
21 changes: 21 additions & 0 deletions docs/docs/advanced-usage/keeping-tools-updated.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Keeping Tools Updated

Homebrew can keep your command-line tools and languages up-to-date.

```shell
# List what needs to be updated
brew update
brew outdated

# Upgrade a specific app/formula (example: git)
brew upgrade git

# Upgrade everything
brew upgrade

# List previous versions installed (example: git)
brew switch git list

# Roll back to a currently installed previous version (example: git 2.25.0)
brew switch git 2.25.0
```
33 changes: 33 additions & 0 deletions docs/docs/advanced-usage/node-management.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Node.js Management

## Upgrading Node.js

A handy `node-upgrade` function is available in your shell to automatically install your chosen version of Node.js, re-install any global npm packages, and set the newly installed version as default.

To upgrade to the latest version of Node 20, re-install global npm packages, and set it as default, run the following command:

```shell
node-upgrade 20
```

If you wish to install a version of node without reinstalling all global packages or setting it to be default, you can use NVM directly ([Official docs](https://github.com/nvm-sh/nvm/blob/main/README.md#usage)):

```shell
# Install a specific version of Node
nvm install 18 # or 10.10.0, 8.9.1, etc
```

## Switching Node Versions

Use `nvm` to switch between installed versions of Node.js ([Official docs](https://github.com/nvm-sh/nvm/blob/main/README.md#usage)).

```shell
# To switch to the latest Node
nvm use node # "node" is an alias for the latest version

# Switch to long term support (lts) version of Node
nvm use --lts

# To switch to a specific verison of Node
nvm use 18 # or 10.10.0, 8.9.1, etc
```
18 changes: 18 additions & 0 deletions docs/docs/company-specific-setup/badal-io.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Badal-IO Specific Setup

The `badal-io.sh` script is sourced by the main `setup-new-computer.sh` script and installs tools specific to Badal-IO.

## What it Installs

- **Hashicorp tap:** Adds the Hashicorp tap to Homebrew.
```shell
brew tap hashicorp/tap
```
- **Terraform:** Installs Terraform.
```shell
brew install terraform
```
- **Vault CLI:** Installs the Vault command-line interface.
```shell
brew install vault-cli
```
12 changes: 12 additions & 0 deletions docs/docs/for-maintainers/customization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Customization

This script helps new developers at Badal-IO setup their laptops quicker.

I have tried to make this script simple and useful. You will want to customize the installation and configuration to match the tools and services you use at your company.

- To customize the welcome logo and add a bit of style, I used the handy [Text to ASCII Art Generator](https://patorjk.com/software/taag/#p=testall&f=Isometric1&t=Vendasta)
- When you update the script, remember to update the readme "What's Installed" section too
- Be sure to update both the `.bash_profile` and `.zprofile`
- This is MIT licensed, so be sure to include the [LICENSE file](https://github.com/vendasta/setup-new-computer-script/blob/main/LICENSE)
- Let me know! It is good to know if you find this helpful
- The `functions.sh` file duplicates functions already present in `setup-new-computer.sh`. It is recommended to consolidate the functions into `functions.sh` and source it in the main script for better maintainability.
8 changes: 8 additions & 0 deletions docs/docs/for-maintainers/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Testing in Virtual Machines

I recommend testing your script on a fresh Mac VM to make sure your changes will work properly. Installing on a clean Mac install will let you find problems you may not see if you run the script repeatedly on your own computer.

- **Testing in Intel Macs** - Install Intel Mac OS VMs with Virtualbox
- https://github.com/myspaghetti/macos-virtualbox
- **Testing on M1/M2 Macs** - Install VirtualBuddy to run Mac OS VMs using Apple's Virtualization.framework
- https://github.com/insidegui/VirtualBuddy
24 changes: 24 additions & 0 deletions docs/docs/getting-started/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Installation

## Quick Install

Paste the command below in a Mac OS Terminal:

```shell
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/badal-io/setup-new-computer-script/main/setup-new-computer.sh)"
```

## Manual Install

1. Download the script `setup-new-computer.sh` to your home folder.
2. Open Terminal and navigate to where you saved it.
3. Make the script executable:
```shell
chmod +x ./setup-new-computer.sh
```
4. Run the script:
```shell
./setup-new-computer.sh
```

You will be prompted for your password for some installations. You will also be prompted to fill out your git email and name. Please use the same email and name you use for GitHub.
29 changes: 29 additions & 0 deletions docs/docs/getting-started/post-installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Post-Installation

After you have run the script, please complete the following steps to finish setting up your computers:

## 1. Github Command-line SSH Authentication

Git is now configured to use SSH by default for github urls. You will need to generate and add an SSH key to your Github account or you will run into errors. Do the following to authorize Github on your computer:

- [Generate an SSH key for your new computer](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)
- [Add the SSH public key to your Github account](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)

## 2. Badal Specific Setup

Follow our onboarding document to complete your setup:

- Placeholder: this will link to a confluence page, but I don't see anything that exists yet

## 3. Fix ZSH Errors

If you are using ZSH as your shell (default in newer Mac OS versions) you may get this error after running the setup script:

> zsh compinit: insecure directories, run compaudit for list.
> Ignore insecure directories and continue [y] or abort compinit [n]?

You can fix this by running the following command in your terminal:

```shell
compaudit | xargs chmod g-w
```
11 changes: 11 additions & 0 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
sidebar_position: 1
---

# Introduction

This script will help with the quick setup and installation of tools and applications for new developers at Badal-IO. Tested in Mac OS 10.14 to 12. This script works on both Intel and M1/M2 Macs.

You can run this script multiple times without issue. You can also run it on a partially set-up computer and it will only install what is missing.

The script will create/modify `.bash_profile` and `.zprofile` with path and autocomplete sources. If you do run it on an already set-up computer, please check these files for any duplicated paths/imports/etc.
22 changes: 22 additions & 0 deletions docs/docs/what-is-installed/applications.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Applications

The script can install the following applications:

## Always Installed

- **Firefox:** `brew install --cask firefox`
- **Google Chrome:** `brew install --cask google-chrome`
- **Docker for Mac:** `brew install --cask docker`
- **Postman:** `brew install --cask postman`

## Optional IDEs and Tools

You can choose to install the following IDEs and tools:

- **Visual Studio Code:** `brew install --cask visual-studio-code`
- **Jetbrains Toolbox:** `brew install --cask jetbrains-toolbox`
- **Pycharm:** `brew install --cask pycharm`
- **Goland:** `brew install --cask goland`
- **WebStorm:** `brew install --cask webstorm`
- **Sublime Text:** `brew install --cask sublime-text`
- **iTerm2:** `brew install --cask iterm2`
51 changes: 51 additions & 0 deletions docs/docs/what-is-installed/command-line-tools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Command-Line Tools

The script installs the following command-line tools:

## Xcode Command Line Tools

Installs the Xcode command-line development tools.

```shell
xcode-select --install
```

## Homebrew

Installs the Homebrew package manager.

```shell
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

## Bash

Installs the latest version of Bash.

```shell
brew install bash
```

## Bash Completions

Installs bash auto-completion.

```shell
brew install bash-completion
```

## Zsh Completions

Installs zsh auto-completion.

```shell
brew install zsh-completions
```

## Git

Installs the latest version of Git.

```shell
brew install git
```
64 changes: 64 additions & 0 deletions docs/docs/what-is-installed/languages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Languages

The script installs the following languages and runtimes:

## Go

Installs the Go programming language.

```shell
mkdir -p ~/go
brew install go
```

## Node.js (with NVM)

Installs the Node Version Manager (NVM) and the latest LTS version of Node.js. It also installs the following global npm packages:
- `@angular/cli`
- `nx`
- `husky`
- `node-sass`
- `node-gyp`

```shell
# Installs nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$(getLastestNVM)/install.sh | bash

# Installs Node.js
nvm install 20

# Installs global npm packages
npm install --location=global @angular/cli
npm install --location=global nx
npm install --location=global husky
npm install --location=global node-sass
npm install --location=global node-gyp
```

A `~/.huskyrc` file is also created to ensure that nvm is loaded before husky runs.

## Ruby

Installs the Ruby programming language.

```shell
brew install ruby
```

## Google Cloud Components

Installs the Google Cloud SDK and the following components:
- `app-engine-go`
- `app-engine-python`
- `app-engine-python-extras`
- `kubectl`
- `docker-credential-gcr`

```shell
brew install --cask google-cloud-sdk
gcloud components install app-engine-go --quiet
gcloud components install app-engine-python --quiet
gcloud components install app-engine-python-extras --quiet
gcloud components install kubectl --quiet
gcloud components install docker-credential-gcr --quiet
```
Loading