
Dagger Has a Free API: CI/CD Pipelines as Code That Run Anywhere
Your CI pipeline works on GitHub Actions but breaks on GitLab CI. Dagger runs the same pipeline everywhere — because it runs in containers. What Is Dagger? Dagger lets you write CI/CD pipelines in TypeScript, Python, or Go. They run in containers, so they work identically on your laptop, GitHub Actions, GitLab CI, Jenkins, or any CI system. // ci/index.ts import { dag , Container , Directory , object , func } from " @dagger.io/dagger " @ object () class Ci { @ func () async build ( source : Directory ): Promise < string > { return await dag . container () . from ( " node:20 " ) . withDirectory ( " /app " , source ) . withWorkdir ( " /app " ) . withExec ([ " npm " , " install " ]) . withExec ([ " npm " , " run " , " build " ]) . stdout () } @ func () async test ( source : Directory ): Promise < string > { return await dag . container () . from ( " node:20 " ) . withDirectory ( " /app " , source ) . withExec ([ " npm " , " install " ]) . withExec ([ " npm " , " test " ]) . stdout () } @
Continue reading on Dev.to DevOps
Opens in a new tab



