sh.zio.github-runner-wrapper: add Github Runner Wrapper
parent
c952be0c12
commit
3a3dde0ff6
|
@ -46,6 +46,7 @@
|
|||
!/usr/local/bin/
|
||||
/usr/local/bin/*
|
||||
!/usr/local/bin/sh.zio.backup
|
||||
!/usr/local/bin/sh.zio.github-runner-wrapper
|
||||
!/usr/local/bin/sh.zio.install-package
|
||||
!/usr/local/bin/sh.zio.pod-exec
|
||||
!/usr/local/bin/sh.zio.pod-systemd
|
||||
|
@ -61,6 +62,14 @@
|
|||
/usr/local/libexec/*
|
||||
!/usr/local/libexec/zio-helpers
|
||||
|
||||
# /usr/local/libexec/sodalite/
|
||||
!/usr/local/libexec/sodalite/
|
||||
/usr/local/libexec/sodalite/*
|
||||
|
||||
# /usr/local/libexec/sodalite/invoker
|
||||
!/usr/local/libexec/sodalite/invoker
|
||||
/usr/local/libexec/sodalite/invoker/*
|
||||
|
||||
# /usr/local/libexec/zio/
|
||||
!/usr/local/libexec/zio/
|
||||
/usr/local/libexec/zio/*
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
[submodule "usr/local/libexec/sodalite/invoker"]
|
||||
path = usr/local/libexec/sodalite/invoker
|
||||
url = https://github.com/sodaliterocks/invoker
|
|
@ -0,0 +1,43 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
_PLUG_TITLE="GitHub Runner Wrapper"
|
||||
_PLUG_DESCRIPTION=""
|
||||
_PLUG_ARGS=(
|
||||
"token;t;;string"
|
||||
"url;u;;string"
|
||||
"ex-version;;;string;2.311.0"
|
||||
"ex-version-arch;;;string;x64"
|
||||
)
|
||||
_PLUG_POSITIONAL="url token"
|
||||
|
||||
function main() {
|
||||
identifier="$(echo $_url | sed -e "s|https://github.com/||" -e "s|/|.|g")"
|
||||
gh_runner_dir="$HOME/.local/bin/gh-runner_$identifier"
|
||||
download_path="https://github.com/actions/runner/releases/download/v$_ex_version/actions-runner-linux-$_ex_version_arch-$_ex_version.tar.gz"
|
||||
|
||||
mkdir -p "$gh_runner_dir"
|
||||
cd "$gh_runner_dir"
|
||||
|
||||
if [ -z "$(ls -A $gh_runner_dir)" ]; then
|
||||
curl -o "actions-runner-linux-$_ex_version.tar.gz" -L "$download_path"
|
||||
tar xzf "actions-runner-linux-$_ex_version.tar.gz"
|
||||
rm "actions-runner-linux-$_ex_version.tar.gz"
|
||||
fi
|
||||
|
||||
if [[ ! -f ".credentials" ]]; then
|
||||
./config.sh --url "$url" --token "$token" --unattended
|
||||
fi
|
||||
|
||||
./run.sh
|
||||
}
|
||||
|
||||
if [[ $_PLUG_INVOKED != "true" ]]; then
|
||||
base_dir="$(dirname "$(realpath -s "$0")")"
|
||||
git_dir="$base_dir/../../.."
|
||||
|
||||
if [[ -d "$git_dir/.git" ]]; then
|
||||
"$git_dir/usr/local/libexec/sodalite/invoker/src/invoke.sh" "$0" $@
|
||||
else
|
||||
"/usr/local/libexec/sodalite/invoker/src/invoke.sh" "$0" $@
|
||||
fi
|
||||
fi
|
|
@ -0,0 +1 @@
|
|||
Subproject commit eab2016a970f6adbfdb1f8387e983ef54843b664
|
Loading…
Reference in New Issue