Skip to content
🎉 Launch sale:50% off everything over $22 — automatically applied at checkout· ends Aug 2Shop the sale →
DevOps AI ToolKit
Newsletter
All prompts
AI for GitLab CI/CD Difficulty: Advanced ClaudeChatGPT

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

More GitLab CI/CD prompts & error guides

Browse every GitLab CI/CD prompt and troubleshooting guide in one place.

Free download · 368-page PDF

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.