bromite-buildtools/images/github-runner/start-runner.sh

45 lines
1.2 KiB
Bash
Raw Normal View History

2021-07-31 17:52:32 +05:30
#!/bin/bash
2021-08-10 15:20:58 +05:30
docker stop gh-proxy
GHRUNNERHOME=~/gh-runner
sudo rm -rf $GHRUNNERHOME/tmp
2021-08-03 20:56:16 +05:30
SYSBOX_UID=$(cat /etc/subuid | grep sysbox | cut -d : -f 2)
2021-08-10 15:20:58 +05:30
mkdir -p $GHRUNNERHOME/tmp/proxy
mkdir -p $GHRUNNERHOME/tmp/forward-proxy
mkdir -p $GHRUNNERHOME/redis
2021-08-03 20:56:16 +05:30
2021-08-10 15:20:58 +05:30
sudo chown $SYSBOX_UID:$SYSBOX_UID $GHRUNNERHOME/tmp/proxy
sudo chown $SYSBOX_UID:$SYSBOX_UID $GHRUNNERHOME/tmp/forward-proxy
sudo chown $SYSBOX_UID:$SYSBOX_UID $GHRUNNERHOME/redis
#sudo chown $SYSBOX_UID:$SYSBOX_UID $GHRUNNERHOME/docker-inner
2021-08-03 20:56:16 +05:30
docker run --rm -d --runtime=sysbox-runc \
--name=gh-proxy \
-e "REMOTEEXEC_ADDR=$REMOTEEXEC_ADDR" \
2021-08-10 15:20:58 +05:30
-v $GHRUNNERHOME/tmp/proxy:/tmp/proxy:rw \
-v $GHRUNNERHOME/tmp/forward-proxy:/tmp/forward-proxy:rw \
uazo/squid
docker logs gh-proxy
2021-08-03 20:56:16 +05:30
2021-07-31 17:52:32 +05:30
while true
do
2021-08-10 15:20:58 +05:30
#sudo chown -R $SYSBOX_UID:$SYSBOX_UID $GHRUNNERHOME/docker-inner
2021-07-31 17:52:32 +05:30
docker run --runtime=sysbox-runc --name=gh-runner -ti --rm \
--env-file=.env \
2021-08-10 15:20:58 +05:30
-v $GHRUNNERHOME/docker-inner/:/var/lib/docker/:rw \
2021-08-03 20:56:16 +05:30
-v /storage/images:/storage/images:rw \
2021-08-10 15:20:58 +05:30
-v $GHRUNNERHOME/tmp/proxy:/tmp/proxy:rw \
-v $GHRUNNERHOME/tmp/forward-proxy:/tmp/forward-proxy:rw \
-v $GHRUNNERHOME/redis:/redis:rw \
2021-07-31 17:52:32 +05:30
--network none \
uazo/github-runner
2021-08-10 15:20:58 +05:30
echo "You can stop now"
2021-07-31 17:52:32 +05:30
sleep 5s
done