gitea/peertube runner foundations. secrets mgmt is a blocker. Adding that to my shell framework and will vendor that framework into here.
This commit is contained in:
		
							
								
								
									
										1
									
								
								inprep/gitea-runner/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								inprep/gitea-runner/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
https://docs.gitea.com/next/usage/actions/act-runner/
 | 
			
		||||
							
								
								
									
										14
									
								
								inprep/gitea-runner/docker-compose.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								inprep/gitea-runner/docker-compose.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
version: "3.8"
 | 
			
		||||
services:
 | 
			
		||||
  runner:
 | 
			
		||||
    image: docker.io/gitea/act_runner:nightly
 | 
			
		||||
    environment:
 | 
			
		||||
      CONFIG_FILE: /config.yaml
 | 
			
		||||
      GITEA_INSTANCE_URL: "${INSTANCE_URL}"
 | 
			
		||||
      GITEA_RUNNER_REGISTRATION_TOKEN: "${REGISTRATION_TOKEN}"
 | 
			
		||||
      GITEA_RUNNER_NAME: "${RUNNER_NAME}"
 | 
			
		||||
      GITEA_RUNNER_LABELS: "${RUNNER_LABELS}"
 | 
			
		||||
    volumes:
 | 
			
		||||
      - ./config.yaml:/config.yaml
 | 
			
		||||
      - ./data:/data
 | 
			
		||||
      - /var/run/docker.sock:/var/run/docker.sock
 | 
			
		||||
							
								
								
									
										9
									
								
								inprep/peertube-runner/Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								inprep/peertube-runner/Dockerfile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
FROM alpine:latest
 | 
			
		||||
 | 
			
		||||
RUN apk add --no-cache nodejs npm ffmpeg
 | 
			
		||||
RUN npm install -g @peertube/peertube-runner
 | 
			
		||||
 | 
			
		||||
COPY entrypoint.sh /entrypoint.sh
 | 
			
		||||
RUN chmod +x /entrypoint.sh
 | 
			
		||||
 | 
			
		||||
ENTRYPOINT ["/entrypoint.sh"]
 | 
			
		||||
							
								
								
									
										21
									
								
								inprep/peertube-runner/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								inprep/peertube-runner/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
# PeerTube Runner Docker 
 | 
			
		||||
 | 
			
		||||
This Docker image sets up a PeerTube runner with all necessary dependencies installed.  
 | 
			
		||||
 | 
			
		||||
When stopping the container, the runner is removed from the peertube instance.
 | 
			
		||||
 | 
			
		||||
Name is set to the container ID when run standalone, and the node name when run in a swarm .
 | 
			
		||||
 | 
			
		||||
## Usage
 | 
			
		||||
 | 
			
		||||
1. **Environment Variables**:
 | 
			
		||||
   - `URL`: PeerTube instance URL.
 | 
			
		||||
   - `TOKEN`: Registration token.
 | 
			
		||||
 | 
			
		||||
2. **Run the Container**:
 | 
			
		||||
   ```bash
 | 
			
		||||
   docker run -e URL=http://127.0.0.1:9000 -e TOKEN=ptrrt-**** peertube-runner
 | 
			
		||||
   ```
 | 
			
		||||
## Note
 | 
			
		||||
 | 
			
		||||
This container is meant to be a basic runner, so there is no encryption or captioning
 | 
			
		||||
							
								
								
									
										20
									
								
								inprep/peertube-runner/entrypoint.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								inprep/peertube-runner/entrypoint.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
if [ -n "$DOCKER_SERVICE_NAME" ]; then
 | 
			
		||||
	NAME="$NODE_NAME"
 | 
			
		||||
else
 | 
			
		||||
	NAME=$(uname -n)
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
cleanup() {
 | 
			
		||||
	echo "Container is stopping, removing runner '$NAME'..."
 | 
			
		||||
	peertube-runner unregister --url $URL --runner-name $NAME
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
trap cleanup SIGTERM
 | 
			
		||||
 | 
			
		||||
echo "Starting runner $NAME"...
 | 
			
		||||
 | 
			
		||||
peertube-runner server & sleep 5 && \
 | 
			
		||||
peertube-runner register --url $URL --registration-token $TOKEN --runner-name $NAME && \
 | 
			
		||||
wait
 | 
			
		||||
		Reference in New Issue
	
	Block a user