Jenkins to GitLab CI/CD Migration Prompt
Translate Jenkinsfiles and freestyle jobs into idiomatic `.gitlab-ci.yml` — map stages, agents, credentials, shared libraries, and plugins to GitLab-native equivalents with a phased cutover.
- Target user
- Platform teams retiring Jenkins for GitLab CI
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a migration architect who has moved dozens of teams off Jenkins onto GitLab CI without a freeze longer than a weekend.
I will provide:
- My Jenkinsfile(s) (declarative or scripted) and/or freestyle job configs
- Shared libraries / global pipeline functions used
- Plugins relied on (Credentials, Pipeline Utility, Slack, Artifactory, etc.)
- Agent/node labels and how build executors are provisioned
- Constraints (can't break prod deploys, gradual cutover required)
Your job:
1. **Map the primitives** — produce a translation table: Jenkins `stage`→GitLab `stage`/job, `agent`/node label→runner `tags`, `environment{}`→`variables:`, `credentials()`→masked/protected CI variables or Vault, `post{}`→`after_script`/`rules`, `when{}`→`rules:`, shared-library funcs→`include:`+`extends`/`!reference`, `parallel`→`parallel`/`needs` DAG.
2. **Handle credentials safely** — explicitly call out that Jenkins credential bindings become CI/CD variables (masked + protected), and which secrets should move to Vault/External Secrets instead of being pasted. Flag any plaintext secrets in the Jenkinsfile.
3. **Rebuild shared libraries** — convert global functions into `include:` templates + hidden `.job` anchors; show one concrete function-to-template conversion.
4. **Translate a full pipeline** — take my actual Jenkinsfile and emit the equivalent `.gitlab-ci.yml`, preserving stage order, artifact passing (`stash/unstash`→`artifacts`/`dependencies`/`needs`), and conditional logic.
5. **Cutover plan** — run both systems in parallel: GitLab pipeline non-blocking first, compare outputs, then flip the protected branch / deploy job to GitLab and disable the Jenkins trigger. Define a rollback to Jenkins.
6. **Call out gaps** — Jenkins features with no clean GitLab analog (certain plugins, `input` timeouts, matrix nesting) and the recommended workaround.
7. **Validate** — checklist: same artifacts produced, same deploy targets, secrets resolve, build times comparable, branch protections enforced.
Output: (a) the translation table, (b) the converted `.gitlab-ci.yml`, (c) the credentials/secrets migration list, (d) one shared-library→template example, (e) the phased cutover + rollback runbook.
Bias toward: idiomatic GitLab (DAG `needs`, `rules`, `include`) over line-by-line transliteration, and never moving a secret into plaintext.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
GitHub Actions to GitLab CI/CD Migration Prompt
Convert GitHub Actions workflows into `.gitlab-ci.yml` — map jobs, marketplace actions, matrix builds, OIDC, secrets, and reusable workflows to GitLab-native equivalents.
-
GitLab CI/CD k6 Load Test Performance Gate Prompt
Design a .gitlab-ci.yml stage that runs k6 load/performance tests against a review or staging environment, enforces threshold-based pass/fail gates, and surfaces results as artifacts and metrics reports in merge requests.
-
GitLab CI/CD Publish to the Package Registry (npm, Maven, generic) Prompt
Design .gitlab-ci.yml jobs that build and publish versioned artifacts to the project or group Package Registry using CI_JOB_TOKEN auth, with proper version gating, immutability, and consumer install config.
-
GitLab CI/CD Windows Runner & PowerShell Pipeline Prompt
Design .gitlab-ci.yml pipelines that run on Windows runners (shell or docker-windows executor) with correct PowerShell shell handling, tag targeting, path/quoting fixes, and mixed Linux/Windows stages.
More GitLab CI/CD prompts & error guides
Browse every GitLab CI/CD prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.