Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cfpb/mac-setup
Scripts and baseline dotfiles for setting up a new CFPB developer Mac
https://github.com/cfpb/mac-setup
Last synced: 17 days ago
JSON representation
Scripts and baseline dotfiles for setting up a new CFPB developer Mac
- Host: GitHub
- URL: https://github.com/cfpb/mac-setup
- Owner: cfpb
- License: cc0-1.0
- Created: 2019-09-11T16:46:38.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-06-11T15:27:53.000Z (7 months ago)
- Last Synced: 2024-06-11T21:44:00.169Z (7 months ago)
- Language: Shell
- Size: 186 KB
- Stars: 6
- Watchers: 28
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# CFPB Mac setup scripts
Configurations and scripts for setting up a new developer Mac.
**Note**: These scripts currently target macOS Big Sur (11). If you need to setup a Mojave (10.14) Mac, please use the [tagged release for Mojave](https://github.com/cfpb/mac-setup/releases/tag/10.14).
## Automated software setup
The `mac_setup.sh` script installs a standard developer environment
on new Mac computers, with the goal of making the machine ready to set up
[consumerfinance.gov](https://github.com/cfpb/consumerfinance.gov) for local
development.This includes, but is not limited to:
- [Homebrew](http://brew.sh/)
- Up-to-date or cfgov-refresh-specific versions of several core developer tools:
- Git (replacing Apple Git)
- [git-secrets](https://github.com/awslabs/git-secrets) hooks
for ensuring you don't accidentally commit bad stuff
- pyenv and pyenv-virtualenvwrapper with Python 3.8.12
- pipx for running isolated Python applications
- **IMPORTANT:** [Downgrading Docker Desktop via pipx for use with cf-gov refresh](https://cfpb.github.io/cfgov-refresh/installation/#4-run-docker-compose-for-the-first-time)
- nvm with the latest LTS release of Node
- Yarn with the following installed globally:
- yo
- generator-cf
- generator-node
- snyk
- Minimal dotfiles with the necessary bits for all of the above to work as expected### Running the script
1. Run the following command from the root of this repository
to initiate the installation: `./mac_setup.sh`.
1. After the script completes, run `source ~/.zshenv`
to apply the changes to your current terminal session,
or just close the session and open a new one.Scripts to set up each component can also be run individually:
- `preflight.sh` to check network access and local configuration before proceeding
- `homebrew_setup.sh` to install and configure [Homebrew](http://brew.sh/)
- `python_setup.sh` to install and configure [our Python development environment](https://github.com/cfpb/development/blob/master/guides/installing-python.md)
- `node_setup.sh` to install and configure our Node development environment
- `git_setup.sh` to install and configure git and [git-secrets](https://github.com/cfpb/development/blob/master/tools/git-secrets-patterns/README.md)
- `dotfiles_setup.sh` to apply our standard dotfiles### Backups
- If any dotfiles (`~/.bash_profile`, `~/.bashrc`, etc.) would be overwritten,
they will be backed up to `~/_`.
- If you have anything in your `~/.git-templates/` folder and
your global `.gitconfig` has `init.templateDir` value is set to that location,
your files will be left in place
and the `init.templateDir` will be changed to `~/.git-templates/git-secrets/`.## GitHub/SSH setup
The `github_setup.sh` script has two functions:
1. Ensure the `~/.gitconfig` file in your home directory has a name and
email address configured so that you get credit for your commits.
1. Create an SSH key (if it doesn't already exist) for integration with
GitHub.com and CFPB's GitHub Enterprise instance.
- If generating an SSH key, you will be prompted
to create a password for the key.After the script completes, you will be provided with a "public key"
and the following instructions for applying the key to your two GitHub accounts:1. Log into your GitHub accounts and paste this public key in the GitHub Settings website
1. [Directions for adding keys](https://help.github.com/en/articles/adding-a-new-ssh-key-to-your-github-account)The script is safe to run even if you have already
configured your `.gitconfig` and/or SSH key.
In this case, the tool will simply output your existing details for your review.### Running the script
Run the following command from the root of this repository: `./github_setup.sh`.