chore(lib): simplify dependency handling
This commit is contained in:
parent
2709d9e3c4
commit
80d43f545a
4 changed files with 28 additions and 42 deletions
23
lib/dependencies.sh
Normal file
23
lib/dependencies.sh
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
function dependencies() {
|
||||
if ! test -f /usr/local/bin/forgejo-curl.sh; then
|
||||
$SUDO curl --fail -sS https://code.forgejo.org/forgejo/forgejo-curl/raw/branch/main/forgejo-curl.sh -o /usr/local/bin/forgejo-curl.sh
|
||||
$SUDO chmod +x /usr/local/bin/forgejo-curl.sh
|
||||
fi
|
||||
|
||||
if ! which make curl daemon git-lfs jq sqlite3 skopeo podman podman-compose pasta pup >/dev/null; then
|
||||
$SUDO apt-get update -qq
|
||||
$SUDO apt-get install -y -qq --no-install-recommends make curl daemon git-lfs jq sqlite3 skopeo podman podman-compose passt aardvark-dns pup
|
||||
fi
|
||||
|
||||
if ! test -f /usr/local/bin/mc || ! test -f /usr/local/bin/minio; then
|
||||
$SUDO curl --fail https://dl.min.io/client/mc/release/linux-amd64/mc -o /usr/local/bin/mc
|
||||
$SUDO curl --fail https://dl.min.io/server/minio/release/linux-amd64/minio -o /usr/local/bin/minio
|
||||
$SUDO chmod +x /usr/local/bin/mc
|
||||
$SUDO chmod +x /usr/local/bin/minio
|
||||
fi
|
||||
|
||||
if ! test -f /usr/local/bin/garage >/dev/null; then
|
||||
$SUDO curl --fail https://garagehq.deuxfleurs.fr/_releases/v0.8.2/x86_64-unknown-linux-musl/garage -o /usr/local/bin/garage
|
||||
$SUDO chmod +x /usr/local/bin/garage
|
||||
fi
|
||||
}
|
||||
29
lib/lib.sh
29
lib/lib.sh
|
|
@ -43,35 +43,6 @@ function log_info() {
|
|||
echo "$PREFIX $@"
|
||||
}
|
||||
|
||||
function dependencies() {
|
||||
|
||||
if ! test -f /usr/local/bin/forgejo-curl.sh; then
|
||||
$SUDO curl --fail -sS https://code.forgejo.org/forgejo/forgejo-curl/raw/branch/main/forgejo-curl.sh -o /usr/local/bin/forgejo-curl.sh
|
||||
$SUDO chmod +x /usr/local/bin/forgejo-curl.sh
|
||||
fi
|
||||
|
||||
if ! which make curl daemon git-lfs jq sqlite3 skopeo podman podman-compose pup >/dev/null; then
|
||||
$SUDO apt-get update -qq
|
||||
$SUDO apt-get install -y -qq make curl daemon git-lfs jq sqlite3 skopeo podman podman-compose pup
|
||||
fi
|
||||
|
||||
if ! test -f /usr/local/bin/mc || ! test -f /usr/local/bin/minio; then
|
||||
$SUDO curl --fail -sS https://dl.min.io/client/mc/release/linux-amd64/mc -o /usr/local/bin/mc
|
||||
$SUDO curl --fail -sS https://dl.min.io/server/minio/release/linux-amd64/minio -o /usr/local/bin/minio
|
||||
fi
|
||||
if ! test -x /usr/local/bin/mc || ! test -x /usr/local/bin/minio; then
|
||||
$SUDO chmod +x /usr/local/bin/mc
|
||||
$SUDO chmod +x /usr/local/bin/minio
|
||||
fi
|
||||
|
||||
if ! test -f /usr/local/bin/garage >/dev/null; then
|
||||
$SUDO curl --fail -sS https://garagehq.deuxfleurs.fr/_releases/v0.8.2/x86_64-unknown-linux-musl/garage -o /usr/local/bin/garage
|
||||
fi
|
||||
if ! test -x /usr/local/bin/garage >/dev/null; then
|
||||
$SUDO chmod +x /usr/local/bin/garage
|
||||
fi
|
||||
}
|
||||
|
||||
function retry() {
|
||||
rm -f $DIR/wait-for.out
|
||||
success=false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue