Skip to content

Commit

Permalink
docs(cli with docker): update (#2793)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adnan Rahić authored Jun 22, 2023
1 parent c156889 commit 827c5a0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 32 deletions.
23 changes: 11 additions & 12 deletions docs/docs/ci-cd-automation/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,22 @@ If you want to see more examples with other CI/CD tools, let us know by [opening

Tracetest is designed to work with all CI/CD platforms and automation tools. To enable Tracetest to run in CI/CD environments, make sure to [install the Tracetest CLI](../getting-started/installation.mdx) and configure it to access your [Tracetest server](../configuration/server.md).

### Running Tracetest CLI from Docker
To read more about integrating Tracetest with CI/CD tools, check out tutorials in our blog:

- [Integrating Tracetest with GitHub Actions in a CI pipeline](https://kubeshop.io/blog/integrating-tracetest-with-github-actions-in-a-ci-pipeline)
- [50% Faster CI Pipelines with GitHub Actions](https://tracetest.io/blog/50-faster-ci-pipelines-with-github-actions)

Many integrations with CI/CD tools can be accomplished by running the [Tracetest CLI](../cli/configuring-your-cli) to execute a test against a remote Tracetest server. If you do not want to install the Tracetest CLI in your environment, you can choose to directly execute it from a Docker image.
## Running Tracetest CLI from Docker

Many integrations with CI/CD tools can be accomplished by running the [Tracetest CLI](../cli/configuring-your-cli) to execute a test against a remote Tracetest server. If you do not want to install the Tracetest CLI in your environment, you can choose to directly execute it from a Docker image.

**How to Use**:

Use the command below, substituting the following placeholders:
- <your-tracetest-server-url> - the URL to the running Tracetest server you wish to execute the test on. Example: http://localhost:11633/
- <file-path> - The path to the saved Tracetest test. Example: ./mytest.yaml

```sh
- `your-tracetest-server-url` - the URL to the running Tracetest server you wish to execute the test on. Example: `http://localhost:11633/`
- `file-path` - The path to the saved Tracetest test. Example: `./mytest.yaml`

```bash wordWrap=true
docker run --rm -it -v$(pwd):$(pwd) -w $(pwd) --network host --entrypoint tracetest kubeshop/tracetest:latest -s <your-tracetest-server-url> test run --definition <file-path> --wait-for-result
```

To read more about integrating Tracetest with CI/CD tools, check out tutorials in our blog:

- [Integrating Tracetest with GitHub Actions in a CI pipeline](https://kubeshop.io/blog/integrating-tracetest-with-github-actions-in-a-ci-pipeline)



28 changes: 8 additions & 20 deletions docs/docs/cli/configuring-your-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,46 @@

Our web interface makes it easier to visualize your traces and add assertions, but sometimes a CLI is needed for automation. The CLI was developed for users creating tests and executing them each time a change is made in the system, so Tracetest can detect regressions and check service Service Level Objectives (SLOs).


## **Available Commands**
## Available Commands

Here is a list of all available commands and how to use them:

### **Configure**
Configure your CLI to connect to your Tracetest server.
### Configure

Configure your CLI to connect to your Tracetest server.

**How to Use**:


```sh
tracetest configure
```

If you want to set values without having to answer questions from a prompt, you can provide the flag `--endpoint` to define the server endpoint.


```sh
tracetest configure --endpoint http://my-tracetest-server:11633
```

### **Test List**

### Test List

Allows you to list all tests.


**How to Use**:


```sh
tracetest test list
```

### **Run a Test**
### Run a Test

Allows you to run a test by referencing a [test definition file](./creating-tests).

> Note: If the definition file contains the field `id`, this command will not create a new test. Instead, it will update the test with that ID. If that test doesn't exist, a new one will be created with that ID on the server.

Every time the test is run, changes are detected and, if any change is introduced, we use Tractest's [versioning](../concepts/versioning) mechanism to ensure that it will not cause problems with previous test runs.

**How to Use**:


```sh
tracetest test run --definition <file-path>
```
Expand All @@ -62,17 +54,13 @@ tracetest test run --definition <file-path>

There are times when it is easier to directly execute the Tracetest CLI from a Docker image rather than installing the CLI on your local machine. This can be convenient when you wish to execute the CLI in a CI/CD environment.


**How to Use**:

Use the command below, substituting the following placeholders:
- <your-tracetest-server-url> - The URL to the running Tracetest server you wish to execute the test on. Example: http://localhost:11633/

- <file-path> - The path to the saved Tracetest test. Example: ./mytest.yaml

- `your-tracetest-server-url` - The URL to the running Tracetest server you wish to execute the test on. Example: `http://localhost:11633/`
- `file-path` - The path to the saved Tracetest test. Example: `./mytest.yaml`

```sh
```bash wordWrap=true
docker run --rm -it -v$(pwd):$(pwd) -w $(pwd) --network host --entrypoint tracetest kubeshop/tracetest:latest -s <your-tracetest-server-url> test run --definition <file-path> --wait-for-result
```


0 comments on commit 827c5a0

Please sign in to comment.