mirror of
https://codeberg.org/scip/jaildk.git
synced 2025-12-19 21:51:02 +01:00
Compare commits
6 Commits
github
...
buildrelea
| Author | SHA1 | Date | |
|---|---|---|---|
| f5f55ce5e8 | |||
| 09fe6c8df3 | |||
| 13c3e3ea9b | |||
| 61fc7342e3 | |||
| e9a258223f | |||
| 9cabd79f98 |
16
.github/assets/jail.conf
vendored
Normal file
16
.github/assets/jail.conf
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
* {
|
||||||
|
exec.start = "/bin/sh /etc/rc";
|
||||||
|
exec.stop = "/bin/sh /etc/rc.shutdown";
|
||||||
|
allow.raw_sockets = "false";
|
||||||
|
sysvmsg = "new";
|
||||||
|
sysvsem = "new";
|
||||||
|
sysvshm = "new";
|
||||||
|
host.hostname = $name;
|
||||||
|
path = "/jail/run/$name";
|
||||||
|
exec.prestart = "/jail/bin/jaildk install $name start";
|
||||||
|
exec.clean = "true";
|
||||||
|
}
|
||||||
|
|
||||||
|
test {
|
||||||
|
ip4.addr = "172.16.0.1";
|
||||||
|
}
|
||||||
56
.github/workflows/ci.yaml
vendored
Normal file
56
.github/workflows/ci.yaml
vendored
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
name: Test-Jaildk
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Test jaildk on FreeBSD
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Test in FreeBSD
|
||||||
|
uses: vmactions/freebsd-vm@v1
|
||||||
|
id: testjaildk
|
||||||
|
with:
|
||||||
|
release: "14.3"
|
||||||
|
usesh: true
|
||||||
|
prepare: |
|
||||||
|
pkg install -y curl cpdup
|
||||||
|
|
||||||
|
run: |
|
||||||
|
freebsd-version
|
||||||
|
sysctl hw.model
|
||||||
|
sysctl hw.ncpu
|
||||||
|
sysctl hw.physmem
|
||||||
|
sysctl hw.usermem
|
||||||
|
ls -la
|
||||||
|
ifconfig em0 172.16.0.1/32 alias
|
||||||
|
ifconfig -a
|
||||||
|
set -x -e
|
||||||
|
sysrc jail_enable="YES"
|
||||||
|
cp .github/assets/jail.conf /etc/
|
||||||
|
|
||||||
|
cp src/jaildk.sh jaildk
|
||||||
|
sh jaildk setup /jail
|
||||||
|
|
||||||
|
fetch https://download.freebsd.org/ftp/releases/amd64/amd64/14.3-RELEASE/base.txz -o /jail/base/14.3-RELEASE-base.txz
|
||||||
|
mkdir -p /jail/base/14.3-RELEASE
|
||||||
|
tar -xf /jail/base/14.3-RELEASE-base.txz -C /jail/base/14.3-RELEASE --unlink
|
||||||
|
|
||||||
|
/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
|
||||||
|
|
||||||
|
/jail/bin/jaildk start test
|
||||||
|
/jail/bin/jaildk status | grep -E "test|Jail"
|
||||||
|
|
||||||
|
|
||||||
54
.woodpecker/release.sh
Executable file
54
.woodpecker/release.sh
Executable file
@@ -0,0 +1,54 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This is my own simple codeberg generic releaser. It takes to
|
||||||
|
# binaries to be uploaded as arguments and takes every other args from
|
||||||
|
# env. Works on tags or normal commits (push), tags must start with v.
|
||||||
|
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
die() {
|
||||||
|
echo $*
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if test -z "$DEPLOY_TOKEN"; then
|
||||||
|
die "token DEPLOY_TOKEN not set"
|
||||||
|
fi
|
||||||
|
|
||||||
|
git fetch --all
|
||||||
|
|
||||||
|
# determine current tag or commit hash
|
||||||
|
version="$CI_COMMIT_TAG"
|
||||||
|
previous=""
|
||||||
|
log=""
|
||||||
|
if test -z "$version"; then
|
||||||
|
version="${CI_COMMIT_SHA:0:6}"
|
||||||
|
log=$(git log -1 --oneline)
|
||||||
|
else
|
||||||
|
previous=$(git tag -l | grep -E "^v" | tac | grep -A1 "$version" | tail -1)
|
||||||
|
log=$(git log -1 --oneline "${previous}..${version}" | sed 's|^|- |g')
|
||||||
|
fi
|
||||||
|
|
||||||
|
# release body
|
||||||
|
printf "# Changes\n\n %s\n" "$log" > body.txt
|
||||||
|
|
||||||
|
# create the release
|
||||||
|
https --ignore-stdin --check-status -b -A bearer -a "$DEPLOY_TOKEN" POST \
|
||||||
|
"https://codeberg.org/api/v1/repos/${CI_REPO_OWNER}/${CI_REPO_NAME}/releases" \
|
||||||
|
tag_name="$version" name="Release $version" body=@body.txt > release.json
|
||||||
|
|
||||||
|
# we need the id to upload files
|
||||||
|
ID=$(jq -r .id < release.json)
|
||||||
|
|
||||||
|
if test -z "$ID"; then
|
||||||
|
cat release.json
|
||||||
|
die "failed to create release"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# actually upload
|
||||||
|
for file in "$@"; do
|
||||||
|
https --ignore-stdin --check-status -A bearer -a "$DEPLOY_TOKEN" -f POST \
|
||||||
|
"https://codeberg.org/api/v1/repos/${CI_REPO_OWNER}/${CI_REPO_NAME}/releases/$ID/assets" \
|
||||||
|
"name=${file}" "attachment@${file}"
|
||||||
|
done
|
||||||
28
.woodpecker/release.yaml
Normal file
28
.woodpecker/release.yaml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# build release
|
||||||
|
|
||||||
|
labels:
|
||||||
|
platform: linux/amd64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
compile:
|
||||||
|
when:
|
||||||
|
event: [tag,manual]
|
||||||
|
image: alpine:latest
|
||||||
|
commands:
|
||||||
|
- apk update
|
||||||
|
- apk add --no-cache bash git build-base
|
||||||
|
- make
|
||||||
|
- file ${CI_REPO_NAME}
|
||||||
|
- mv ${CI_REPO_NAME} ${CI_REPO_NAME}-freebsd-all-$CI_COMMIT_TAG
|
||||||
|
|
||||||
|
release:
|
||||||
|
image: alpine:latest
|
||||||
|
when:
|
||||||
|
event: [tag,manual]
|
||||||
|
environment:
|
||||||
|
DEPLOY_TOKEN:
|
||||||
|
from_secret: DEPLOY_TOKEN
|
||||||
|
commands:
|
||||||
|
- apk update
|
||||||
|
- apk add --no-cache bash httpie jq git
|
||||||
|
- .woodpecker/release.sh ${CI_REPO_NAME}-*
|
||||||
@@ -1,9 +1,4 @@
|
|||||||
> [!CAUTION]
|
[](https://github.com/tlinden/jaildk/actions/)
|
||||||
> This software is now being maintained on [Codeberg](https://codeberg.org/scip/leo/).
|
|
||||||
>
|
|
||||||
> However, due to limitations with woodpecker FreeBSD support, CI test workflows are still being executed here.
|
|
||||||
>
|
|
||||||
> Devs: no need to push to codeberg and github, there's a mirror script running somewhere else.
|
|
||||||
|
|
||||||
## jaildk - a FreeBSD jail development kit v2.0.4
|
## jaildk - a FreeBSD jail development kit v2.0.4
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user