mirror of
https://codeberg.org/Codeberg/Documentation.git
synced 2026-06-16 05:13:54 -07:00
chore: linter & spelling
This commit is contained in:
parent
258064e926
commit
9e3c0c6ed0
5 changed files with 28 additions and 31 deletions
|
|
@ -11,6 +11,8 @@
|
|||
"npm"
|
||||
],
|
||||
"words": [
|
||||
"woodpeckerci",
|
||||
"riscv",
|
||||
"codeberg",
|
||||
"editview",
|
||||
"forgejo",
|
||||
|
|
|
|||
|
|
@ -7,4 +7,5 @@ https://codeberg.org/username/repo.git
|
|||
https://username.codeberg.page/**
|
||||
https://openclipart.org/**
|
||||
https://www.gnu.org/**
|
||||
https://translate.codeberg.org
|
||||
https://translate.codeberg.org
|
||||
https://stackoverflow.com/**
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
eleventyNavigation:
|
||||
key: AddingSelfHostedAgents
|
||||
title: Adding Self-Hosted Agents
|
||||
title: Adding Self-Hosted Agents
|
||||
parent: CI
|
||||
---
|
||||
|
||||
Codeberg's CI resources are run by volunteers, and as such have some limitations in terms of shared resources. However, it is not necessary to self-host and administer your own full CI instance as you can add your own Woodpecker agents to your user or organization.
|
||||
Codeberg's CI resources are run by volunteers, and as such have some limitations in terms of shared resources. However, it is not necessary to self-host and administer your own full CI instance as you can add your own Woodpecker agents to your user or organization.
|
||||
|
||||
Some example use-cases where a self-hosted agent are recommended include: when you want faster feedback from CI, to handle long-running or resource-intensive jobs, creating specialized environments for specific archictures, hardware-in-the-loop testing, or setting up larger networked integration tests.
|
||||
Some example use-cases where a self-hosted agent are recommended include: when you want faster feedback from CI, to handle long-running or resource-intensive jobs, creating specialized environments for specific architectures, hardware-in-the-loop testing, or setting up larger networked integration tests.
|
||||
|
||||
This guide will walk you through [setting up your own Woodpecker agent](https://woodpecker-ci.org/docs/administration/configuration/agent) to communicate with Codeberg's CI infrastructure and configuring your workflows to use it.
|
||||
|
||||
|
|
@ -24,18 +24,16 @@ Before deploying the agent, you need to obtain an agent token from Codeberg's Wo
|
|||
To do so, please follow the instructions immediately below for users, and follow the instructions below that for organizations.
|
||||
|
||||
1. Go to the agents page
|
||||
1. For users, go to the [Codeberg Woodpecker CI User Agent settings](https://ci.codeberg.org/user/agents)
|
||||
|
||||
2. For organizations:
|
||||
1. Go to the [Codeberg Woodpecker CI Repos Page](https://ci.codeberg.org/)
|
||||
|
||||
2. Click on a repository in the organization you're adding the agent to.
|
||||
|
||||
3. Click on the organization name in the top left.
|
||||
|
||||
4. Click on the settings icon to access the organization settings in the top right.
|
||||
|
||||
5. Click on the agents tab.
|
||||
1. For users, go to the [Codeberg Woodpecker CI User Agent settings](https://ci.codeberg.org/user/agents)
|
||||
2. For organizations:
|
||||
|
||||
1. Go to the [Codeberg Woodpecker CI Repos Page](https://ci.codeberg.org/)
|
||||
2. Click on a repository in the organization you're adding the agent to.
|
||||
3. Click on the organization name in the top left.
|
||||
4. Click on the settings icon to access the organization settings in the top right.
|
||||
|
||||
5. Click on the agents tab.
|
||||
|
||||
2. Click add agent.
|
||||
|
||||
|
|
@ -57,7 +55,7 @@ The following configurations are modified to work with Codeberg's CI service fro
|
|||
|
||||
{% admonition "warning" "Agent tokens must be kept secret" %}
|
||||
|
||||
Tokens are added as the `WOODPECKER_AGENT_SECRET` environment variable to avoid leaks.
|
||||
Tokens are added as the `WOODPECKER_AGENT_SECRET` environment variable to avoid leaks.
|
||||
|
||||
{% endadmonition %}
|
||||
|
||||
|
|
@ -85,7 +83,7 @@ Woodpecker also has a container to automatically scale agents. This is not requi
|
|||
|
||||
### Managing agents with Kubernetes and Helm
|
||||
|
||||
Alternatively, Kubernetes can aid in managing your agents. It provides automatic scaling, metrics, topology management and whole host of other features that can be tuned for a particular project. For more details, [please see the Helm chart for Woodpecker Agents](https://github.com/woodpecker-ci/helm/blob/main/charts/woodpecker/charts/agent/README.md).
|
||||
Alternatively, Kubernetes can aid in managing your agents. It provides automatic scaling, metrics, topology management and whole host of other features that can be tuned for a particular project. For more details, [please see the Helm chart for Woodpecker Agents](https://github.com/woodpecker-ci/helm/blob/main/charts/woodpecker/charts/agent/README.md).
|
||||
|
||||
Only the agent chart is required.
|
||||
|
||||
|
|
@ -147,21 +145,19 @@ steps:
|
|||
|
||||
You can also add labels to the agent's configuration that can be used in workflows. Labels are key-value maps assigned to specific agents by using the `WOODPECKER_AGENT_LABELS` variable.
|
||||
|
||||
For example, say you're creating an IoT project that needs a machine with a specific peripheral, such as a LoRa radio, for testing. You have an agent that has the module attached and you need a way to tell Woodpecker to use that particular machine. [Radio hardware often depends on what part of the world you're in,](https://en.wikipedia.org/wiki/ITU_Region) you also want specify where your agent is located.
|
||||
For example, say you're creating an IoT project that needs a machine with a specific peripheral, such as a LoRa radio, for testing. You have an agent that has the module attached and you need a way to tell Woodpecker to use that particular machine. [Radio hardware often depends on what part of the world you're in,](https://en.wikipedia.org/wiki/ITU_Region) you also want specify where your agent is located.
|
||||
|
||||
Here is how to add the necessary environment variable to [an agent's docker compose script](#creating-an-agent-with-docker-compose) to label it in ITU Region 1 (Europe is in Region 1) with a lora module attached:
|
||||
|
||||
```yaml
|
||||
# Agent configuration goes here...
|
||||
environment:
|
||||
- WOODPECKER_AGENT_LABELS=location=region-1,peripheral=lora
|
||||
# Other enviroment variables go here...
|
||||
|
||||
environment:
|
||||
- WOODPECKER_AGENT_LABELS=location=region-1,peripheral=lora
|
||||
# Other environment variables go here...
|
||||
```
|
||||
|
||||
You then use the following workflow to specify tests for those labels:
|
||||
|
||||
|
||||
```yaml
|
||||
labels:
|
||||
# Only select agents with a location of `region-1`...
|
||||
|
|
@ -171,7 +167,7 @@ labels:
|
|||
|
||||
steps:
|
||||
- name: test-debian
|
||||
image: debian
|
||||
image: debian
|
||||
commands:
|
||||
- apt install build-essentials
|
||||
- make build
|
||||
|
|
@ -182,9 +178,8 @@ If you had a teammate running an agent in another continent, you would then chan
|
|||
|
||||
## References
|
||||
|
||||
- [Woodpecker General Administration Guide](https://woodpecker-ci.org/docs/administration/general)
|
||||
- [Woodpecker Docker Compose Installation Guide](https://woodpecker-ci.org/docs/administration/installation/docker-compose)
|
||||
- [Woodpecker Helm Installation Guide](https://woodpecker-ci.org/docs/administration/installation/helm-chart)
|
||||
- [Woodpecker Workflows Reference](https://woodpecker-ci.org/docs/usage/workflow)
|
||||
- [Woodpecker Workflow Syntax Reference](https://woodpecker-ci.org/docs/usage/workflow-syntax#label)
|
||||
|
||||
- [Woodpecker General Administration Guide](https://woodpecker-ci.org/docs/administration/general)
|
||||
- [Woodpecker Docker Compose Installation Guide](https://woodpecker-ci.org/docs/administration/installation/docker-compose)
|
||||
- [Woodpecker Helm Installation Guide](https://woodpecker-ci.org/docs/administration/installation/helm-chart)
|
||||
- [Woodpecker Workflows Reference](https://woodpecker-ci.org/docs/usage/workflows)
|
||||
- [Woodpecker Workflow Syntax Reference](https://woodpecker-ci.org/docs/usage/workflow-syntax#label)
|
||||
|
|
|
|||
|
|
@ -59,4 +59,3 @@ for more information.
|
|||
Forgejo, the software Codeberg is built on, offers a CI/CD feature called Actions.
|
||||
|
||||
Further information such as how to run it is available in [Using Forgejo Actions (Self-hosted) page](./actions).
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue