mirror of
https://code.forgejo.org/actions/setup-forgejo.git
synced 2024-11-23 18:30:56 -05:00
30 lines
504 B
Bash
Executable file
30 lines
504 B
Bash
Executable file
#!/bin/bash
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
set -x
|
|
|
|
source $(dirname $0)/lxc-helpers-lib.sh
|
|
|
|
: ${LXC_IP_PREFIX:=10.0.8}
|
|
|
|
function install_docker() {
|
|
if ! systemctl is-active --quiet docker; then
|
|
lxc_install_docker_inside
|
|
fi
|
|
}
|
|
|
|
function install_other() {
|
|
local packages="sudo git"
|
|
if ! which $packages ; then
|
|
apt-get update -qq
|
|
apt-get install -y -qq $packages
|
|
fi
|
|
}
|
|
|
|
function setup() {
|
|
install_other
|
|
install_docker
|
|
lxc_install_lxc_inside $LXC_IP_PREFIX
|
|
}
|
|
|
|
"${@:-setup}"
|