This repository contains a demo project for the course
“Methoden und Werkzeuge der Softwareentwicklung (MWdSE)”.
The goal is to show how Dagger can be used as a lightweight, cross-platform CI pipeline to:
- install dependencies inside a container
- run automated tests
- build a small TypeScript/Node.js application
- export build artifacts to the user’s Desktop
The code is intentionally simple so that CI/CD concepts stay in focus.
- A minimal TypeScript/Node.js project (
src/) - A small unit test suite using Vitest (
tests/) - A Dagger pipeline defined in
ci.mtsthat:- uses a
node:22-alpinecontainer - runs
npm installandnpm test - runs
npm run build - exports build artifacts to a folder on the user’s Desktop
- uses a
This repo is meant as a teaching example, not a production-ready application.
To run the pipeline locally, you need:
- Git
- Node.js (version 18 or later)
- TypeScript (
tsc) - Docker Desktop (installed and running)
- Dagger CLI
-
Install Homebrew (if not already installed):
See: https://brew.sh -
Install Node.js and Git:
brew install node git -
Install TypeScript globally:
npm install -g typescript -
Install Docker Desktop:
brew install --cask docker -
Install Dagger CLI:
brew install dagger/tap/dagger
-
Install Node.js via winget (or from nodejs.org):
winget install OpenJS.NodeJS -
Install TypeScript globally:
npm install -g typescript -
Install Docker Desktop:
Download from: https://www.docker.com/products/docker-desktop
After installation, start Docker so that the Docker daemon is running. -
Install Dagger CLI via winget:
winget install Dagger.Cli
The CI pipeline is defined in ci.mts and executed via the Dagger CLI.
git clone https://github.com/moearzini/mwdse-dagger
cd mwdse-dagger
npm install
npm test
Recommended commands:
dagger run --progress plain node --loader ts-node/esm ./ci.mts
Explanation:
-
dagger run
Starts a Dagger session and runs the pipeline. -
--progress plain
Shows a simple, readable log output (good for demos and screenshots). -
node --loader ts-node/esm
Tells Node to execute the TypeScript moduleci.mtsdirectly usingts-nodein ESM mode. -
./ci.mts
The pipeline definition file. It:- mounts the project into a
node:22-alpinecontainer - runs
npm install - runs
npm test - runs
npm run build - exports the compiled build and a container image as artifacts to a folder on the user’s Desktop (e.g.
mwdse-dagger-artifacts)
- mounts the project into a
After a successful run, you will find the exported build artifacts in a directory created on your Desktop.
In order to run an artefact, use...
docker load < app-image.tar
docker images
docker run -it <image_name> /bin/sh
src/ # Application logic (TypeScript)
tests/ # Unit tests (Vitest)
ci.mts # Dagger CI pipeline definition
package.json # Node.js project configuration
tsconfig.json # TypeScript configuration
README.md # This documentation
This project is intended for educational use only as part of the MWdSE course @DHBW Mannheim.