32
41
Fork
You've already forked website
53

[BLOG] tutorial to run Forgejo as a service in Woodpecker #55

Closed
earl-warren wants to merge 2 commits from earl-warren:wip-woodpecker into main
pull from: earl-warren:wip-woodpecker
merge into: forgejo:main
forgejo:main
forgejo:monthly-2026-05
forgejo:mahlzahn-eslint-js
forgejo:preview-link-status
forgejo:nightfire
forgejo:2022年12月14日-main
Contributor
Copy link
No description provided.
Ghost left a comment
Copy link

Minor nits.

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

s/14/15/ to be consistent with the file name
earl-warren marked this conversation as resolved
@ -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)"

Suggestion: add "(that is what `detach: true` is for)"
earl-warren marked this conversation as resolved
@ -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/

s/wich/script which/
earl-warren marked this conversation as resolved
Ghost added the due date 2023年01月15日 2023年01月12日 19:10:26 +01:00
@ -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.
First-time contributor
Copy link

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).

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).
Author
Contributor
Copy link

Replaced with just as a MySQL service. The reader is otherwise assumed to know Woodpecker and Forgejo otherwise it will be useless to them.

Replaced with `just as a MySQL service`. The reader is otherwise assumed to know Woodpecker and Forgejo otherwise it will be useless to them.
First-time contributor
Copy link

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).

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](https://woodpecker-ci.org/docs/next/usage/services) 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.
First-time contributor
Copy link

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.

> 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.
Author
Contributor
Copy link

This is indeed obvious to a Woodpecker CI user. See https://woodpecker-ci.org/docs/next/usage/services

This is indeed obvious to a Woodpecker CI user. See https://woodpecker-ci.org/docs/next/usage/services
earl-warren marked this conversation as resolved
@ -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`:
```
First-time contributor
Copy link

Using yaml after the 3 back-ticks will likely give color highlighting.

Using `yaml` after the 3 back-ticks will likely give color highlighting.
earl-warren marked this conversation as resolved
@ -0,0 +42,4 @@
The result of the pipeline above will be the Forgejo version displayed like this:
```
First-time contributor
Copy link

Same, highlighting as json may look better.

Same, highlighting as `json` may look better.
earl-warren marked this conversation as resolved
Ghost approved these changes 2023年01月13日 21:22:05 +01:00

@circlebuilder are you satisfied with the changes?

@circlebuilder are you satisfied with the changes?
First-time contributor
Copy link

Just unresolved one issue to address.

Just unresolved [one issue](https://codeberg.org/forgejo/website/pulls/55#issuecomment-772050) to address.

@circlebuilder maybe such a technically oriented blog post is not good material for the news section of Forgejo?

@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.

The publication date should be edited as this discussion continues and won't be concluded today.
First-time contributor
Copy link

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.

> 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?

So you think this is in scope for the news/blog section as it is?
Author
Contributor
Copy link

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.

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

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No reviewers
Labels
Clear labels
404
Broken links or missing content
Accessibility
Accessibility
Blog post
Documentation
Forgejo Documentation
Internationalisation
i18n and l10n
User research - Accessibility
Requires input about accessibility features, likely involves user testing.
User research - Blocked
Do not pick as-is! We are happy if you can help, but please coordinate with ongoing redesign in this area.
User research - Community
Community features, such as discovering other people's work or otherwise feeling welcome on a Forgejo instance.
User research - Config (instance)
Instance-wide configuration, authentication and other admin-only needs.
User research - Errors
How to deal with errors in the application and write helpful error messages.
User research - Filters
How filter and search is being worked with.
User research - Future backlog
The issue might be inspiring for future design work.
User research - Git workflow
AGit, fork-based and new Git workflow, PR creation etc
User research - Labels
Active research about Labels
User research - Moderation
Moderation Featuers for Admins are undergoing active User Research
User research - Needs input
Use this label to let the User Research team know their input is requested.
User research - Notifications/Dashboard
Research on how users should know what to do next.
User research - Rendering
Text rendering, markup languages etc
User research - Repo creation
Active research about the New Repo dialog.
User research - Repo units
The repo sections, disabling them and the "Add more" button.
User research - Security
User research - Settings (in-app)
How to structure in-app settings in the future?
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

2023年01月16日

Dependencies

No dependencies set.

Reference
forgejo/website!55
Reference in a new issue
forgejo/website
No description provided.
Delete branch "earl-warren:wip-woodpecker"

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?