Compare commits

..

3 commits

Author SHA1 Message Date
6b996253cf nuke network 2024-09-28 10:31:13 -07:00
962c6a62bb remove orphans - revert if fail 2024-09-28 10:10:48 -07:00
8e05b3013b force perms on /srv/runner-data 2024-09-28 09:32:31 -07:00
2 changed files with 8 additions and 12 deletions

View file

@ -31,6 +31,8 @@ jobs:
- name: run the example
run: |
set -x
mkdir -p /srv/runner-data
chown 1000:1000 /srv/runner-data
cd examples/docker-compose
secret=$(openssl rand -hex 20)
sed -i -e "s/{SHARED_SECRET}/$secret/" compose-forgejo-and-runner.yml
@ -38,7 +40,7 @@ jobs:
#
# Launch Forgejo & the runner
#
$cli up -d
$cli up -d --remove-orphans
for delay in $(seq 60) ; do test -f /srv/runner-data/.runner && break ; sleep 30 ; done
test -f /srv/runner-data/.runner
#

View file

@ -13,11 +13,8 @@
#
# Replace ${RUNNER_TOKEN} with the token obtained from the Forgejo web interface.
#
# Replace ROOT_PASSWORD with a secure password.
# Replace {ROOT_PASSWORD} with a secure password.
#
networks:
forgejo:
volumes:
docker_certs:
@ -27,8 +24,6 @@ services:
hostname: docker # Must set hostname for both internal DNS and TLS to work as certs are only valid for docker and localhost
restart: unless-stopped
privileged: true
networks:
- forgejo
environment:
DOCKER_TLS_CERTDIR: "/certs" # set to "" to disable the use of TLS, also manually update existing runner configs to use port 2375
DOCKER_HOST: "docker" # remove aswell to disable TLS
@ -38,8 +33,6 @@ services:
forgejo:
image: codeberg.org/forgejo/forgejo:1.21
hostname: forgejo
networks:
- forgejo
volumes:
- /srv/forgejo-data:/data
ports:
@ -50,7 +43,7 @@ services:
bash -c '
/bin/s6-svscan /etc/s6 &
sleep 10 ;
su -c "forgejo admin user create --admin --username root --password ROOT_PASSWORD --email root@example.com" git ;
su -c "forgejo admin user create --admin --username root --password {ROOT_PASSWORD} --email root@example.com" git ;
su -c "forgejo forgejo-cli actions register --secret {SHARED_SECRET}" git ;
sleep infinity
'
@ -69,11 +62,12 @@ services:
volumes:
- /srv/runner-data:/data
- docker_certs:/certs
networks:
- forgejo
depends_on:
- docker-in-docker
- forgejo
links:
- forgejo
- docker-in-docker
environment:
CONFIG_FILE: config.yml # defaults to /data/config.yml