install the runner in /usr/local/bin

* when downloaded
* when built from sources
This commit is contained in:
Earl Warren 2023-11-04 16:29:25 +01:00
parent dede81c801
commit 1535c75993
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 0579CB2928A78A00
2 changed files with 5 additions and 5 deletions

View file

@ -36,7 +36,7 @@ function build_runner() {
git checkout "$version"
make build
)
mv $dir/forgejo-runner/forgejo-runner .
./forgejo-runner --version
mv $dir/forgejo-runner/forgejo-runner /usr/local/bin
forgejo-runner --version
rm -fr "$dir"
}

View file

@ -20,11 +20,11 @@ function download() {
local version="$2"
if ! which forgejo-runner > /dev/null; then
if ! curl -L --fail -sS $runner_repository/releases/download/$version/forgejo-runner-${version#v}-linux-amd64 > /bin/forgejo-runner ; then
if ! curl -L --fail -sS $runner_repository/releases/download/$version/forgejo-runner-${version#v}-linux-amd64 > /usr/local/bin/forgejo-runner ; then
# backward compatibility for for the naming scheme prior to 3.0.0
curl -L --fail -sS $runner_repository/releases/download/$version/forgejo-runner-linux-amd64 > /bin/forgejo-runner
curl -L --fail -sS $runner_repository/releases/download/$version/forgejo-runner-linux-amd64 > /usr/local/bin/forgejo-runner
fi
chmod 755 /bin/forgejo-runner
chmod 755 /usr/local/bin/forgejo-runner
fi
}