[BLOG] tutorial to run Forgejo as a service in Woodpecker #55
earl-warren:wip-woodpecker into main
Minor nits.
@ -0,0 +1,47 @@
---
title: Forgejo as a Woodpecker CI service
publishDate: 2023年01月14日
s/14/15/ to be consistent with the file name
@ -0,0 +32,4 @@
- curl http://forgejo/api/v1/version
```
The `detach` keyword runs the `forgejo` step in the background and moves to the `version` step immediately. It takes a few seconds for the Forgejo server to come up: this is the reason for the `sleep 10`. When Forgejo is run from the command line like so:
Suggestion: add "(that is what detach: true is for)"
@ -0,0 +38,4 @@
docker run --name forgejo -e GITEA__security__INSTALL_LOCK=true -d codeberg.org/forgejo-experimental/forgejo:1.18
```
it runs the `/usr/bin/entrypoint` which starts the server, waiting for incoming requests. But when run from Woodpecker CI, the list of `commands` is run instead and the Forgejo server does not start implicitly. It needs to be started explicitly, in the background, by calling `/usr/bin/entrypoint`. After a `sleep 5` it is ready to create a new user which is done with `admin user create ...`. It must then `wait` on the Forgejo server, otherwise it will terminate immediately instead of waiting for the pipeline to finish.
s/wich/script which/
@ -0,0 +2,4 @@
title: Forgejo as a Woodpecker CI service
publishDate: 2023年01月14日
tags: ['woodpecker', 'tutorial']
excerpt: A tutorial to run Forgejo as a service in the Woodpecker CI, just as MySQL.
Somewhat confusing when unfamiliar with Forgejo and/or Woodpecker. I infer that "just as MySQL" means that the CI runs as user MySQL? The summary may also include mention why I should consider that, which isn't clear in the article yet (other than somehow related to running tests).
Replaced with just as a MySQL service. The reader is otherwise assumed to know Woodpecker and Forgejo otherwise it will be useless to them.
In follow-up to @dachary asking my feedback, I have following thoughts..
The blog says:
it is useful to run a detached (in the background, AKA a service) MySQL server, as explained in the Woodpecker CI documentation
Yet the referenced doc does not mention the usefulness. So why is it useful is an open question. Why would someone take the effort?
Other than that.. should knowledge of Woodpecker be assumed in the blog? And should knowledge of the usefulness also be assumed?
I argue that Woodpecker is not just any random CI. Instead it is THE preferred CI (say, like Forgejo's 'reference CI'). There are tons of CI softwares, but this is the one that has Forgejo's special attention. And also it is the one that Codeberg has adopted for similar reasons, and for which they offer an integrated CI service for.
Given all that a bit more introductive text would be my recommendation, so that people learn about Forgejo's preferred approach (and the nice FOSS alignment it brings, which is part of project philosophy).
@ -0,0 +5,4 @@
excerpt: A tutorial to run Forgejo as a service in the Woodpecker CI, just as MySQL.
---
When running tests in [Woodpecker CI](https://woodpecker-ci.org/), it is useful to run a detached (in the background, AKA a service) MySQL server, as explained in [the Woodpecker CI documentation](https://woodpecker-ci.org/docs/next/usage/services). For that to work, the initial user is provided as an environment variable and created when the server starts.
it is useful to run a detached (in the background, AKA a service) MySQL server
I would wonder here: Why in particular is it useful? I could not find that in the Woodpecker doc as well, so maybe a bit of extra explanation may be given.
For that to work, the initial user is provided as an environment variable and created when the server starts.
I do not see the env variable that sets a user. Maybe for someone in-the-know of Woodpecker this is obvious, but for someone new / just-curious, this is confusing.
This is indeed obvious to a Woodpecker CI user. See https://woodpecker-ci.org/docs/next/usage/services
@ -0,0 +9,4 @@
Forgejo does not automatically create a user and it needs to be done via the command line, as shown in the following `.woodpecker.yml`:
```
Using yaml after the 3 back-ticks will likely give color highlighting.
@ -0,0 +42,4 @@
The result of the pipeline above will be the Forgejo version displayed like this:
```
Same, highlighting as json may look better.
@circlebuilder are you satisfied with the changes?
Just unresolved one issue to address.
@circlebuilder maybe such a technically oriented blog post is not good material for the news section of Forgejo?
The publication date should be edited as this discussion continues and won't be concluded today.
maybe such a technically oriented blog post is not good material for the news section of Forgejo?
OT here, but when I first saw the "News" section I thought "Wouldn't it be better to just change it to 'Blog' section, so it has this broader scope?" --> created #65 for that.
So you think this is in scope for the news/blog section as it is?
Thanks for you reviews, I don't have time to address them now but I'll keep them in mind for the next blog post.
Pull request closed
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?