mirror of
https://codeberg.org/scip/jaildk.git
synced 2025-12-19 13:41:02 +01:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6732d4e9b2 | ||
| 09fe6c8df3 | |||
| 13c3e3ea9b | |||
| 61fc7342e3 | |||
| e9a258223f | |||
| 9cabd79f98 | |||
|
|
eabec94945 | ||
| b5efc90d29 |
14
.github/workflows/ci.yaml
vendored
14
.github/workflows/ci.yaml
vendored
@@ -1,6 +1,10 @@
|
||||
name: Test-Jaildk
|
||||
|
||||
on: [push]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
|
||||
jobs:
|
||||
test:
|
||||
@@ -13,7 +17,7 @@ jobs:
|
||||
uses: vmactions/freebsd-vm@v1
|
||||
id: testjaildk
|
||||
with:
|
||||
release: "14.1"
|
||||
release: "14.3"
|
||||
usesh: true
|
||||
prepare: |
|
||||
pkg install -y curl cpdup
|
||||
@@ -34,9 +38,9 @@ jobs:
|
||||
cp src/jaildk.sh jaildk
|
||||
sh jaildk setup /jail
|
||||
|
||||
fetch https://download.freebsd.org/ftp/releases/amd64/amd64/14.1-RELEASE/base.txz -o /jail/base/14.1-RELEASE-base.txz
|
||||
mkdir -p /jail/base/14.1-RELEASE
|
||||
tar -xf /jail/base/14.1-RELEASE-base.txz -C /jail/base/14.1-RELEASE --unlink
|
||||
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
|
||||
|
||||
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,4 +1,4 @@
|
||||
[](https://github.com/tlinden/jaildk/actions)
|
||||
[](https://github.com/tlinden/jaildk/actions/)
|
||||
|
||||
## jaildk - a FreeBSD jail development kit v2.0.4
|
||||
|
||||
@@ -656,7 +656,7 @@ that's the best way for me to forget to do something.
|
||||
|
||||
In order to report a bug, unexpected behavior, feature requests
|
||||
or to submit a patch, please open an issue on github:
|
||||
https://github.com/TLINDEN/jaildk/issues.
|
||||
https://codeberg.org/scip/jaildk/issues.
|
||||
|
||||
## Copyright and license
|
||||
|
||||
@@ -670,5 +670,5 @@ F.Sass (Culsu)
|
||||
|
||||
## Project homepage
|
||||
|
||||
https://github.com/TLINDEN/jaildk
|
||||
https://codeberg.org/scip/jaildk
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
version=2.0.4
|
||||
version=2.0.5
|
||||
|
||||
# this will be completed during build. Don't touch it, just execute
|
||||
# make and use the resulting script!
|
||||
@@ -1532,7 +1532,7 @@ jaildk_login() {
|
||||
fi
|
||||
|
||||
jid=""
|
||||
jid=`jls | grep "$jail" | awk '{print $1}'`
|
||||
jid=$(jls -j "$jail" jid)
|
||||
|
||||
if test -z "$jid"; then
|
||||
echo "jail $jail doesn't run!"
|
||||
@@ -1781,7 +1781,7 @@ jaildk_update() {
|
||||
rcscript=update
|
||||
force=''
|
||||
|
||||
repo="https://github.com/TLINDEN/jaildk.git"
|
||||
repo="https://codeberg.org/scip/jaildk.git"
|
||||
mustberoot
|
||||
|
||||
OPTIND=1; while getopts "f" arg; do
|
||||
|
||||
Reference in New Issue
Block a user