woodpecker
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Cat /dev/Nulo 2023-03-21 20:07:53 -03:00
parent c3b9e335e6
commit 6b72286117
3 changed files with 25 additions and 32 deletions

25
.woodpecker.yml Normal file
View file

@ -0,0 +1,25 @@
pipeline:
package:
image: docker.io/alpine:3.17
commands:
- apk add --quiet git nodejs npm go make
- |
wget -qO- https://codeberg.org/attachments/2bf497db-fa91-4260-9c98-5c791b6b397c | tar zx
cd forgejo
- |
env GOOS=linux GOARCH=amd64 LDFLAGS="-linkmode external -extldflags '-static' $LDFLAGS" TAGS="bindata sqlite sqlite_unlock_notify" make build
- apk add --quiet rsync openssh-client-default
- |
eval $(ssh-agent -s)
# https://stackoverflow.com/questions/46147228/dotenv-multiline-variables
# echo "${SSH_KEY}" | tr -d '\r' | ssh-add -
echo "${SSH_KEY}" | ssh-add -
mkdir -p ~/.ssh
echo "[nulo.in]:420,[186.136.121.7]:420 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGPkgRVWYcVcgjI0xAjDgZQsYuXU9edcya8zna01ibyUMlfKHIMD9yOoq0R+fQPTCqwiol/2tKMPJ2hlKshc+H8=" > ~/.ssh/known_hosts
ssh -p420 ci-gitea@nulo.in doas /usr/local/sbin/instalar-gitea < gitea
secrets: [ ssh_key ]

View file

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

View file

@ -1,28 +0,0 @@
#!/bin/sh -e
runprint() {
echo "==> $@"
"$@"
}
runprint apk add --quiet git nodejs npm go make
# TODO: cachear clon de repo
wget -qO- https://codeberg.org/attachments/2bf497db-fa91-4260-9c98-5c791b6b397c | tar zx
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 < gitea
else
echo ==> No tengo SSH_KEY, no voy a actualizar el binario.
fi