Reduce redundancy of drone setup

This commit is contained in:
Manuel Thalmann 2024-11-26 14:54:52 +01:00
parent d9ace95328
commit 269f8b89e9
3 changed files with 36 additions and 21 deletions

View file

@ -0,0 +1,23 @@
services:
ci:
build:
context: .
dockerfile: ci.Dockerfile
restart: unless-stopped
env_file:
- server.common.env
docker:
image: drone/drone-runner-docker
restart: unless-stopped
env_file: runner.common.env
environment:
DRONE_RUNNER_NAME: docker-runner
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ssh:
image: drone/drone-runner-ssh
restart: unless-stopped
env_file:
- runner.common.env
environment:
DRONE_RUNNER_NAME: ssh-runner

View file

@ -1,27 +1,19 @@
services:
ci-template:
build:
context: .
dockerfile: ci.Dockerfile
restart: unless-stopped
env_file:
- server.common.env
extends:
file: docker-compose.core.yml
service: ci
env_file: []
environment: {}
docker-template:
image: drone/drone-runner-docker
restart: unless-stopped
extends:
file: docker-compose.core.yml
service: docker
depends_on: []
env_file:
- runner.common.env
environment:
DRONE_RUNNER_NAME: docker-runner
volumes:
- /var/run/docker.sock:/var/run/docker.sock
env_file: []
ssh-template:
image: drone/drone-runner-ssh
restart: unless-stopped
extends:
file: docker-compose.core.yml
service: ssh
depends_on: []
env_file:
- runner.common.env
environment:
DRONE_RUNNER_NAME: ssh-runner
env_file: []

View file

@ -19,7 +19,7 @@ begin
echo "{}" | sudo tee "$config" >/dev/null
echo "{}" | sudo tee "$secrets" >/dev/null
cp "$dir"/{ci.Dockerfile,.dockerignore} "$root"
cp "$dir"/{ci.Dockerfile,docker-compose.core.yml,.dockerignore} "$root"
echo "DRONE_JSONNET_ENABLED=true" | sudo tee "$root/server.common.env" >/dev/null
echo "DRONE_RUNNER_CAPACITY=2" | sudo tee "$root/runner.common.env" >/dev/null