1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-forgejo synced 2024-09-16 16:36:17 +00:00
setup-forgejo/forgejo-dependencies.sh

31 lines
504 B
Bash
Raw Permalink Normal View History

2023-03-25 16:36:27 +00:00
#!/bin/bash
2023-04-01 09:08:06 +00:00
# SPDX-License-Identifier: MIT
2023-03-25 16:36:27 +00:00
set -x
2023-05-21 20:58:27 +00:00
source $(dirname $0)/lxc-helpers-lib.sh
2023-05-16 23:02:22 +00:00
2023-03-29 22:27:54 +00:00
: ${LXC_IP_PREFIX:=10.0.8}
2023-03-25 18:14:55 +00:00
2023-03-25 16:36:27 +00:00
function install_docker() {
if ! systemctl is-active --quiet docker; then
2023-05-16 23:02:22 +00:00
lxc_install_docker_inside
2023-03-25 16:36:27 +00:00
fi
}
function install_other() {
2023-05-16 23:02:22 +00:00
local packages="sudo git"
2023-03-25 16:36:27 +00:00
if ! which $packages ; then
2023-12-29 15:45:57 +00:00
apt-get update -qq
2023-03-25 16:36:27 +00:00
apt-get install -y -qq $packages
fi
}
function setup() {
install_other
2023-03-25 16:36:27 +00:00
install_docker
2023-05-16 23:02:22 +00:00
lxc_install_lxc_inside $LXC_IP_PREFIX
2023-03-25 16:36:27 +00:00
}
"${@:-setup}"