-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-runner.sh
More file actions
executable file
·37 lines (31 loc) · 1.21 KB
/
docker-runner.sh
File metadata and controls
executable file
·37 lines (31 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Script per avviare GitHub Actions runner in Docker
# File: docker-runner.sh
echo "🐳 Starting GitHub Actions Runner in Docker..."
# Carica variabili d'ambiente da file .env se esiste
if [ -f ".env" ]; then
echo "📄 Caricando configurazione da .env..."
export $(grep -v '^#' .env | xargs)
fi
# Ferma eventuali container esistenti
docker stop github-runner 2>/dev/null || true
docker rm github-runner 2>/dev/null || true
# Avvia il runner in Docker
# IMPORTANTE: Imposta la variabile d'ambiente RUNNER_TOKEN prima di eseguire questo script
# export RUNNER_TOKEN="your-token-here"
if [ -z "$RUNNER_TOKEN" ]; then
echo "❌ Errore: RUNNER_TOKEN non impostato!"
echo "💡 Esegui: export RUNNER_TOKEN=\"your-token-here\""
exit 1
fi
docker run -d --name github-runner \
--restart unless-stopped \
-e RUNNER_NAME="dh-unica-docker" \
-e RUNNER_TOKEN="$RUNNER_TOKEN" \
-e RUNNER_REPOSITORY_URL="https://github.com/caprowsky/proxy.dh.unica" \
-e RUNNER_LABELS="self-hosted,Linux,X64,docker" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /home/dhwp/proxy.dh.unica:/workspace \
myoung34/github-runner:latest
echo "✅ Runner Docker avviato!"
echo "📋 Controlla con: docker logs github-runner"