mirror of
https://github.com/Partysun/woodpecker-ci-demo.git
synced 2026-05-17 16:48:05 +08:00
Pull mirror of Partysun/woodpecker-ci-demo for Woodpecker CI testing
- Rust 52.8%
- Makefile 19.3%
- Dockerfile 17.1%
- Hurl 10.8%
| .woodpecker | ||
| src | ||
| tests | ||
| .dockerignore | ||
| .gitignore | ||
| .rustfmt.toml | ||
| .secrets.example.yaml | ||
| Cargo.lock | ||
| Cargo.toml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| LICENSE-APPACHE | ||
| LICENSE-MIT | ||
| Makefile | ||
| mise.toml | ||
| README.md | ||
Woodpecker CI Demo
A minimal Rust web application demonstrating CI/CD pipelines with Woodpecker CI.
Overview
This project is a simple HTTP API built with Axum that showcases:
- Multi-stage CI pipeline: Unit tests, Docker image building, integration tests, and deployment
- Health checks: Built-in health check endpoint and Docker compose healthcheck configuration
- Integration testing: HTTP tests using Hurl
- Local CI execution: Run the full pipeline locally with
woodpecker-cli
Quick Start
Prerequisites
- Rust 1.93+ (or Docker)
- Hurl (for integration tests)
- Woodpecker CLI (for local CI execution)
- Docker & Docker Compose (for containerized development)
Running Locally
With Cargo:
cargo run
Or with Docker Compose:
docker-compose up
The application listens on http://localhost:4000 by default. Override with:
APP_PORT=8080 cargo run
You can use mise for managing requirements, tools and tasks:
mise tasks
Name Description build Build Docker image, run integration tests, and push to registry using Woodpecker CI lint Format and lint Rust code test Run tests using Woodpecker CI test-hurl Run integration tests using Hurl against local server (http://localhost:4000)
Configuration
Woodpecker Secrets
Set in .secrets.yaml for local running CI/CD pipeline:
docker_username: Registry usernamedocker_password: Registry passwordsecret_registry_base_path: Registry URLdeploy_wci_script: Deployment script path on woodpecker ci agent with local backend
License
All code in this repository is dual-licensed under either:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)