Reduce redundancy of drone setup

This commit is contained in:
Manuel Thalmann 2024-11-26 14:54:52 +01:00
parent 4cdda3076e
commit 6bd9fb00ef
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: services:
ci-template: ci-template:
build: extends:
context: . file: docker-compose.core.yml
dockerfile: ci.Dockerfile service: ci
restart: unless-stopped env_file: []
env_file:
- server.common.env
environment: {} environment: {}
docker-template: docker-template:
image: drone/drone-runner-docker extends:
restart: unless-stopped file: docker-compose.core.yml
service: docker
depends_on: [] depends_on: []
env_file: env_file: []
- runner.common.env
environment:
DRONE_RUNNER_NAME: docker-runner
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ssh-template: ssh-template:
image: drone/drone-runner-ssh extends:
restart: unless-stopped file: docker-compose.core.yml
service: ssh
depends_on: [] depends_on: []
env_file: env_file: []
- runner.common.env
environment:
DRONE_RUNNER_NAME: ssh-runner

View file

@ -19,7 +19,7 @@ begin
echo "{}" | sudo tee "$config" >/dev/null echo "{}" | sudo tee "$config" >/dev/null
echo "{}" | sudo tee "$secrets" >/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_JSONNET_ENABLED=true" | sudo tee "$root/server.common.env" >/dev/null
echo "DRONE_RUNNER_CAPACITY=2" | sudo tee "$root/runner.common.env" >/dev/null echo "DRONE_RUNNER_CAPACITY=2" | sudo tee "$root/runner.common.env" >/dev/null