-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix docs that fail after the fix in v0.45.1 (#1284)
* fix docs that fail after the fix in v0.45.1 * add two commands examples: latest vs. concrete versions Co-authored-by: Paul Balogh <[email protected]>
- Loading branch information
Showing
1 changed file
with
47 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,40 +8,73 @@ Using the [xk6 Docker image](https://hub.docker.com/r/grafana/xk6/) can simplify | |
|
||
## Building your first extension | ||
|
||
For example, to build a k6 v0.43.1 binary with the [`xk6-kafka`](https://github.com/mostafa/xk6-kafka) and [`xk6-output-influxdb`](https://github.com/grafana/xk6-output-influxdb) extensions, run one of the commands below, depending on your operating system: | ||
For example, to build a custom k6 binary with the latest versions of k6 and the [`xk6-kafka`](https://github.com/mostafa/xk6-kafka) and [`xk6-output-influxdb`](https://github.com/grafana/xk6-output-influxdb) extensions, run one of the commands below, depending on your operating system: | ||
|
||
<CodeGroup labels={["Linux", "Mac", "Windows PowerShell", "Windows"]}> | ||
|
||
```bash | ||
docker run --rm -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" grafana/xk6 build v0.43.1 \ | ||
--with github.com/mostafa/xk6-kafka@v0.17.0 \ | ||
--with github.com/grafana/xk6-output-influxdb@v0.3.0 | ||
docker run --rm -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" grafana/xk6 build \ | ||
--with github.com/mostafa/xk6-kafka \ | ||
--with github.com/grafana/xk6-output-influxdb | ||
``` | ||
|
||
```bash | ||
docker run --rm -e GOOS=darwin -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" \ | ||
grafana/xk6 build v0.43.1 \ | ||
--with github.com/mostafa/xk6-kafka@v0.17.0 \ | ||
--with github.com/grafana/xk6-output-influxdb@v0.3.0 | ||
grafana/xk6 build \ | ||
--with github.com/mostafa/xk6-kafka \ | ||
--with github.com/grafana/xk6-output-influxdb | ||
``` | ||
|
||
```powershell | ||
docker run --rm -e GOOS=windows -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" ` | ||
grafana/xk6 build v0.43.1 --output k6.exe ` | ||
--with github.com/mostafa/xk6-kafka@v0.17.0 ` | ||
--with github.com/grafana/xk6-output-influxdb@v0.3.0 | ||
grafana/xk6 build --output k6.exe ` | ||
--with github.com/mostafa/xk6-kafka ` | ||
--with github.com/grafana/xk6-output-influxdb | ||
``` | ||
|
||
```batch | ||
docker run --rm -e GOOS=windows -v "%cd%:/xk6" ^ | ||
grafana/xk6 build v0.43.1 --output k6.exe ^ | ||
--with github.com/mostafa/xk6-kafka@v0.17.0 ^ | ||
--with github.com/grafana/xk6-output-influxdb@v0.3.0 | ||
grafana/xk6 build --output k6.exe ^ | ||
--with github.com/mostafa/xk6-kafka ^ | ||
--with github.com/grafana/xk6-output-influxdb | ||
``` | ||
|
||
</CodeGroup> | ||
|
||
This creates a `k6` (or `k6.exe`) binary in the current working directory. | ||
This creates a `k6` (or `k6.exe`) binary in the current working directory. | ||
|
||
To build the binary with concrete versions, see the example below (k6 `v0.45.1`, xk6-kafka `v0.19.1`, and xk6-output-influxdb `v0.4.1`): | ||
|
||
<CodeGroup labels={["Linux", "Mac", "Windows PowerShell", "Windows"]}> | ||
|
||
```bash | ||
docker run --rm -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" grafana/xk6 build v0.45.1 \ | ||
--with github.com/mostafa/[email protected] \ | ||
--with github.com/grafana/[email protected] | ||
``` | ||
|
||
```bash | ||
docker run --rm -e GOOS=darwin -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" \ | ||
grafana/xk6 build v0.45.1 \ | ||
--with github.com/mostafa/[email protected] \ | ||
--with github.com/grafana/[email protected] | ||
``` | ||
|
||
```powershell | ||
docker run --rm -e GOOS=windows -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" ` | ||
grafana/xk6 build v0.45.1 --output k6.exe ` | ||
--with github.com/mostafa/[email protected] ` | ||
--with github.com/grafana/[email protected] | ||
``` | ||
|
||
```batch | ||
docker run --rm -e GOOS=windows -v "%cd%:/xk6" ^ | ||
grafana/xk6 build v0.45.1 --output k6.exe ^ | ||
--with github.com/mostafa/[email protected] ^ | ||
--with github.com/grafana/[email protected] | ||
``` | ||
|
||
</CodeGroup> | ||
|
||
## Breaking down the command | ||
|
||
|