GitLab CI YAML Builder and Validator

Fill in stages and jobs, or paste an existing .gitlab-ci.yml, and get valid YAML, keyword checks with line numbers, a needs graph and a simulator that shows which jobs run.

Berjalan dalam pelayar anda. Fail anda tidak pernah meninggalkan peranti. Lihat cara menyemaknya

…

Cara melakukannya

  1. 1
    Pick a start

    Load the Node.js, Python, Docker or blank template, or paste an existing file in validate mode.

  2. 2
    Set the pipeline

    List the stages, the default image, variables and the workflow rules.

  3. 3
    Edit each job

    Write the script, add rules, choose needs and set cache and artifacts.

  4. 4
    Read the issues

    Fix every error; tap a line number to see the line it refers to.

  5. 5
    Check the flow

    Open the graph and the simulator for a push, merge request, tag and schedule.

  6. 6
    Export

    Copy the YAML or download .gitlab-ci.yml and commit it to the repository root.

Tentang alat ini

This builder writes the .gitlab-ci.yml file that tells GitLab how to run your pipeline, and it checks files you already have. In build mode you work through forms instead of indentation: an ordered list of stages, a default image, global variables, a shared before_script, include lines and workflow rules that decide whether a pipeline is created at all. Each job has its own panel with the script, rules, needs, cache, artifacts, environment, runner tags, services, timeout, retry and parallel count. Hidden jobs whose names start with a dot work as templates, and extends merges them into real jobs the same way GitLab does: maps are merged key by key and lists are replaced. The YAML is printed with YAML 1.1 quoting, so values such as yes, no, on and 1.10 get quotes and are not turned into booleans or numbers by GitLab's Ruby parser. In validate mode you paste or open any .gitlab-ci.yml. js-yaml reads it, including anchors, merge keys and the !reference tag, and the checker walks every key with the rules from the keyword reference. Each finding points at a line number, and the code view highlights the line. Templates for a Node.js app, a Python package and a Docker image give you a working start, and every edit can be undone.

What the validator checks

YAML syntax errors and duplicate keys are reported with the line and column where parsing stopped, and tab indentation is flagged before anything else. Every job key is compared with the list of job keywords, so a typo such as scripts or artefacts is caught and the nearest valid keyword is suggested. A job without script or trigger is an error, and so is a stage that is not listed under stages. Needs are checked in four ways: the job must exist, it must not be hidden, it must not sit in a later stage and the needs must not form a cycle. Rules may only use if, changes, exists, when, allow_failure, variables, needs and start_in, and every if expression is parsed so a single equals sign or an unclosed bracket is caught. Durations for expire_in, start_in and timeout are checked against the formats GitLab accepts. Warnings cover images without a fixed tag, only and except, global keywords that belong under default, curl piped into a shell and literal secrets in scripts.

Graph and rules simulator

The graph tab draws one column per stage with each job as a rounded box and an arrow for every needs entry, so you can see which jobs start early. Manual jobs have a dashed border, and you can download the picture as an SVG file. The simulator sets CI_PIPELINE_SOURCE, the branch, the tag, the merge request IID and the changed files, then evaluates workflow rules and each job's rules from top to bottom, exactly as GitLab picks the first matching rule. Presets cover a push to the default branch, a feature branch, a merge request, a tag and a scheduled pipeline.

Worked example

Load the Node.js template. The generated file has 88 lines with 4 stages (install, test, build, deploy) and 5 jobs, and the validator reports no errors or warnings, only a note that the manual deploy rule has no allow_failure. Four jobs use needs, so the longest needs chain is 4 jobs: install, unit-tests, build and deploy-production. In the simulator, a push to main runs every job and offers deploy-production as a manual job. A push to feature/login runs the first four jobs, and deploy-production is not added because no rule matched. A merge request creates no pipeline, because the first workflow rule says never. Switch to validate mode and load the broken example: it gives 8 errors, 1 warning and 2 notes, including expire_in "2 weks" on line 13, stage tests on line 16, needs lint on line 17, a single equals sign in the rule on line 21 and the misspelt scripts keyword on line 28.

Limits

This is not GitLab's own CI Lint. Files pulled in with include are not fetched, so jobs and templates defined there are not checked, and CI/CD variables set in project settings are unknown unless you type them into the simulator. The simulator does not evaluate exists or rules:changes:compare_to. Run the pipeline editor's lint in your project before you rely on a new file.

Contoh berselesaian

Node.js template: 88 lines, 4 stages, 5 jobs, no errors; deploy-production is manual on main and not added on feature branches; the broken example gives 8 errors.

Ringkasnya

Soalan lazim

Is this the same as the CI Lint tool inside GitLab?

No. It runs in your browser with its own checks based on the keyword reference. It catches most structural mistakes, but only GitLab's lint can resolve includes, project variables and components.

Why are needs better than stages alone?

Without needs a job waits for every job in all earlier stages. With needs it starts as soon as the listed jobs finish, which can shorten a pipeline a lot. The graph shows these shortcuts as arrows.

Why does my job not run in merge request pipelines?

Jobs without rules do not run in merge request pipelines. Add a rule such as if: $CI_PIPELINE_SOURCE == "merge_request_event" to the job, and check the result in the simulator.

Can I import my existing .gitlab-ci.yml?

Yes. Paste or open it in validate mode and press Import into the form. Keys the form does not cover, such as trigger or secrets, are kept as they were and written back unchanged.

Does it understand anchors and !reference?

Yes. YAML anchors with the merge key are expanded when the file is read, and !reference [.job, script] tags are kept and written back in the short bracket form.

Is my pipeline file uploaded?

No. Parsing, checks and the graph all run in this page, and the work is saved only in this browser's local storage.

Percuma sepenuhnyaTiada bayaran, tiada pendaftaran
Fail kekal peribadiSemuanya berjalan dalam pelayar anda
Mudah dalam bahasa andaTersedia dalam banyak bahasa