added label support using LABELS env variable

This commit is contained in:
zhoob2004 2021-11-17 16:38:26 -07:00
parent 5d5050bfd7
commit 5d67093024
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
# rusefi-ci
This script will automatically download and configure the github actions self-hosted runner
This dockerfile will automatically download and configure the github actions self-hosted runner
To run, first build the image with:
@ -13,10 +13,13 @@ docker run --detach \
--ENV OWNER=ZHoob2004 \
--ENV REPO=rusefi \
--ENV REG_TOKEN=<PUT YO TOKEN HERE> \
--ENV LABELS="linux,self-hosted" \
rusefi-ci
```
add `--restart=unless-stopped` in order to have the container survive reboots
Note: the LABELS environment variable is optional, and if omitted will use the default labels as determined by the github runner.
Add `--restart=unless-stopped` in order to have the container survive reboots
The container uses a persistent volume mounted at /opt/actions-runner. After initial startup, the container will skip registration unless the peristent volume is erased.

View File

@ -3,12 +3,13 @@
OWNER=$OWNER
REPO=$REPO
REG_TOKEN=$REG_TOKEN
LABELS=${LABELS-"self-hosted"}
cd /opt/actions-runner
if [ ! -f ".runner" ]; then
./config.sh --url https://github.com/${OWNER}/${REPO} --token ${REG_TOKEN} --unattended
./config.sh --url https://github.com/${OWNER}/${REPO} --token ${REG_TOKEN} --labels ${LABELS} --unattended
fi
./run.sh & wait $!