kdkaskaldsjfalkds
Some checks failed
repro-run Corre repro-run.json

This commit is contained in:
Cat /dev/Nulo 2023-01-30 16:16:41 -03:00
commit db1ccbb3b6
4 changed files with 43 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
rootfs/
cache/

9
instalar-gitea Normal file
View file

@ -0,0 +1,9 @@
#!/bin/sh
# Editar en https://gitea.nulo.in/Nulo/forgejo-updater si se cambia
bin=/usr/local/bin/gitea
new=/usr/local/bin/gitea.new
rm "$new"
cat /dev/stdin > "$new" || exit $?
chmod +x "$new" || exit $?
mv "$new" "$bin" || exit $?
sv restart gitea || exit $?

4
repro-run.json Normal file
View file

@ -0,0 +1,4 @@
{
"Command": "/src/update-forgejo",
"Cache": ["/home/repro/.cache/go-build", "/home/repro/go", "/home/repro/.npm"]
}

28
update-forgejo Executable file
View file

@ -0,0 +1,28 @@
#!/bin/sh -e
runprint() {
echo "==> $@"
"$@"
}
runprint apk add --quiet git nodejs npm go make
# TODO: cachear clon de repo
runprint git clone https://codeberg.org/forgejo/forgejo --branch v1.18.2-1 --depth 1 --single-branch
cd forgejo
runprint env GOOS=linux GOARCH=amd64 LDFLAGS="-linkmode external -extldflags '-static' $LDFLAGS" TAGS="bindata sqlite sqlite_unlock_notify" make build
runprint apk add --quiet rsync openssh-client-default
if test -n "$SSH_KEY"; then
eval $(ssh-agent -s)
# https://stackoverflow.com/questions/46147228/dotenv-multiline-variables
echo "${SSH_KEY}" | tr -d '\r' | ssh-add -
mkdir -p ~/.ssh
echo "[nulo.in]:420,[186.136.121.7]:420 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGPkgRVWYcVcgjI0xAjDgZQsYuXU9edcya8zna01ibyUMlfKHIMD9yOoq0R+fQPTCqwiol/2tKMPJ2hlKshc+H8=" > ~/.ssh/known_hosts
runprint ssh -p420 ci-gitea@nulo.in doas /usr/local/sbin/instalar-gitea < forgejo
else
echo ==> No tengo SSH_KEY, no voy a actualizar el binario.
fi