some files

This commit is contained in:
saces 2024-10-09 22:19:13 +02:00
parent 821ca4bc22
commit 8fcfe6e751
13 changed files with 230 additions and 3 deletions

View file

@ -0,0 +1,22 @@
steps:
- name: cli-docker
image: registry.gitlab.com/mostlybroken/robertusfaber/dockerx-linux:latest
privileged: true
environment:
DOCKER_HOST: docker
commands:
- echo hallo from inner hehe
- echo $DOCKER_HOST
- pwd
- ls -la
- sleep 30
- docker compose -f dogfood-debug.yaml run --rm wooposex --log-level TRACE exec --repo-path . ./.woodpecker/cli.yaml
services:
- name: docker
image: docker.io/library/docker:dind
privileged: true
detach: true
environment:
DOCKER_TLS_CERTDIR: ""

15
.woodpecker/cli.yaml Normal file
View file

@ -0,0 +1,15 @@
steps:
- name: cli
image: docker.io/woodpeckerci/woodpecker-cli:latest-alpine
privileged: true
volumes:
- /var/run/dind:/var/run/dind
environment:
DOCKER_HOST: 'unix:///var/run/dind/docker.sock'
commands:
- echo hallo from inner hehe
- pwd
- ls -la
- ls /woodpecker
- /bin/woodpecker-cli --log-level TRACE exec --repo-path . ./.woodpecker/cli.yaml

12
.woodpecker/wooposex.yaml Normal file
View file

@ -0,0 +1,12 @@
steps:
- name: build
image: registry.gitlab.com/mostlybroken/robertusfaber/dockerx-linux:latest
commands:
- echo "This is the build step"
- echo "binary-data-123" > executable
- pwd
- whoami
- ls -la
- docker compose up
# TODO: mount volume

View file

@ -1,5 +1,27 @@
wooposex - Woodpecker compose example
=====================================
wooposex - WOOdpecker comPOSe EXamples
======================================
I'm not good at finding project names.
I'm not good at finding project names.
Examples what you can do with woodpecker/docker/compose.
Exists for exploring w/d/c edge cases, compose (syntax) compliance and such things, also for fun or desperation reasons.
Everything is run in docker in docker in docker…
applies to all demos:
Show the resolved compose configuration:
docker compose [-f <scriptname>] config
When done, remove the docker daemon and leftover containers:
docker compose [-f <scriptname>] down --remove-orphans
scriptname command line
what it does (or is supposed to do)
<none> docker compose up -d
run the whoole server/agent stack on localhost
cli.yaml docker compose -f cli.yaml run --rm cli
Watch the woodpecker cli running itself in docker

32
agent.yaml Normal file
View file

@ -0,0 +1,32 @@
services:
woodpecker-agent-docker:
image: woodpeckerci/woodpecker-agent:latest
command: agent
restart: unless-stopped
depends_on:
woodpecker-server:
condition: service_healthy
network_mode: none
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- docker-run:/var/run/dind
environment:
DOCKER_HOST: 'unix:///var/run/dind/docker.sock'
WOODPECKER_SERVER: 'woodpecker-server:9000'
WOODPECKER_AGENT_SECRET: ${WOODPECKER_AGENT_SECRET}
woodpecker-agent-shell:
image: woodpeckerci/woodpecker-agent:latest
command: agent
restart: unless-stopped
depends_on:
woodpecker-server:
condition: service_healthy
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
network_mode: none
environment:
WOODPECKER_SERVER: 'woodpecker-server:9000'
WOODPECKER_AGENT_SECRET: ${WOODPECKER_AGENT_SECRET}

21
caddy.yaml Normal file
View file

@ -0,0 +1,21 @@
services:
caddy:
image: docker.io/library/caddy:2-alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- ./Caddyfile:/etc/caddy/Caddyfile
- ./pretalx/public:/srv/pretalx
- caddy_data:/data
- caddy_config:/config
- type: 'volume'
source: caddy_talx_run
target: /var/run/talx/
- type: 'volume'
source: caddy_tix_run
target: /var/run/tix/

20
cli.yaml Normal file
View file

@ -0,0 +1,20 @@
include:
- dind.yaml
services:
cli:
image: docker.io/woodpeckerci/woodpecker-cli:latest
command: exec
restart: never
working_dir: /wooposex
depends_on:
dind:
condition: service_started
network_mode: none
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- docker-run:/var/run/dind
- .:/wooposex:ro
environment:
DOCKER_HOST: 'unix:///var/run/dind/docker.sock'

6
compose.yaml Normal file
View file

@ -0,0 +1,6 @@
include:
- caddy.yaml
- server.yaml
- agent.yaml
- postgres.yaml
- dind.yaml

12
dind.yaml Normal file
View file

@ -0,0 +1,12 @@
services:
dind:
image: docker.io/library/docker:dind
privileged: true
volumes:
- docker-run:/var/run/dind
- .:/wooposex
environment:
DOCKER_HOST: 'unix:///var/run/dind/docker.sock'
volumes:
docker-run:

20
dogfood.yaml Normal file
View file

@ -0,0 +1,20 @@
include:
- dind.yaml
services:
wooposex:
image: woodpeckerci/woodpecker-cli:latest
command: exec
restart: never
working_dir: /wooposex
depends_on:
dind:
condition: service_started
network_mode: none
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- docker-run:/var/run/dind
- .:/wooposex:ro
environment:
DOCKER_HOST: 'unix:///var/run/dind/docker.sock'

1
env-example Normal file
View file

@ -0,0 +1 @@
POSTGRES_WOODPECKER_PATH=/home/user/projekt/cberg/wooposex/testdata

25
postgres.yaml Normal file
View file

@ -0,0 +1,25 @@
services:
woodpecker-db:
image: docker.io/library/postgres:16-alpine3.20
restart: unless-stopped
environment:
POSTGRES_PASSWORD: ${POSTGRES_WOODPECKER_PW}
POSTGRES_USER: woodpecker
POSTGRES_DB: woodpecker
POSTGRES_INITDB_ARGS: --encoding=UTF-8 --lc-collate=C --lc-ctype=C
network_mode: none
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- type: 'volume'
source: postgres_run
target: /var/run/postgresql/
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "woodpecker", "-d", "woodpecker"]
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres_run:

19
server.yaml Normal file
View file

@ -0,0 +1,19 @@
services:
woodpecker-server:
image: woodpeckerci/woodpecker-server:latest
network_mode: none
depends_on:
woodpecker-db:
condition: service_healthy
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /opt/specht/server/data:/var/lib/woodpecker/
environment:
- WOODPECKER_OPEN=false
- WOODPECKER_HOST=${WOODPECKER_HOST}
- WOODPECKER_FORGEJO=true
- WOODPECKER_FORGEJO_URL=YOUR_FORGEJO_URL
- WOODPECKER_FORGEJO_CLIENT=YOUR_FORGEJO_CLIENT
- WOODPECKER_FORGEJO_SECRET=YOUR_FORGEJO_CLIENT_SECRET
- WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET}