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

MB-9717 Make local installation easier with a script #16

Merged
merged 2 commits into from
Oct 14, 2021
Merged

Conversation

monfresh
Copy link
Contributor

@monfresh monfresh commented Oct 8, 2021

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 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.
  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]

@monfresh monfresh requested review from rogeruiz and ahobson October 8, 2021 19:16
@monfresh monfresh changed the title Make local installation easier with a script MB-9717 Make local installation easier with a script Oct 8, 2021
@monfresh monfresh requested a review from a team October 13, 2021 16:50
@ronaktruss
Copy link
Contributor

Should the fresh-press script reference the Truss forked version instead of the original?

Copy link
Contributor

@jacquelineIO jacquelineIO left a 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.

Copy link
Contributor

@felipe-lee felipe-lee left a 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]>
@monfresh monfresh merged commit d47f0f9 into main Oct 14, 2021
@monfresh monfresh deleted the fresh-brew branch October 14, 2021 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants