7 Commits

Author SHA1 Message Date
3d646a88d6 revert 2026-01-07 12:19:29 +01:00
6da97f3d0f try ghcr 2026-01-07 12:14:35 +01:00
696f0d7514 try native agent 2026-01-07 12:10:15 +01:00
f4bd950ec7 fix typo 2025-12-19 13:52:03 +01:00
03ea2de4c4 fix typos 2025-12-19 13:46:37 +01:00
be4f01877d fix ci doc 2025-12-19 13:45:29 +01:00
T. von Dein
1e115c49f6 move ci pipeline to woodpecker using hetzner freebsd vm with woodpecker-agent (#37) 2025-12-19 13:42:24 +01:00
2 changed files with 28 additions and 28 deletions

View File

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

View File

@@ -13,41 +13,41 @@ labels:
steps:
test:
image: bash
image: quay.io/matiaspizarro/freebsd-base:14.3
when:
event: [push]
commands:
- freebsd-version
- uname -a
- sysctl hw.model
- sysctl hw.ncpu
- sysctl hw.physmem
- sysctl hw.usermem
# - sysctl hw.model
# - sysctl hw.ncpu
# - sysctl hw.physmem
# - sysctl hw.usermem
# clean up earlier runs, if any
- 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
- chflags -R noschg /jail
- rm -rf /jail
# # clean up earlier runs, if any
# - 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
# - chflags -R noschg /jail
# - rm -rf /jail
- ifconfig vtnet0 172.16.0.1/32 alias
- ifconfig vtnet0
# - ifconfig vtnet0 172.16.0.1/32 alias
# - ifconfig vtnet0
- sysrc jail_enable="YES"
- cp .woodpecker/assets/jail.conf /etc/
# - sysrc jail_enable="YES"
# - cp .woodpecker/assets/jail.conf /etc/
- cp src/jaildk.sh jaildk
- sh jaildk setup /jail
# - cp src/jaildk.sh jaildk
# - 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
- ls -l /jail/etc/test
- /jail/bin/jaildk build test -m start
- df -h /jail/build/test/etc
# - /jail/bin/jaildk create test
# - ls -l /jail/etc/test
# - /jail/bin/jaildk build test -m start
# - df -h /jail/build/test/etc
- echo 'sshd_enable="Yes"' > /jail/build/test/usr/local/etc/rc.conf
- chroot /jail/build/test /etc/rc.d/sshd keygen
# - echo 'sshd_enable="Yes"' > /jail/build/test/usr/local/etc/rc.conf
# - chroot /jail/build/test /etc/rc.d/sshd keygen
- /jail/bin/jaildk start test
- /jail/bin/jaildk status | grep -E "test|Jail"
# - /jail/bin/jaildk start test
# - /jail/bin/jaildk status | grep -E "test|Jail"