1
0
mirror of https://github.com/zokradonh/kopano-docker synced 2025-06-07 07:56:12 +00:00

rework test image (#185)

use scheduler image as base
after dockerize round also execute some other commands
clean up test containers after run
switch kopano-admin to listing users (also more helpful when debugging)
comment kopano-cli for the moment
This commit is contained in:
Felix Bartels 2019-06-16 10:59:42 +02:00 committed by GitHub
parent adfbfeb4a3
commit e0792a39a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 10 deletions

View File

@ -349,8 +349,9 @@ test-ci: ## Test if all containers start up
docker-compose -f $(DOCKERCOMPOSE_FILE) -f tests/test-container.yml build
docker-compose -f $(DOCKERCOMPOSE_FILE) up -d
docker-compose -f $(DOCKERCOMPOSE_FILE) ps
docker-compose -f $(DOCKERCOMPOSE_FILE) -f tests/test-container.yml run test || (docker-compose -f $(DOCKERCOMPOSE_FILE) -f tests/test-container.yml down -v; exit 1)
docker-compose -f $(DOCKERCOMPOSE_FILE) -f tests/test-container.yml run test || (docker-compose -f $(DOCKERCOMPOSE_FILE) -f tests/test-container.yml ps; exit 1)
docker-compose -f $(DOCKERCOMPOSE_FILE) -f tests/test-container.yml stop 2>/dev/null
docker ps --filter name=kopano_test* -aq | xargs docker rm -f
test-security: ## Scan containers with Trivy for known security risks (not part of CI workflow for now).
cat $(TAG_FILE) | xargs -I % sh -c 'trivy --exit-code 0 --severity HIGH --quiet --auto-refresh %'

View File

@ -1,10 +1,5 @@
FROM alpine:3.9
ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
ARG docker_repo=zokradonh
FROM ${docker_repo}/kopano_scheduler
COPY test.sh /start.sh

View File

@ -1,7 +1,10 @@
#!/bin/sh
#!/bin/bash
set -ex
# waits for key events in various containers
# e.g. kopano_server:236 signals succesful start of kopano-server process
exec dockerize \
dockerize \
-wait file://var/run/kopano/grapi/notify.sock \
-wait file://var/run/kopano/server.sock \
-wait http://kopano_konnect:8777/.well-known/openid-configuration \
@ -17,3 +20,8 @@ exec dockerize \
-wait tcp://kopano_webapp:9080 \
-wait tcp://kopano_zpush:80 \
-timeout 120s
#docker exec kopano_server kopano-cli --sync
docker exec kopano_server kopano-admin -l
docker exec kopano_zpush z-push-admin -a list
docker exec kopano_zpush z-push-gabsync -a sync

View File

@ -4,6 +4,8 @@ services:
test:
build:
context: tests/startup-test
args:
docker_repo: ${docker_repo:-zokradonh}
networks:
- kopano-net
- ldap-net
@ -12,5 +14,6 @@ services:
- kopanodata/:/kopano/data
- kopanossl/:/kopano/ssl
- kopanosocket/:/run/kopano
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- KCCONF_SERVER_MYSQL_HOST=${MYSQL_HOST}