21 Commits

Author SHA1 Message Date
b2a4ce88f3 fix tar 2025-12-19 13:41:28 +01:00
f7987c3566 separate stop and rm 2025-12-19 13:40:02 +01:00
1ff66bcc45 no tac, use sed 2025-12-19 13:39:09 +01:00
d631e68422 only download once 2025-12-19 13:37:34 +01:00
606fc443fb fix umount 2025-12-19 13:36:26 +01:00
6b6815ab41 fix while loop 2025-12-19 13:34:32 +01:00
e187d49927 umount directly 2025-12-19 13:33:56 +01:00
895508b607 also uninstall 2025-12-19 13:31:22 +01:00
da863a96c1 fix cleanup: stop jail before rm 2025-12-19 13:29:55 +01:00
b6b11429f9 not needed anymore 2025-12-19 13:19:31 +01:00
7cbeadfcb0 fix link 2025-12-19 13:17:50 +01:00
f0ce477bb5 make rw before removing 2025-12-19 13:15:52 +01:00
16913d7c7d fix release name 2025-12-19 13:14:49 +01:00
4c28358936 fix vars 2025-12-19 13:11:25 +01:00
7284e90f01 add cpdup 2025-12-19 13:09:31 +01:00
c3544b8583 add docs and pipeline 2025-12-19 13:07:48 +01:00
ebee19e121 try local backend 2025-12-19 11:30:59 +01:00
6c9d025ff4 fix platform 2025-12-19 11:18:13 +01:00
928b6ec5c3 spacing 2025-12-19 11:17:35 +01:00
d032f45cbf use snap image 2025-12-19 11:12:29 +01:00
e69d2acc3c try freebsd agent 2025-12-19 11:06:43 +01:00
2 changed files with 28 additions and 32 deletions

View File

@@ -1,6 +1,6 @@
## Running CI Tests with Woodpecker-CI on FreeBSD ## Running CI Tests with Woodpecker-CI on FreeBSD
By default the woodpecker instance on Codeberg doesn't support By default the woodpecker intance on Codeberg doesn't support
FreeBSD. Running FreeBSD inside a qemu VM in a linux docker image FreeBSD. Running FreeBSD inside a qemu VM in a linux docker image
didn't work. Also, this particular tool needs to run outside a jail, didn't work. Also, this particular tool needs to run outside a jail,
since it is a jail management tool. since it is a jail management tool.
@@ -8,7 +8,7 @@ since it is a jail management tool.
So, this is my setup: So, this is my setup:
I deployed a freebsd VM on Hetzner Cloud: `ci-agent.daemon.de`. It I deployed a freebsd VM on Hetzner Cloud: `ci-agent.daemon.de`. It
runs the `woodpecker-agent` built for freebsd. The agent runs as root runs the `woodpecker-agent` build for freebsd. The agent runs as rool
directly on the host. This is a security risk and the reason why we directly on the host. This is a security risk and the reason why we
use a VM. use a VM.
@@ -43,7 +43,7 @@ Execute:
GOOS=freebsd go build GOOS=freebsd go build
``` ```
Copy the newly built binaries into the VM to Copy the newly built binaries `dist/woodpecker-agent` into the VM to
`/usr/local/bin`. `/usr/local/bin`.
```default ```default

View File

@@ -11,47 +11,43 @@ matrix:
labels: labels:
platform: freebsd/amd64 platform: freebsd/amd64
clone:
git:
image: codeberg.org/scip/jaildk:plugin-git-2
steps: steps:
test: test:
image: ghcr.io/freebsd/freebsd-runtime:14.3 image: bash
when: when:
event: [push] event: [push]
commands: commands:
- freebsd-version - freebsd-version
- uname -a - uname -a
# - sysctl hw.model - sysctl hw.model
# - sysctl hw.ncpu - sysctl hw.ncpu
# - sysctl hw.physmem - sysctl hw.physmem
# - sysctl hw.usermem - sysctl hw.usermem
# # clean up earlier runs, if any # clean up earlier runs, if any
# - if jls | grep -q test; then jail -r test; fi - if jls | grep -q test; then jail -r test; fi
# - mount | cut -d' ' -f3 | grep /jail | sed '1!G;h;$!d' | while read D; do umount $D; done - mount | cut -d' ' -f3 | grep /jail | sed '1!G;h;$!d' | while read D; do umount $D; done
# - chflags -R noschg /jail - chflags -R noschg /jail
# - rm -rf /jail - rm -rf /jail
# - ifconfig vtnet0 172.16.0.1/32 alias - ifconfig vtnet0 172.16.0.1/32 alias
# - ifconfig vtnet0 - ifconfig vtnet0
# - sysrc jail_enable="YES" - sysrc jail_enable="YES"
# - cp .woodpecker/assets/jail.conf /etc/ - cp .woodpecker/assets/jail.conf /etc/
# - cp src/jaildk.sh jaildk - cp src/jaildk.sh jaildk
# - sh jaildk setup /jail - sh jaildk setup /jail
# - if ! test -e /jail/base/${release}-base.txz; then fetch https://download.freebsd.org/ftp/releases/amd64/amd64/${releaselink}/base.txz -o /jail/base/${release}-base.txz; mkdir -p /jail/base/${release}; tar -xf /jail/base/${release}-base.txz -C /jail/base/${release} --unlink; fi - if ! test -e /jail/base/${release}-base.txz; then fetch https://download.freebsd.org/ftp/releases/amd64/amd64/${releaselink}/base.txz -o /jail/base/${release}-base.txz; mkdir -p /jail/base/${release}; tar -xf /jail/base/${release}-base.txz -C /jail/base/${release} --unlink; fi
# - /jail/bin/jaildk create test - /jail/bin/jaildk create test
# - ls -l /jail/etc/test - ls -l /jail/etc/test
# - /jail/bin/jaildk build test -m start - /jail/bin/jaildk build test -m start
# - df -h /jail/build/test/etc - df -h /jail/build/test/etc
# - echo 'sshd_enable="Yes"' > /jail/build/test/usr/local/etc/rc.conf - echo 'sshd_enable="Yes"' > /jail/build/test/usr/local/etc/rc.conf
# - chroot /jail/build/test /etc/rc.d/sshd keygen - chroot /jail/build/test /etc/rc.d/sshd keygen
# - /jail/bin/jaildk start test - /jail/bin/jaildk start test
# - /jail/bin/jaildk status | grep -E "test|Jail" - /jail/bin/jaildk status | grep -E "test|Jail"