mirror of
https://code.forgejo.org/actions/setup-forgejo.git
synced 2024-11-23 22:00:56 -05:00
reorganize dependencies installation
This commit is contained in:
parent
e39c635a02
commit
e716e12a71
5 changed files with 48 additions and 38 deletions
|
@ -6,8 +6,7 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- run: |
|
- run: |
|
||||||
set -x
|
set -x
|
||||||
./lxc.sh
|
./dependencies.sh
|
||||||
./docker.sh
|
|
||||||
./forgejo.sh setup root admin1234 codeberg.org/forgejo/forgejo:1.19
|
./forgejo.sh setup root admin1234 codeberg.org/forgejo/forgejo:1.19
|
||||||
./forgejo-runner.sh setup
|
./forgejo-runner.sh setup
|
||||||
# testdata/run.sh workflow http://root:admin1234@$(cat forgejo-ip):3000 root demo
|
# testdata/run.sh workflow http://root:admin1234@$(cat forgejo-ip):3000 root demo
|
||||||
|
|
43
dependencies.sh
Executable file
43
dependencies.sh
Executable file
|
@ -0,0 +1,43 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
function install_docker() {
|
||||||
|
if ! systemctl is-active --quiet docker; then
|
||||||
|
echo deb http://deb.debian.org/debian bullseye-backports main | tee /etc/apt/sources.list.d/backports.list && apt-get update
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --quiet -y -t bullseye-backports git docker.io
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_lxc() {
|
||||||
|
if ! systemctl is-active --quiet lxc-net; then
|
||||||
|
apt-get update
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make git libvirt0 libpam-cgfs bridge-utils uidmap dnsmasq-base dnsmasq dnsmasq-utils qemu-user-static
|
||||||
|
systemctl disable --now dnsmasq
|
||||||
|
apt-get install -y -qq lxc
|
||||||
|
systemctl stop lxc-net
|
||||||
|
cat >> /etc/default/lxc-net <<'EOF'
|
||||||
|
LXC_ADDR="10.0.7.1"
|
||||||
|
LXC_NETMASK="255.255.255.0"
|
||||||
|
LXC_NETWORK="10.0.7.0/24"
|
||||||
|
LXC_DHCP_RANGE="10.0.7.2,10.0.7.254"
|
||||||
|
LXC_DHCP_MAX="253"
|
||||||
|
EOF
|
||||||
|
systemctl start lxc-net
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_other() {
|
||||||
|
local packages="sudo"
|
||||||
|
if ! which $packages ; then
|
||||||
|
apt-get install -y -qq $packages
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function setup() {
|
||||||
|
install_docker
|
||||||
|
install_lxc
|
||||||
|
install_other
|
||||||
|
}
|
||||||
|
|
||||||
|
setup
|
12
docker.sh
12
docker.sh
|
@ -1,12 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
setup() {
|
|
||||||
if ! systemctl is-active --quiet docker; then
|
|
||||||
echo deb http://deb.debian.org/debian bullseye-backports main | tee /etc/apt/sources.list.d/backports.list && apt-get update
|
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --quiet -y -t bullseye-backports git docker.io
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
setup
|
|
23
lxc.sh
23
lxc.sh
|
@ -1,23 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
setup() {
|
|
||||||
if ! systemctl is-active --quiet lxc-net; then
|
|
||||||
apt-get update
|
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq make git libvirt0 libpam-cgfs bridge-utils uidmap dnsmasq-base dnsmasq dnsmasq-utils qemu-user-static
|
|
||||||
systemctl disable --now dnsmasq
|
|
||||||
apt-get install -y -qq lxc
|
|
||||||
systemctl stop lxc-net
|
|
||||||
cat >> /etc/default/lxc-net <<'EOF'
|
|
||||||
LXC_ADDR="10.0.7.1"
|
|
||||||
LXC_NETMASK="255.255.255.0"
|
|
||||||
LXC_NETWORK="10.0.7.0/24"
|
|
||||||
LXC_DHCP_RANGE="10.0.7.2,10.0.7.254"
|
|
||||||
LXC_DHCP_MAX="253"
|
|
||||||
EOF
|
|
||||||
systemctl start lxc-net
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
setup
|
|
5
testdata/run.sh
vendored
5
testdata/run.sh
vendored
|
@ -31,7 +31,10 @@ function wait_success() {
|
||||||
fi
|
fi
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
test "$(check_status "$forgejo" "$repo" "$sha")" = "success"
|
if ! test "$(check_status "$forgejo" "$repo" "$sha")" = "success" ; then
|
||||||
|
cat forgejo-runner.log
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function push() {
|
function push() {
|
||||||
|
|
Loading…
Reference in a new issue