From f1c551f6173d62b636dbc9879cf10400613918a7 Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Wed, 14 Jun 2023 07:10:25 +0200 Subject: [PATCH] Added docker-compose.yaml Signed-off-by: Janos SUTO --- tests/docker-compose.yaml | 54 +++++++++++++++++++++++++++++++++++++++ tests/setup.inc | 13 ++++++++++ 2 files changed, 67 insertions(+) create mode 100644 tests/docker-compose.yaml diff --git a/tests/docker-compose.yaml b/tests/docker-compose.yaml new file mode 100644 index 00000000..57958856 --- /dev/null +++ b/tests/docker-compose.yaml @@ -0,0 +1,54 @@ +##docker run --rm --name builder-piler-58-jammy --memory 1G --pids-limit 64 --network piler -e DISTRO=jammy -e COMMIT_HASH=crlf_fix2 -e FORCE_BUILD=false -e SECRETS_FILE=/data/secrets.inc -e PROJECT_ID=piler -e BUILD_NUMBER=58 -e JOB_NAME=piler -e DRY_RUN=false -e DEBUG=false -e S3_HOST=ibm -e WORKSPACE=/home/jenkins/workspace/piler -e RT=0 -v /home/jenkins/data:/data -v /home/jenkins/config/config.json:/root/.mc/config.json:ro -v /home/jenkins/config/piler.pem:/etc/piler/piler.pem:ro -v /home/jenkins/config/piler.conf:/etc/piler/piler.conf:ro -v /home/jenkins/config/jenkins.key:/root/.ssh/jenkins.key:ro -v /home/jenkins/license:/license -v /usr/local/bin/mc:/usr/local/bin/mc:ro sutoj/builder:jammy + +version: '3.4' +services: + syslog: + image: sutoj/syslog + container_name: syslog.host + networks: + - piler + deploy: + resources: + limits: + memory: 512M + + piler: + image: sutoj/piler:jammy + container_name: piler1 + networks: + - piler + deploy: + resources: + limits: + memory: 512M + env_file: + - ./.env + ports: + - "127.0.0.1:80:80" + - "25:25" + volumes: + - /home/jenkins/data:/data:ro + - /home/jenkins/config/11-aaaa.conf:/etc/rsyslog.d/11-aaaa.conf:ro + healthcheck: + test: ["CMD", "curl", "-s", "smtp://localhost"] + interval: 10s + timeout: 3s + retries: 3 + start_period: 10s + depends_on: + - smarthost + - syslog + + smarthost: + image: sutoj/smtps-source + container_name: smarthost.aaa.fu + networks: + - piler + deploy: + resources: + limits: + memory: 64M + command: smtp-sink -h smarthost.aaa.fu -u nobody :25 10 + +networks: + piler: diff --git a/tests/setup.inc b/tests/setup.inc index 956c8d1f..3c4ba5fa 100644 --- a/tests/setup.inc +++ b/tests/setup.inc @@ -21,6 +21,19 @@ cleanup_package() { } launch_containers() { + echo -e "PACKAGE=$PACKAGE\nPILER_HOST=cust1.acts.hu\nRT=$RT" > .env + cat .env + + env|sort + pwd + log "running docker-compose" + docker-compose up -d + wait_for_sleep_cycle_in_container "piler1" + + docker-compose ps +} + +launch_containers2() { log "starting syslog server" docker run -d --net=piler "${DOCKER_LIMIT[@]}" --name syslog.host sutoj/syslog