first commit
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.env
|
||||
22
Dockerfile
Normal file
22
Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
FROM ubuntu:22.04 as final
|
||||
|
||||
ARG RUNNER_VERSION=0.2.13
|
||||
|
||||
# needed always
|
||||
RUN apt-get update && \
|
||||
apt-get install wget curl software-properties-common golang -y && \
|
||||
cd ~ && curl -sL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh && \
|
||||
bash nodesource_setup.sh && apt install nodejs
|
||||
|
||||
RUN mkdir -p /app && \
|
||||
chmod -R 777 /app && \
|
||||
mkdir /config && \
|
||||
chmod 777 /config
|
||||
|
||||
RUN wget "https://gitea.com/gitea/act_runner/releases/download/v${RUNNER_VERSION}/act_runner-${RUNNER_VERSION}-linux-amd64" && \
|
||||
mv "act_runner-${RUNNER_VERSION}-linux-amd64" "/app/act_runner" && \
|
||||
chmod 777 /app/act_runner
|
||||
|
||||
COPY "./entrypoint.sh" "/app/entrypoint.sh"
|
||||
|
||||
ENTRYPOINT "/app/entrypoint.sh"
|
||||
19
docker-compose.yml
Normal file
19
docker-compose.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
services:
|
||||
|
||||
# when you want to rebuild the runner (this creates a new runner) run:
|
||||
# sudo docker compose up --build -d
|
||||
gitea-runner-dotnet:
|
||||
container_name: "gitea-runner-dotnet"
|
||||
restart: unless-stopped
|
||||
build:
|
||||
context: .
|
||||
volumes:
|
||||
#- /var/run/docker.sock:/var/run/docker.sock
|
||||
#- ./config:/config
|
||||
- ./data:$HOME/.cache
|
||||
- ./configs/NuGet:/root/.nuget/NuGet
|
||||
environment:
|
||||
GITEA_INSTANCE_URL: "http://gitea.int.boger.local"
|
||||
GITEA_RUNNER_REGISTRATION_TOKEN: ${GITEA_REG_TOKEN}
|
||||
GITEA_RUNNER_NAME: "gitea-runner-dotnet"
|
||||
GITEA_RUNNER_LABELS: "dotnet-10,ubuntu2204"
|
||||
11
entrypoint.sh
Normal file
11
entrypoint.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Connecting to ${GITEA_INSTANCE_URL}"
|
||||
|
||||
if ! test -f .runner; then
|
||||
echo "No .runner file detected, running registration"
|
||||
/app/act_runner register --instance "${GITEA_INSTANCE_URL}" --token "${GITEA_RUNNER_REGISTRATION_TOKEN}" --name "${GITEA_RUNNER_NAME}" --labels "${GITEA_RUNNER_LABELS}" --no-interactive
|
||||
touch /.runner
|
||||
fi
|
||||
|
||||
/app/act_runner daemon
|
||||
Reference in New Issue
Block a user