-
Notifications
You must be signed in to change notification settings - Fork 6
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
MB-9717 Make local installation easier with a script #16
Conversation
Should the fresh-press script reference the Truss forked version instead of the original? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This worked for me. I'm not using nix
someone with nix
might want to review.
I cloned the repo and ran the bash script. There were a lot of updates to install and then MilMove Docs opened in browser.
I did not remove my yarn installation and the script worked. So that would also be good to test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also threw in GitHub's CLI tool since it's a nice thing to have.
I think it might be good to make this one optional? Like a prompt asking if they want it. Mainly because I think it'd be good to keep this down to the required things so we aren't installing things on people's machines that they don't want.
I also agree that the script should likely be updated to point at the Truss repo, thought that'll be in the fresh-brew
repo.
I tested this locally with nix
disabled and after uninstalling yarn
, but I couldn't get rid of nodenv
because of other dependencies with my setup. It seems to work fine though (and in fact calls out a bunch of things I might have wrong with my homebrew setup haha). I seem to be able to switch between this and nix fairly easily so I think it's working well in that respect.
For those who prefer to use Homebrew instead of Nix, rather than make them perform a bunch of steps manually, we can automate the entire setup with a single command. Here's how the script works: 1. There's a trussworks/fresh-brew repo that has a main script that only installs the bare minimum any dev would need: Homebrew (which also installs Apple's Command Line Tools if they're not there yet), and Git. I also threw in GitHub's CLI tool since it's a nice thing to have. This script is idempotent, meaning it can be run over and over safely. If you already have Homebrew, Git and the GH CLI, it will automatically update them. 2. The script also allows you to customize it by adding more tools you want to install, or commands you want to run, on a project by project basis. To install additional tools that you want to install via Homebrew, you add a `Brewfile.local` to your project's repo, like the one I added here that installs `yarn` and `nodenv`. Additional commands and bash scripts go in a `fresh-brew.local` file, like the one I added in this PR which uses `nodenv` to install the Node version specified in the local `.node-version` file. This means that if we want to update the Node version for everyone, all we need to do is update the `.node-version` file, and people can run the `fresh-press` script from the `fresh-brew` repo and it will update everything automatically. ## Notes for reviewers To test this, if you already have `nodenv` and/or `yarn` installed, please uninstall them. Then, pull this branch to your machine, and run the command in the README: ``` bash <(curl -s https://raw.githubusercontent.com/trussworks/fresh-brew/main/fresh-press) ``` This single command should take care of the entire setup, and should automatically run the server and launch the docs repo in your browser. Signed-off-by: Moncef Belyamani <[email protected]>
For those who prefer to use Homebrew instead of Nix, rather than make
them perform a bunch of steps manually, we can automate the entire
setup with a single command.
Here's how the script works:
only installs the bare minimum anyone wishing to contribute would need: Homebrew (which also
installs Apple's Command Line Tools if they're not there yet), and Git.
I also threw in GitHub's CLI tool since it's a nice thing to have. This
script is idempotent, meaning it can be run over and over safely. If you
already have Homebrew, Git and the GH CLI, it will automatically update
them.
want to install, or commands you want to run, on a project by project
basis. To install additional tools that you want to install via
Homebrew, you add a
Brewfile.local
to your project's repo, like theone I added here that installs
yarn
andnodenv
. Additionalcommands and bash scripts go in a
fresh-brew.local
file, like theone I added in this PR which uses
nodenv
to install the Node versionspecified in the local
.node-version
file. This means that if wewant to update the Node version for everyone, all we need to do is
update the
.node-version
file, and people can run thefresh-press
script from the
fresh-brew
repo and it will update everythingautomatically.
Notes for reviewers
To test this, if you already have
nodenv
and/oryarn
installed,please uninstall them. Then, pull this branch to your machine, and run
the command in the README:
This single command should take care of the entire setup, and should
automatically run the server and launch the docs repo in your browser.
Signed-off-by: Moncef Belyamani [email protected]