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 - name: run the example
run: | run: |
set -x set -x
mkdir -p /srv/runner-data
chown 1000:1000 /srv/runner-data
cd examples/docker-compose cd examples/docker-compose
secret=$(openssl rand -hex 20) secret=$(openssl rand -hex 20)
sed -i -e "s/{SHARED_SECRET}/$secret/" compose-forgejo-and-runner.yml sed -i -e "s/{SHARED_SECRET}/$secret/" compose-forgejo-and-runner.yml
@ -38,7 +40,7 @@ jobs:
# #
# Launch Forgejo & the runner # 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 for delay in $(seq 60) ; do test -f /srv/runner-data/.runner && break ; sleep 30 ; done
test -f /srv/runner-data/.runner 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 ${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: volumes:
docker_certs: 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 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 restart: unless-stopped
privileged: true privileged: true
networks:
- forgejo
environment: environment:
DOCKER_TLS_CERTDIR: "/certs" # set to "" to disable the use of TLS, also manually update existing runner configs to use port 2375 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 DOCKER_HOST: "docker" # remove aswell to disable TLS
@ -38,8 +33,6 @@ services:
forgejo: forgejo:
image: codeberg.org/forgejo/forgejo:1.21 image: codeberg.org/forgejo/forgejo:1.21
hostname: forgejo hostname: forgejo
networks:
- forgejo
volumes: volumes:
- /srv/forgejo-data:/data - /srv/forgejo-data:/data
ports: ports:
@ -50,7 +43,7 @@ services:
bash -c ' bash -c '
/bin/s6-svscan /etc/s6 & /bin/s6-svscan /etc/s6 &
sleep 10 ; 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 ; su -c "forgejo forgejo-cli actions register --secret {SHARED_SECRET}" git ;
sleep infinity sleep infinity
' '
@ -69,11 +62,12 @@ services:
volumes: volumes:
- /srv/runner-data:/data - /srv/runner-data:/data
- docker_certs:/certs - docker_certs:/certs
networks:
- forgejo
depends_on: depends_on:
- docker-in-docker - docker-in-docker
- forgejo - forgejo
links:
- forgejo
- docker-in-docker
environment: environment:
CONFIG_FILE: config.yml # defaults to /data/config.yml CONFIG_FILE: config.yml # defaults to /data/config.yml