Skip to content

Commit 3cbbcb0

Browse files
pathakharshitclaude
andcommitted
docs(ci-cd): make cloud replay CI guidance generic and drop --trigger
Generalize the cloud replay section so it applies to any CI control plane (GitHub Actions, GitLab CI, Jenkins) and to both Keploy Cloud and self-hosted setups, remove the --trigger flag, and fix the API key secret reference (secrets.KEPLOY_API_KEY). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Harshit Pathak <harshit07pathak@gmail.com>
1 parent cc72222 commit 3cbbcb0

1 file changed

Lines changed: 33 additions & 17 deletions

File tree

versioned_docs/version-4.0.0/ci-cd/github.md

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ Keploy can be integrated with GitHub by two methods:-
2323
1. [Using Shell Scripts](#shell-scripts)
2424
2. [Using GitHub Actions](#github-actions)
2525

26-
If you run a self-hosted Keploy cluster, you can also [run Cloud Replay from CI](#cloud-replay-self-hosted-in-github-actions).
26+
You can also [run cloud replay from your CI pipeline](#running-cloud-replay-in-ci).
2727

2828
## Shell Scripts
2929

30-
GitHub scripts are the easiest way to integrate Keploy with GitHub. We will be using [express-mongoose](https://github.com/keploy/samples-typescript/tree/main/express-mongoose) sample-application for the example. You can either add the following script to yout `github workflow` or create a new worflow `.github/workflows/keploy-test.yml`:-
30+
GitHub scripts are the easiest way to integrate Keploy with GitHub. We will be using [express-mongoose](https://github.com/keploy/samples-typescript/tree/main/express-mongoose) sample-application for the example. You can either add the following script to your `github workflow` or create a new workflow `.github/workflows/keploy-test.yml`:-
3131

3232
```yaml
3333
- name: Checkout Commit
@@ -219,35 +219,45 @@ _And... voila! You have successfully integrated keploy in GitHub CI pipeline
219219

220220
---
221221

222-
## Cloud Replay (Self-Hosted) in GitHub Actions
222+
## Running cloud replay in CI
223223

224-
If you run a self-hosted Keploy cluster, you can replay your recorded test sets against the cluster directly from CI with no browser login. CI authenticates using an **API key**, and the replay runs **inside your cluster**.
224+
Keploy cloud replay re-runs your recorded test sets from a CI pipeline. It works the same way on any CI control plane — GitHub Actions, GitLab CI, Jenkins, and others — and with both Keploy Cloud and a self-hosted Keploy setup. The pipeline authenticates with an API key from an environment variable, so it needs no browser login.
225225

226-
> Cloud Replay is an **Enterprise** feature and uses the Enterprise Keploy binary (installed in the workflow below), not the open-source binary.
226+
> Cloud replay uses the Enterprise Keploy binary, which the steps below install.
227+
228+
The flow is the same on every CI system:
229+
230+
1. Store your Keploy API key as a secret and expose it as the `KEPLOY_API_KEY` environment variable. The Keploy CLI reads this variable automatically.
231+
2. Install the Enterprise Keploy binary on the runner.
232+
3. Run `keploy cloud replay` with your application and cluster details.
233+
234+
Because the replay command is plain CLI, it is identical across CI systems:
227235

228236
```bash
229-
export KEPLOY_API_KEY="<API_KEY>"
237+
keploy cloud replay \
238+
--app "<NAMESPACE>.<DEPLOYMENT>" \
239+
--cluster "<CLUSTER>" \
240+
--namespace "<NAMESPACE>" \
241+
--delay <DELAY>
230242
```
231243

232-
The Keploy CLI reads `KEPLOY_API_KEY` from the environment automatically, so no `keploy login` or browser step is needed in CI.
233-
234-
### 2. Add the workflow
244+
Replace `<NAMESPACE>`, `<DEPLOYMENT>`, and `<CLUSTER>` with your own values, and set `<DELAY>` to cover your application's startup time.
235245

236-
Create `.github/workflows/keploy-cloud-replay.yml`:
246+
### Example: GitHub Actions
237247

238248
```yaml
239249
jobs:
240250
keploy-cloud-replay:
241251
runs-on: ubuntu-latest
242252
env:
243-
KEPLOY_API_KEY: ${{ KEPLOY_API_KEY }}
253+
KEPLOY_API_KEY: ${{ secrets.KEPLOY_API_KEY }}
244254
steps:
245-
- name: Install Keploy (Enterprise)
255+
- name: Install Keploy
246256
run: |
247257
curl --silent --location "https://keploy.io/ent/dl/latest/enterprise_linux_amd64" -o /tmp/keploy
248258
sudo chmod +x /tmp/keploy && sudo mv /tmp/keploy /usr/local/bin/keploy
249259
250-
- name: Cloud Replay (in-cluster)
260+
- name: Cloud replay
251261
run: |
252262
keploy cloud replay \
253263
--app "<NAMESPACE>.<DEPLOYMENT>" \
@@ -256,11 +266,17 @@ jobs:
256266
--delay <DELAY>
257267
```
258268

259-
Replace `<NAMESPACE>`, `<DEPLOYMENT>`, and `<CLUSTER>` with your own values, and set `<DELAY>` to cover your application's startup time.
269+
### Other CI systems
270+
271+
The steps are identical elsewhere — expose `KEPLOY_API_KEY` from your secret store, install the binary, then run the command. For example, GitLab CI uses a masked CI/CD variable and Jenkins uses a credentials binding:
260272

261-
> - `--delay` is how long Keploy waits for the app to become ready before sending requests. If it is shorter than the app's cold-start time, the tests can all fail.
262-
> - The CI runner must be able to reach your cluster's ingress URL.
273+
```bash
274+
export KEPLOY_API_KEY="$KEPLOY_API_KEY" # injected from your CI secret store
275+
curl --silent --location "https://keploy.io/ent/dl/latest/enterprise_linux_amd64" -o /tmp/keploy
276+
sudo chmod +x /tmp/keploy && sudo mv /tmp/keploy /usr/local/bin/keploy
277+
keploy cloud replay --app "<NAMESPACE>.<DEPLOYMENT>" --cluster "<CLUSTER>" --namespace "<NAMESPACE>" --delay <DELAY>
278+
```
263279

264-
The step passes when the replay summary reports `Failed 0`.
280+
> `--delay` sets how long Keploy waits for the application to become ready before it sends requests. If it is shorter than the application's startup time, the tests can fail, so set it to comfortably cover the boot time.
265281

266282
Hope this helps you out, if you still have any questions, reach out to us .

0 commit comments

Comments
 (0)