diff --git a/.forgejo/workflows/forgejo-sh.yml b/.forgejo/workflows/forgejo-sh.yml index 7fecb0d..b18b4b4 100644 --- a/.forgejo/workflows/forgejo-sh.yml +++ b/.forgejo/workflows/forgejo-sh.yml @@ -11,6 +11,8 @@ jobs: runs-on: self-hosted steps: - uses: actions/checkout@v3 + with: + submodules: 'true' - run: | set -x ./forgejo-dependencies.sh install_docker diff --git a/.forgejo/workflows/integration.yml b/.forgejo/workflows/integration.yml index fc0e253..c751d55 100644 --- a/.forgejo/workflows/integration.yml +++ b/.forgejo/workflows/integration.yml @@ -4,6 +4,8 @@ jobs: runs-on: self-hosted steps: - uses: actions/checkout@v3 + with: + submodules: 'true' - run: | set -x LXC_IP_PREFIX=10.0.9 ./forgejo-dependencies.sh diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..2a45ddd --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lxc-helpers"] + path = lxc-helpers + url = https://code.forgejo.org/forgejo/lxc-helpers diff --git a/forgejo-dependencies.sh b/forgejo-dependencies.sh index 42ee283..ace9635 100755 --- a/forgejo-dependencies.sh +++ b/forgejo-dependencies.sh @@ -3,35 +3,18 @@ set -x +source $(dirname $0)/lxc-helpers/enough-lxc-helpers.sh + : ${LXC_IP_PREFIX:=10.0.8} 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 < /dev/null ; then apt-get update apt-get install -y -qq wget tar - wget https://go.dev/dl/go1.20.3.linux-amd64.tar.gz - tar zxf go1.20.3.linux-amd64.tar.gz + wget --quiet https://go.dev/dl/go1.20.4.linux-amd64.tar.gz + tar zxf go1.20.4.linux-amd64.tar.gz export PATH=$PATH:$(pwd)/go/bin fi } @@ -138,10 +138,10 @@ function push_self_action() { local tag="$4" local dir="$DIR/self" - git clone . $dir + git clone --recurse-submodules . $dir ( cd $dir - rm -fr .forgejo .git + rm -fr .forgejo .git lxc-helpers/.git git init git checkout -b main git remote add origin "$url/$owner/$self_action" diff --git a/lxc-helpers b/lxc-helpers new file mode 160000 index 0000000..0e3a7b3 --- /dev/null +++ b/lxc-helpers @@ -0,0 +1 @@ +Subproject commit 0e3a7b3f4835b45cc3758f974f09819c923b2398 diff --git a/testdata/sanity-checks/.forgejo/workflows/test.yml b/testdata/sanity-checks/.forgejo/workflows/test.yml index f09e670..a648dcb 100644 --- a/testdata/sanity-checks/.forgejo/workflows/test.yml +++ b/testdata/sanity-checks/.forgejo/workflows/test.yml @@ -10,6 +10,8 @@ jobs: echo +++++++++++++++++++++++++++++++++++++++++++ echo about to actions/checkout@v3 for SELF@vTest - uses: actions/checkout@v3 + with: + submodules: 'true' - id: forgejo uses: SELF@vTest with: