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

docs: add instructions for testing a PR by installing a downloaded binary in the $PATH #5451

Merged
merged 8 commits into from
Nov 22, 2023
30 changes: 29 additions & 1 deletion docs/content/developers/building-contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

Download and unzip the appropriate binary and place it in your `$PATH`.

### Homebrew with macOS or Linux

If you’re using Homebrew, start by unlinking your current binary:

```
Expand All @@ -32,7 +34,7 @@
chmod +x ddev && sudo mv ddev /usr/local/bin/ddev
```

Verify the replacement worked by running `ddev -v`. The output should be something like `ddev version v1.19.1-42-g5334d3c1`, instead of the regular `ddev version v1.19.1`.
Verify the replacement worked by running `ddev -v`. The output should be something like `ddev version v1.22.5-alpha1-70-g0852fc2df`, instead of the regular `ddev version v1.22.5`.

!!!tip "macOS and Unsigned Binaries"
macOS doesn’t like these downloaded binaries, so you’ll need to bypass the automatic quarantine to use them:
Expand All @@ -52,6 +54,32 @@
brew link --force ddev
```

### Installing a Downloaded Binary in the `$PATH`

Normally, you can put any executable in your path, and it takes precedence, so you don't need to remove or disable an already installed DDEV instance, which we will use here. This example uses `~/bin`. `echo $PATH` and `which ddev` are valuable commands for debugging. Since not every distro has `~/bin` in `$PATH`, you can create the folder and add it to your path in `~/.bashrc` with these commands:

```
mkdir -p ~/bin
export PATH="~/bin:$PATH"
```

Next, unzip the Zip file you downloaded, make it executable, and move it to a folder in your path. Check with `echo $PATH`:

Check failure on line 66 in docs/content/developers/building-contributing.md

View workflow job for this annotation

GitHub Actions / Docs check (spellcheck, markdownlint, textlint)

[textlint] reported by reviewdog 🐶 Incorrect usage of the term: “Zip”, use “ZIP” instead (terminology) Raw Output: /home/runner/work/ddev/ddev/docs/content/developers/building-contributing.md:66:17: error: Incorrect usage of the term: “Zip”, use “ZIP” instead (terminology) (eslint.rules.terminology)

```
unzip ddev.zip
chmod +x ddev && mv ddev ~/bin
```

Now, close and reopen your terminal, and verify the replacement worked by running `ddev version`. The output should be something like `DDEV version v1.22.3-39-gfbb878843`, instead of the regular `DDEV version v1.22.3`.

You need to run `ddev poweroff` and `ddev start` to download the Docker images that it needs.

After you’re done testing, you can delete your downloaded executable, restart your terminal, and again use the standard DDEV:

```
rm ~/bin/ddev
```

## Open in Gitpod

[Gitpod](https://www.gitpod.io) provides a quick, preconfigured DDEV experience in the browser for testing a PR easily without the need to set up an environment. In any PR you can use the URL `https://gitpod.io/#https://github.com/ddev/ddev/pulls/<YOUR-PR>` to open that PR and build it in Gitpod.
Expand Down