Skip to content

Commit 2fef5ba

Browse files
address reviews
Signed-off-by: prashant-gurung899 <prasantgrg777@gmail.com>
1 parent 1a66dea commit 2fef5ba

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

src/assets/woodpeckerCI/woodpeckerCI.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ authorName: Prashant Gurung
44
authorAvatar: https://avatars.githubusercontent.com/u/53248463?v=4
55
authorLink: https://github.com/prashant-gurung899
66
createdAt: July 3, 2025
7-
tags: CI/CD
7+
tags: CI/CD, Woodpecker, starlark, docker-compose, Traefik, WCCS
88
banner: https://raw.githubusercontent.com/JankariTech/blog/woodpecker-ci-starlark/src/assets/woodpeckerCI/images/cover.png
99
---
1010

1111
## Background
12-
Continuous Integration (CI) tools are vital for automating the testing and deployment of modern software. One such open-source tool is Woodpecker CI, a lightweight CI/CD system. Woodpecker CI is an open-source continuous integration and delivery platform that helps developers automate building, testing, and deploying their code. It is a community-driven fork and successor of the popular Drone CI project, sharing many design principles and compatibility with Drone pipelines. Traditionally, Woodpecker pipelines are written in YAML. But with the rise of programmable pipelines, we now have the flexibility to define our CI configuration using Starlark — a Python-like configuration language.
12+
Continuous Integration tools are essential to build and test modern software automatically and regularly. Woodpecker CI is one such open-source tool, a lightweight CI/CD system. Woodpecker CI is an open-source continuous integration and delivery system that help developers in automating deployment, builds, and testing of code. It's an open-source fork and alternative to the popular Drone CI project with numerous design similarities and Drone pipeline compatibility. Traditionally, Woodpecker pipelines are YAML, but now that programmable pipelines are in vogue, we can finally have the liberty of defining our CI configuration through Starlark — a Python-ish config language.
1313

14-
In this blog, I’ll walk you through setting up Woodpecker CI with Traefik as a reverse proxy and integrating it with WCCS (Woodpecker CI Config Service) to convert Starlark configurations into YAML files, enabling us to write pipelines in .woodpecker.star files. Here's a high-level view of what we'll cover:
14+
In this article, I will walk you through setting up Woodpecker CI with Traefik as a reverse proxy and WCCS (Woodpecker CI Config Service) to convert Starlark configurations into YAML files so that we can write pipelines in .woodpecker.star files. Here is a high-level overview of what we are going through:
1515

1616
- Spinning up a Woodpecker server with Traefik
1717

@@ -24,12 +24,14 @@ In this blog, I’ll walk you through setting up Woodpecker CI with Traefik as a
2424
By the end, you’ll be able to write CI pipelines in Starlark and dynamically convert them to YAML during runtime.
2525

2626
## Prepare Woodpecker secrets via .env
27+
Create a `.env` file to store your environment variables.
28+
2729
```console
2830
#Your woodpecker host
2931
WOODPECKER_HOST=https://<your-ci-server>
3032

3133

32-
# GitHub OAuth Secrets
34+
# GitHub OAuth app Secrets - We'll create OAuth app later
3335
WOODPECKER_GITHUB_CLIENT=XXXXXXXXXXXXXXXX
3436
WOODPECKER_GITHUB_SECRET=XXXXXXXXXXXXXXXXXXXXXXXX
3537

@@ -38,12 +40,13 @@ WOODPECKER_GITHUB_SECRET=XXXXXXXXXXXXXXXXXXXXXXXX
3840
WOODPECKER_AGENT_SECRET=<generated-secret>
3941

4042

41-
# Let’s Encrypt contact email (Traefik will use this)
43+
# letsEncrypt contact email (Traefik will use this)
4244
ACME_EMAIL=admin@example.com
4345
```
4446

4547
## Traefik Configuration
46-
Traefik plays a crucial role in this architecture by handling all the networking complexities - SSL termination, routing, and load balancing
48+
Traefik plays a crucial role in this architecture by handling all the networking complexities - SSL termination, routing, and load balancing.
49+
Create a `docker-compose.yml` file and add the following Traefik service configuration:
4750

4851
```yml
4952
version: "3.9"
@@ -75,12 +78,12 @@ services:
7578
This configuration:
7679
7780
- Sets up Traefik to listen on ports 80 and 443
78-
- Configures Let's Encrypt for automatic SSL certificate management
81+
- Configures automatic SSL certificate management via [letsEncrypt](https://letsencrypt.org/)
7982
- Enables Docker provider to automatically detect new services
8083
- Mounts necessary volumes for certificate storage and Docker socket access
8184
8285
## Setting Up Woodpecker Server and Agent
83-
Now that we have Traefik running, let's set up the Woodpecker server and agent services. Here's the essential setup:
86+
Now that we have Traefik running, let's set up the Woodpecker server and agent services in the same `docker-compose.yml` file:
8487

8588
```yml
8689
woodpecker-server:
@@ -135,7 +138,7 @@ Now that we have Traefik running, let's set up the Woodpecker server and agent s
135138
136139
To connect GitHub with Woodpecker:
137140
138-
1. Register a new OAuth application in your GitHub developer settings.
141+
1. Register a new OAuth application in your GitHub developer [settings](https://github.com/settings/applications/new).
139142
140143
2. Set the callback URL to `https://<your-ci-server>/authorize`
141144

@@ -163,7 +166,7 @@ Woodpecker will automatically add the necessary webhooks to the repo.
163166

164167
After enabling your desired repository, there's one more thing that you need to do i.e. to set pipeline config path.
165168

166-
- From the settings of your Woodpecker Server, go to repositories and click on the enabled repo's settings icon as shown below:
169+
- From the settings of your Woodpecker server, go to `Repositories` and click on the enabled repo's settings icon as shown below:
167170

168171
![Settings](https://raw.githubusercontent.com/JankariTech/blog/woodpecker-ci-starlark/src/assets/woodpeckerCI/images/settings.png)
169172

@@ -181,6 +184,7 @@ Store that public key into `keys/public.pem` in the same directory level as your
181184
## Setting Up WCCS-Woodpecker CI Config Service (Starlark Conversion Service)
182185
The Woodpecker Config Conversion Service (WCCS) is a lightweight web service created and maintained by [Opencloud-eu](https://opencloud.eu/en). It enables Woodpecker CI to convert pipeline definitions written in Starlark into standard YAML on the fly by receiving a signed POST request from Woodpecker.
183186
You can easily deploy WCCS using their official Docker image available on Docker Hub: [opencloudeu/wccs](https://hub.docker.com/r/opencloudeu/wccs).
187+
Update your `docker-compose.yml` to include the WCCS service:
184188
```yml
185189
wccs:
186190
image: opencloudeu/wccs:latest
@@ -241,7 +245,7 @@ def main(ctx):
241245

242246
## Triggering Your First CI Run
243247
Now that you have your `.woodpecker.star` file ready, commit and push it to your GitHub repository and then, open a Pull Request from your branch <your-branch-name> to master.
244-
Once the PR is created, Woodpecker will automatically send the build request to WCCS, fetch the pipeline config, and start your first CI run. You can head over to the Woodpecker UI to watch the build logs in real time.
248+
Once the PR is created, Woodpecker will automatically send the build request to WCCS, fetch the pipeline configuration, and start your first CI run. You can head over to the Woodpecker UI to watch the build logs in real time.
245249

246250
![Converted Yaml](https://raw.githubusercontent.com/JankariTech/blog/woodpecker-ci-starlark/src/assets/woodpeckerCI/images/converted.png)
247251

0 commit comments

Comments
 (0)