Skip to main content

Kodo CI

Project description

koci - Universal CI Definition Tool

One CI file to rule them all.

koci is a universal CI definition tool that lets you:

  • 🚀 Run CI pipelines locally using Docker/Podman
  • 🔄 Export to any platform - GitHub Actions, Jenkins, GitLab CI, and more
  • 📦 Start simple, scale up - One file that grows with your project

Why koci?

Every CI platform has its own syntax. When you switch platforms or need to run CI locally, you're stuck rewriting everything. koci solves this with a universal format that:

  • Works locally with Docker containers
  • Exports to major CI platforms with one command
  • Validates your pipeline before you push
  • Watches files and auto-runs on changes

Installation

pip install koci

Or install from source:

git clone https://github.com/kodogen/koci.git
cd koci
pip install -e .

Quick Start

1. Create a Pipeline

koci init

This detects your project type (Node.js, Python, Go, etc.) and creates a koci.yml:

version: "1"
name: my-app

stages:
  - build
  - test

jobs:
  install:
    stage: build
    image: node:20-alpine
    steps:
      - run: npm ci
    artifacts:
      paths:
        - node_modules/

  test:
    stage: test
    image: node:20-alpine
    needs: [install]
    steps:
      - run: npm test
    artifacts:
      consume: [install]

2. Validate

koci validate

3. Run Locally

koci run

Run a specific stage:

koci run --stage test

4. Export to CI Platform

# GitHub Actions
koci export github-actions

# Jenkins
koci export jenkins

# GitLab CI
koci export gitlab

Commands

Command Description
koci init Create a starter koci.yml
koci validate Validate pipeline syntax
koci run Execute pipeline locally
koci run --stage <name> Run specific stage
koci export <platform> Export to CI platform
koci watch Auto-run on file changes
koci visualize Show pipeline graph
koci info Show pipeline summary

Pipeline Syntax

Stages & Jobs

stages:
  - build
  - test
  - deploy

jobs:
  compile:
    stage: build
    image: node:20
    steps:
      - run: npm ci
      - run: npm run build

Dependencies

jobs:
  test:
    stage: test
    needs: [compile]  # Wait for compile to finish
    steps:
      - run: npm test

Artifacts

jobs:
  build:
    stage: build
    steps:
      - run: npm run build
    artifacts:
      paths:
        - dist/

  deploy:
    stage: deploy
    needs: [build]
    artifacts:
      consume: [build]  # Get artifacts from build job
    steps:
      - run: ./deploy.sh

Matrix Builds

jobs:
  test:
    stage: test
    matrix:
      node: [18, 20, 22]
      os: [alpine, slim]
    steps:
      - run: npm test

Services

services:
  test:  # Services for the test stage
    - image: postgres:15
      env:
        POSTGRES_PASSWORD: test
    - image: redis:7

jobs:
  integration:
    stage: test
    steps:
      - run: npm run test:integration

Conditions

Simple conditions:

jobs:
  deploy:
    when: branch == 'main'
    steps:
      - run: ./deploy.sh

Complex conditions:

jobs:
  deploy:
    if: ${{ success() && env.DEPLOY_ENABLED == 'true' }}
    steps:
      - run: ./deploy.sh

Export Targets

GitHub Actions

koci export github-actions
# Creates .github/workflows/ci.yml

Jenkins

koci export jenkins
# Creates Jenkinsfile

GitLab CI

koci export gitlab
# Creates .gitlab-ci.yml

Configuration

Secrets

Create .koci.secrets.yml (gitignored):

env:
  AWS_ACCESS_KEY: xxx
  AWS_SECRET_KEY: xxx

Global Environment

env:
  NODE_ENV: production
  CI: "true"

Default Image

defaults:
  image: node:20-alpine
  working_directory: /app

Development

# Setup
make virtualenv
source env/bin/activate

# Run tests
make test

# Run koci
koci --help

Roadmap

  • Core pipeline execution
  • GitHub Actions export
  • Jenkins export
  • GitLab CI export
  • CircleCI export
  • Concourse export
  • Azure Pipelines export
  • Parallel job execution
  • Remote cache support
  • Plugin system

License

MIT License - see LICENSE.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

koci-0.1.1.tar.gz (56.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

koci-0.1.1-py3-none-any.whl (70.5 kB view details)

Uploaded Python 3

File details

Details for the file koci-0.1.1.tar.gz.

File metadata

  • Download URL: koci-0.1.1.tar.gz
  • Upload date:
  • Size: 56.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for koci-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6744ab04e2f84ff8d3f5e03d8ab2fb3ff9f7333523d16667d1d136e178be8200
MD5 9ed5f1b3526219ad2bd0c15dd3454f9b
BLAKE2b-256 557ec5ccd3a71ec4ef684cca2d693eb6977f00155e1329b6cce33b5a3396e9a8

See more details on using hashes here.

File details

Details for the file koci-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: koci-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 70.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for koci-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 90a33850c4dbab05e03a8fad494f6a3e5f9793548cd80a7f688c30202e4998af
MD5 e0f14696e8cc4fb572371b335b0f2eb9
BLAKE2b-256 2e7cf0bec1ac0a628b3de9b88717627a282a071be938e9ab853830cd7ec366d7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page