Skip to content

Commit cc72222

Browse files
committed
update: CI_CD Docs
Signed-off-by: Harshit Pathak <harshit07pathak@gmail.com>
1 parent 9fc8f6b commit cc72222

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

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

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ 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).
27+
2628
## Shell Scripts
2729

2830
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`:-
@@ -215,4 +217,50 @@ sudo -E keploy test -c node src/app.js --delay 10 --path ./
215217

216218
_And... voila! You have successfully integrated keploy in GitHub CI pipeline 🌟_
217219

220+
---
221+
222+
## Cloud Replay (Self-Hosted) in GitHub Actions
223+
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**.
225+
226+
> Cloud Replay is an **Enterprise** feature and uses the Enterprise Keploy binary (installed in the workflow below), not the open-source binary.
227+
228+
```bash
229+
export KEPLOY_API_KEY="<API_KEY>"
230+
```
231+
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
235+
236+
Create `.github/workflows/keploy-cloud-replay.yml`:
237+
238+
```yaml
239+
jobs:
240+
keploy-cloud-replay:
241+
runs-on: ubuntu-latest
242+
env:
243+
KEPLOY_API_KEY: ${{ KEPLOY_API_KEY }}
244+
steps:
245+
- name: Install Keploy (Enterprise)
246+
run: |
247+
curl --silent --location "https://keploy.io/ent/dl/latest/enterprise_linux_amd64" -o /tmp/keploy
248+
sudo chmod +x /tmp/keploy && sudo mv /tmp/keploy /usr/local/bin/keploy
249+
250+
- name: Cloud Replay (in-cluster)
251+
run: |
252+
keploy cloud replay \
253+
--app "<NAMESPACE>.<DEPLOYMENT>" \
254+
--cluster "<CLUSTER>" \
255+
--namespace "<NAMESPACE>" \
256+
--delay <DELAY>
257+
```
258+
259+
Replace `<NAMESPACE>`, `<DEPLOYMENT>`, and `<CLUSTER>` with your own values, and set `<DELAY>` to cover your application's startup time.
260+
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.
263+
264+
The step passes when the replay summary reports `Failed 0`.
265+
218266
Hope this helps you out, if you still have any questions, reach out to us .

0 commit comments

Comments
 (0)