Skip to content

Commit e039c2d

Browse files
update: CI_CD Docs (#880)
* docs: revamp CI/CD docs integration Signed-off-by: Harshit Pathak <harshit07pathak@gmail.com> * 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> * docs(ci-cd): add cloud replay section to GitLab and Jenkins docs Add the "Running cloud replay in CI" section to gitlab.md and jenkins.md, matching the section already in github.md. Each file has a system-specific example (GitLab masked variable / Jenkins withCredentials) but the core flow is the same: set KEPLOY_API_KEY from the CI secret store, install the Enterprise binary, run keploy cloud replay. Works with both Keploy Cloud and self-hosted. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Harshit Pathak <harshit07pathak@gmail.com> * docs(ci-cd): fix Vale spelling errors in cloud replay section Replace hardcode with hard-code and Jenkinsfile with Jenkins pipeline file to pass Vale spell check. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Harshit Pathak <harshit07pathak@gmail.com> * docs(ci-cd): fix duplicate section, add full YAML, address review comments - Remove duplicate Running cloud replay section that was stacked from two separate commits - Add name: and on: triggers to GitHub Actions YAML snippet so it is a complete, copy-pasteable workflow file - Consolidate steps with system-specific secret store instructions for GitHub Actions, GitLab CI, and Jenkins Fixes review comments from amaan-bhati. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Harshit Pathak <harshit07pathak@gmail.com> * docs(ci-cd): fix GitLab CI multi-line command to use shell continuation Use YAML block scalar (|) with backslash line continuations for the keploy cloud replay command, matching the Jenkins example style. The previous YAML plain scalar folding was non-idiomatic and misleading to readers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Harshit Pathak <harshit07pathak@gmail.com> * docs(ci-cd): clarify cloud replay only runs k8s-recorded test sets Add a clear note that cloud replay re-runs test sets recorded from a Kubernetes deployment, not local or other recordings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Harshit Pathak <harshit07pathak@gmail.com> --------- Signed-off-by: Harshit Pathak <harshit07pathak@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 9fc8f6b commit e039c2d

3 files changed

Lines changed: 164 additions & 1 deletion

File tree

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

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +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+
You can also [run cloud replay from your CI pipeline](#running-cloud-replay-in-ci).
27+
2628
## Shell Scripts
2729

28-
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`:-
2931

3032
```yaml
3133
- name: Checkout Commit
@@ -215,4 +217,61 @@ 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+
## Running cloud replay in CI
223+
224+
Keploy cloud replay re-runs test sets that were recorded from a Kubernetes deployment. It works with both **Keploy Cloud** and a **self-hosted Keploy** setup, and on any CI control plane — GitHub Actions, GitLab CI, Jenkins, and others.
225+
226+
### How authentication works
227+
228+
The CLI reads the `KEPLOY_API_KEY` environment variable automatically — no browser login needed.
229+
230+
- **Locally:** `export KEPLOY_API_KEY="<your-api-key>"` before running the command.
231+
- **In CI:** store the key as a secret in your CI system so it gets injected as an environment variable at runtime. Never hard-code it in your pipeline file.
232+
233+
> Cloud replay requires the Enterprise binary (`keploy.io/ent/dl/latest/enterprise_linux_amd64`), not the open-source one.
234+
235+
### Steps
236+
237+
1. **Store the API key** — add `KEPLOY_API_KEY` as a secret in your CI system.
238+
- GitHub Actions: go to **Settings → Secrets and variables → Actions → New repository secret**, name it `KEPLOY_API_KEY`.
239+
- GitLab CI: go to **Settings → CI/CD → Variables**, add it as a masked variable.
240+
- Jenkins: add a **Secret text** credential via **Manage Jenkins → Credentials**.
241+
2. **Install** the Enterprise Keploy binary on the runner.
242+
3. **Run** `keploy cloud replay` with your application and cluster details.
243+
244+
### Example: GitHub Actions
245+
246+
```yaml
247+
name: Keploy Cloud Replay
248+
249+
on:
250+
push:
251+
branches: [main]
252+
253+
jobs:
254+
keploy-cloud-replay:
255+
runs-on: ubuntu-latest
256+
env:
257+
KEPLOY_API_KEY: ${{ secrets.KEPLOY_API_KEY }}
258+
steps:
259+
- name: Install Keploy Enterprise
260+
run: |
261+
curl --silent --location "https://keploy.io/ent/dl/latest/enterprise_linux_amd64" -o /tmp/keploy
262+
sudo chmod +x /tmp/keploy && sudo mv /tmp/keploy /usr/local/bin/keploy
263+
264+
- name: Cloud replay
265+
run: |
266+
keploy cloud replay \
267+
--app "<NAMESPACE>.<DEPLOYMENT>" \
268+
--cluster "<CLUSTER>" \
269+
--namespace "<NAMESPACE>" \
270+
--delay <DELAY>
271+
```
272+
273+
Replace `<NAMESPACE>`, `<DEPLOYMENT>`, `<CLUSTER>`, and `<DELAY>` with your own values. Set `<DELAY>` (in seconds) to comfortably cover your application's startup time.
274+
275+
> `KEPLOY_API_KEY: ${{ secrets.KEPLOY_API_KEY }}` pulls the value from GitHub's secret store and makes it available as an environment variable in all subsequent steps.
276+
218277
Hope this helps you out, if you still have any questions, reach out to us .

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

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,49 @@ Integrating Keploy with GitLab CI automates the testing process, ensuring that t
146146
If you’re thinking, “This pipeline looks cool, but I need the _whole thing_ to integrate with your application!” — well, you're in luck! Check it out [here](https://github.com/keploy/samples-python) and get ready to copy-paste your way to success! ✨🚀
147147

148148
Hope this helps you out, if you still have any questions, reach out to us .
149+
150+
---
151+
152+
## Running cloud replay in CI
153+
154+
Keploy cloud replay re-runs test sets that were recorded from a Kubernetes deployment. It works with both **Keploy Cloud** and a **self-hosted Keploy** setup — the command is the same either way.
155+
156+
### How authentication works
157+
158+
The CLI reads the `KEPLOY_API_KEY` environment variable automatically. You do not need to pass it as a flag or log in through a browser.
159+
160+
- Locally: `export KEPLOY_API_KEY="<your-api-key>"` before running the command.
161+
- In CI: add the key as a masked CI/CD variable so the system injects it as an environment variable at runtime. Never hard-code it in your pipeline file.
162+
163+
In GitLab CI, go to **Settings → CI/CD → Variables**, add `KEPLOY_API_KEY` as a masked variable, and it is automatically available in all pipeline jobs as `$KEPLOY_API_KEY`.
164+
165+
### Steps
166+
167+
1. Add `KEPLOY_API_KEY` as a masked CI/CD variable (**Settings → CI/CD → Variables**).
168+
2. Install the Enterprise Keploy binary on the runner.
169+
3. Run `keploy cloud replay` with your application and cluster details.
170+
171+
> Cloud replay requires the Enterprise binary (`keploy.io/ent/dl/latest/enterprise_linux_amd64`), not the open-source one.
172+
173+
### Example: GitLab CI
174+
175+
```yaml
176+
keploy-cloud-replay:
177+
stage: test
178+
image: ubuntu:22.04
179+
# KEPLOY_API_KEY is injected automatically from the masked CI/CD variable
180+
script:
181+
- apt-get update -qq && apt-get install -y -qq curl sudo
182+
- curl --silent --location "https://keploy.io/ent/dl/latest/enterprise_linux_amd64" -o /tmp/keploy
183+
- chmod +x /tmp/keploy && mv /tmp/keploy /usr/local/bin/keploy
184+
- |
185+
keploy cloud replay \
186+
--app "<NAMESPACE>.<DEPLOYMENT>" \
187+
--cluster "<CLUSTER>" \
188+
--namespace "<NAMESPACE>" \
189+
--delay <DELAY>
190+
```
191+
192+
Replace `<NAMESPACE>`, `<DEPLOYMENT>`, `<CLUSTER>`, and `<DELAY>` with your own values. Set `<DELAY>` to cover your application's startup time (in seconds).
193+
194+
> Because `KEPLOY_API_KEY` is defined as a masked variable in GitLab, it is already present in the job's environment — no `export` step is needed.

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

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,61 @@ Testrun passed for testcase with id: "test-2"
171171
_And... voila! You have successfully integrated keploy in Jenkins CI/CD pipeline 🌟_
172172
173173
Hope this helps you out, if you still have any questions, reach out to us .
174+
175+
---
176+
177+
## Running cloud replay in CI
178+
179+
Keploy cloud replay re-runs test sets that were recorded from a Kubernetes deployment. It works with both **Keploy Cloud** and a **self-hosted Keploy** setup — the command is the same either way.
180+
181+
### How authentication works
182+
183+
The CLI reads the `KEPLOY_API_KEY` environment variable automatically. You do not need to pass it as a flag or log in through a browser.
184+
185+
- Locally: `export KEPLOY_API_KEY="<your-api-key>"` before running the command.
186+
- In CI: add the key to Jenkins' credentials store so the system injects it as an environment variable at runtime. Never hard-code it in your Jenkins pipeline file.
187+
188+
In Jenkins, go to **Manage Jenkins → Credentials**, add a **Secret text** credential with ID `keploy-api-key`, and use `withCredentials` in your pipeline to bind it to `KEPLOY_API_KEY`.
189+
190+
### Steps
191+
192+
1. Add `KEPLOY_API_KEY` as a **Secret text** credential in Jenkins (**Manage Jenkins → Credentials**).
193+
2. Install the Enterprise Keploy binary on the agent.
194+
3. Run `keploy cloud replay` with your application and cluster details.
195+
196+
> Cloud replay requires the Enterprise binary (`keploy.io/ent/dl/latest/enterprise_linux_amd64`), not the open-source one.
197+
198+
### Example: Jenkins Declarative Pipeline
199+
200+
```groovy
201+
pipeline {
202+
agent any
203+
stages {
204+
stage('Install Keploy Enterprise') {
205+
steps {
206+
sh '''
207+
curl --silent --location "https://keploy.io/ent/dl/latest/enterprise_linux_amd64" -o /tmp/keploy
208+
sudo chmod +x /tmp/keploy && sudo mv /tmp/keploy /usr/local/bin/keploy
209+
'''
210+
}
211+
}
212+
stage('Cloud replay') {
213+
steps {
214+
withCredentials([string(credentialsId: 'keploy-api-key', variable: 'KEPLOY_API_KEY')]) {
215+
sh '''
216+
keploy cloud replay \
217+
--app "<NAMESPACE>.<DEPLOYMENT>" \
218+
--cluster "<CLUSTER>" \
219+
--namespace "<NAMESPACE>" \
220+
--delay <DELAY>
221+
'''
222+
}
223+
}
224+
}
225+
}
226+
}
227+
```
228+
229+
Replace `<NAMESPACE>`, `<DEPLOYMENT>`, `<CLUSTER>`, and `<DELAY>` with your own values. Set `<DELAY>` to cover your application's startup time (in seconds).
230+
231+
> `withCredentials` binds the Jenkins secret to `KEPLOY_API_KEY` only for the duration of that stage — the CLI picks it up automatically.

0 commit comments

Comments
 (0)