No project description provided
Project description
mise-en-gitlab
Overview
mise-en-gitlab converts a project's mise.toml into a GitLab CI configuration fragment.
Define build/test/deploy tasks once in Mise and generate a valid .gitlab-ci.yml snippet or child-pipeline include from those definitions.
Why
- Keep your CI config DRY by treating Mise as the single source of truth for tasks.
- Generate stable, schema-checked GitLab jobs directly from your task graph.
- Make pipelines self-describing and reproducible across environments.
What gets generated
stageslist derived from each[tasks.<name>.ci.stage]- One GitLab job per
[tasks.<name>.ci]block - Preserves ordering and relationships (
needs,rules,artifacts, and other common keys) - Optional global defaults via
[ci.defaults](e.g., default image)
Installation
pip install mise-en-gitlab
Requirements: Python 3.8+.
Quick Start
Generate a GitLab CI YAML from mise.toml:
mise-en-gitlab generate --in mise.toml --out generated-ci.yml
--in: path to input mise file (default:mise.toml)--out: path to write the generated YAML (default:generated-ci.yml)-v/--verbose: show debug logs
Exit codes:
0: success1: invalid or missing CI-annotated tasks2: malformed TOML or schema error
Input: Mise tasks annotated for CI
Any task under [tasks.<name>] becomes a GitLab job when it includes a [tasks.<name>.ci] table.
Minimal example:
[tasks.build]
run = "pnpm build"
[tasks.build.ci]
stage = "build"
image = "node:20"
rules = ["if: '$CI_COMMIT_BRANCH' == 'main'"]
artifacts = ["dist/"]
[tasks.test]
run = "pytest"
[tasks.test.ci]
stage = "test"
image = "python:3.12"
[tasks.deploy]
run = "./scripts/deploy.sh"
[tasks.deploy.ci]
stage = "deploy"
rules = ["if: '$CI_COMMIT_TAG'"]
needs = ["build", "test"]
Global defaults
You can set a default image for all jobs (unless overridden by a job) using:
[ci.defaults]
image = "alpine:3.19"
Output: GitLab CI YAML
Given the input above, the generated YAML (simplified) looks like:
stages:
- build
- test
- deploy
build:
stage: build
image: node:20
script:
- pnpm build
rules:
- if: '$CI_COMMIT_BRANCH' == 'main'
artifacts:
paths:
- dist/
test:
stage: test
image: python:3.12
script:
- pytest
deploy:
stage: deploy
script:
- ./scripts/deploy.sh
rules:
- if: '$CI_COMMIT_TAG'
needs:
- build
- test
Notes on normalization:
rulesaccepts a list of strings (e.g.,"if: <expr>") or dicts ({ if = "...", when = "..." }); both are normalized to GitLab's object form.artifactscan be a list (treated aspaths) or a table (paths,when,expire_in,reports, etc.).runcan be a string or a string list; it maps toscript.- Unrecognized keys under
[tasks.<name>.ci]are passed through as-is (common keys likebefore_script,after_script,tags,timeout,retry,interruptible,allow_failure,when,resource_group,parallel,services,variablesare supported by pass-through).
Using with Dynamic Child Pipelines
Upload the generated file as an artifact and include it in a downstream:
generate-from-mise:
stage: build
image: python:3.12
script:
- pip install mise-en-gitlab
- mise-en-gitlab generate --in mise.toml --out generated-ci.yml
artifacts:
paths:
- generated-ci.yml
trigger:
stage: test
trigger:
include:
- artifact: generated-ci.yml
job: generate-from-mise
strategy: depend
Definition of Done (internal quality bar)
When mise-en-gitlab generate runs on a valid mise.toml:
- Produces valid GitLab CI YAML with proper
stages - Outputs one job per
[tasks.*.ci]block with preserved relationships - Output is compatible with GitLab’s pipeline linter
- Works as a dynamic pipeline include without further manual edits
- Non-CI tasks are ignored
- CLI exits with appropriate codes and readable feedback for errors
Troubleshooting
- Exit code
1: No[tasks.<name>.ci]sections found. - Exit code
2: TOML parse error or schema error (e.g., missingstagein a CI-annotated task,needsnot a list of strings, missingrun). - Python 3.8–3.10 use
tomliunder the hood; Python 3.11+ usetomllib.
Development
This repo includes a mise.toml with common tasks:
# Install tool versions and generate a pre-commit hook powered by mise tasks
mise run setup-dev
# Run the full precommit pipeline (format, lint, type-check, tests)
mise precommit
Or directly with Hatch:
hatch fmt
hatch run lizard
hatch run pydoclint
hatch run pylint
hatch run typecheck
hatch run test
License
mise-en-gitlab is distributed under the terms of the MIT license.
mise-en-gitlab
Table of Contents
Installation
pip install mise-en-gitlab
License
mise-en-gitlab is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mise_en_gitlab-0.1.0.tar.gz.
File metadata
- Download URL: mise_en_gitlab-0.1.0.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
397529f26f2c1893c792fcd43a040fd9de10ad787f2cbaf05848b3a887054659
|
|
| MD5 |
28eaae303237f8936a5036a126df511a
|
|
| BLAKE2b-256 |
f23eb951a4729535861d97fa9308e6b2fecdf86060101a8ed54390ba0c4f4cab
|
Provenance
The following attestation bundles were made for mise_en_gitlab-0.1.0.tar.gz:
Publisher:
python-publish.yml on williamkborn/mise-en-gitlab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mise_en_gitlab-0.1.0.tar.gz -
Subject digest:
397529f26f2c1893c792fcd43a040fd9de10ad787f2cbaf05848b3a887054659 - Sigstore transparency entry: 695357565
- Sigstore integration time:
-
Permalink:
williamkborn/mise-en-gitlab@d278d3680f34cfd14698a1def3023e05b294939e -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/williamkborn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d278d3680f34cfd14698a1def3023e05b294939e -
Trigger Event:
release
-
Statement type:
File details
Details for the file mise_en_gitlab-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mise_en_gitlab-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3f82e7a3d16d868644114481811e23ab7924ce5f7db78a8462ad83ada696012
|
|
| MD5 |
976e8565c8441a8a358b796a7aec6e48
|
|
| BLAKE2b-256 |
50ae3c8f462b90eb0897c915f7e879e6a8fdbc84535d7f85b0caf8987d7875c8
|
Provenance
The following attestation bundles were made for mise_en_gitlab-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on williamkborn/mise-en-gitlab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mise_en_gitlab-0.1.0-py3-none-any.whl -
Subject digest:
f3f82e7a3d16d868644114481811e23ab7924ce5f7db78a8462ad83ada696012 - Sigstore transparency entry: 695357584
- Sigstore integration time:
-
Permalink:
williamkborn/mise-en-gitlab@d278d3680f34cfd14698a1def3023e05b294939e -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/williamkborn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d278d3680f34cfd14698a1def3023e05b294939e -
Trigger Event:
release
-
Statement type: