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

49 lines
1.4 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
2021-10-08 17:31:43 +05:30
#sudo rm $GHRUNNERHOME/var/run/docker.socks
2021-08-10 15:20:58 +05:30
#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-10-08 17:31:43 +05:30
-v $GHRUNNERHOME/var/run:/var/run \
2022-10-05 18:54:56 +05:30
-v /casefold:/win_sdk \
2021-07-31 17:52:32 +05:30
--network none \
2021-10-08 17:31:43 +05:30
--device=/dev/kvm \
2023-04-20 14:30:56 +05:30
uazo/github-runner:2.303.1
2021-07-31 17:52:32 +05:30
2021-08-10 15:20:58 +05:30
echo "You can stop now"
2021-07-31 17:52:32 +05:30
sleep 5s
done