diff --git a/.forgejo/workflows/example-lxc-systemd.yml b/.forgejo/workflows/example-lxc-systemd.yml index c0c5a9e..d1d3327 100644 --- a/.forgejo/workflows/example-lxc-systemd.yml +++ b/.forgejo/workflows/example-lxc-systemd.yml @@ -82,6 +82,10 @@ jobs: service=/etc/systemd/system/forgejo-runner@.service cat $service + cache=/var/lib/forgejo-runner/runner-$INPUTS_SERIAL-lxc/.cache/actcache + touch $cache/something + lxc-attach runner-$INPUTS_SERIAL-lxc -- test -f $cache/something + - name: forgejo-runner-service.sh start / stop run: | set -x diff --git a/examples/lxc-systemd/forgejo-runner-service.sh b/examples/lxc-systemd/forgejo-runner-service.sh index fa76c7a..2ff51dc 100755 --- a/examples/lxc-systemd/forgejo-runner-service.sh +++ b/examples/lxc-systemd/forgejo-runner-service.sh @@ -31,6 +31,7 @@ SELF_FILENAME=$(basename "$SELF") ETC=/etc/forgejo-runner LIB=/var/lib/forgejo-runner LOG=/var/log/forgejo-runner +LOCK=/var/lock/forgejo-runner : ${HOST:=$(hostname)} LXC_IPV4_PREFIX="10.105.7" @@ -159,13 +160,14 @@ function inside() { local name=$(lxc_name) lxc-helpers.sh lxc_container_run $name -- sudo --user $LXC_USER_NAME \ - INPUTS_SERIAL=$INPUTS_SERIAL \ - INPUTS_TOKEN=$INPUTS_TOKEN \ - INPUTS_FORGEJO=$INPUTS_FORGEJO \ - INPUTS_LIFETIME=$INPUTS_LIFETIME \ - KILL_AFTER=$KILL_AFTER \ - VERBOSE=$VERBOSE \ - HOST=$HOST \ + INPUTS_SERIAL="$INPUTS_SERIAL" \ + INPUTS_LXC_CONFIG="$INPUTS_LXC_CONFIG" \ + INPUTS_TOKEN="$INPUTS_TOKEN" \ + INPUTS_FORGEJO="$INPUTS_FORGEJO" \ + INPUTS_LIFETIME="$INPUTS_LIFETIME" \ + KILL_AFTER="$KILL_AFTER" \ + VERBOSE="$VERBOSE" \ + HOST="$HOST" \ $SELF_FILENAME "$@" } @@ -206,6 +208,11 @@ function ensure_configuration_and_registration() { .runner.labels = ["docker:docker://data.forgejo.org/oci/node:${NODEJS_VERSION}-${DEBIAN_RELEASE}","lxc:lxc://debian:${DEBIAN_RELEASE}"] EOF yq --inplace --from-file $TMPDIR/edit-config $etc/config.yml + cat >$TMPDIR/edit-config <