forgejo-runner/edit_config.sh
2024-09-05 13:36:23 -03:00

16 lines
598 B
Bash
Executable file

#!/bin/bash
grep -Fq 'network: ""' runner-data/config.yml ;
if [[ $? -ne 0 ]] ; then
echo "Already modified config file!"
set -e
exit 1
fi
sed -i -e "s|network: .*|network: host|" runner-data/config.yml ;
sed -i -e "s|^ envs:\$| envs:\n DOCKER_HOST: tcp://docker:2376\n DOCKER_TLS_VERIFY: 1\n DOCKER_CERT_PATH: /certs/client|" runner-data/config.yml ;
sed -i -e "s|^ options:| options: -v /certs/client:/certs/client|" runner-data/config.yml ;
sed -i -e "s| valid_volumes: \[\]\$| valid_volumes:\n - /certs/client|" runner-data/config.yml ;
echo "Updated config file."