- [test](test) Export TST_REPO and TST_VER.

master
mlan 2021-01-18 23:03:06 +01:00
parent e0fc560dd3
commit 70b6ab3a9f
6 changed files with 29 additions and 22 deletions

View File

@ -1,3 +1,8 @@
# Makefile
#
# build
#
-include *.mk
#BLD_ARG ?= --build-arg DIST=ubuntu --build-arg REL=18.04 --build-arg ARCH=i386
@ -5,13 +10,16 @@ BLD_ARG ?=
BLD_REPO ?= mlan/kopano
BLD_VER ?= latest
BLD_TGT ?= full
SRC_CMD ?= src/kopano/bin/kopano-webaddr.sh -VV
SRC_VER ?= $(shell $(SRC_CMD))
IMG_REPO ?= $(BLD_REPO)
IMG_VER ?= $(BLD_VER)
TST_REPO ?= $(BLD_REPO)
TST_VER ?= $(BLD_VER)
TST_ENV ?= -C test
TST_TGTE ?= $(addprefix test-,all diff down env htop imap lmtp logs mail pop3 pull sh sv up)
TST_TGTI ?= test_% test-up_%
export TST_REPO TST_VER
_version = $(if $(findstring $(BLD_TGT),$(1)),\
$(if $(findstring latest,$(2)),latest $(1) $(SRC_VER) $(1)-$(SRC_VER),$(2) $(1)-$(2)),\
$(if $(findstring latest,$(2)),$(1) $(1)-$(SRC_VER),$(1)-$(2)))

View File

@ -1,5 +1,5 @@
COMPOSE_PROJECT_NAME=demo
SYSLOG_LEVEL=6
SYSLOG_LEVEL=7
LOG_LEVEL=6
AD_DEBUG=stats
AD_ADM_CN=admin

View File

@ -287,15 +287,8 @@ mta-test_auth:
docker-compose exec mta doveadm auth test $(AD_USR_CN) $(AD_USR_PW)
mta-test_imap: mta-hostaddr
curl imap://$(myhost) -X CAPABILITY $(CURL_DBG)
curl imap://$(myhost) -u $(AD_USR_CN):$(AD_USR_PW) $(CURL_DBG)
mta-test_rimap:
docker-compose exec mta curl imap://app -X CAPABILITY
docker-compose exec mta curl imap://app -u $(AD_USR_CN):$(AD_USR_PW)
mta-test_ldap: mta-debugtools
docker-compose exec mta ldapsearch -H ldap://auth:389 -xLLL -s base namingContexts
curl imaps://$(myhost)/inbox -s --ssl --anyauth -k -X "fetch 1 all" \
-u $(AD_USR_CN):$(AD_USR_PW)
db-init:

View File

@ -63,6 +63,7 @@ services:
- MESSAGE_SIZE_LIMIT=${MESSAGE_SIZE_LIMIT-25600000}
- LDAP_HOST=auth
- VIRTUAL_TRANSPORT=lmtp:app:2003
# - VIRTUAL_TRANSPORT=lmtp:unix:private/transport
- SMTP_RELAY_HOSTAUTH=${SMTP_RELAY_HOSTAUTH-}
- SMTP_TLS_SECURITY_LEVEL=${SMTP_TLS_SECURITY_LEVEL-}
- SMTP_TLS_WRAPPERMODE=${SMTP_TLS_WRAPPERMODE-no}

View File

@ -7,7 +7,7 @@
#
#
# Setup ACME monitor and arrange certificate sym-links
# Setup ACME monitor and arrange certificate symbolic links
#
acme_monitor_tls_cert
acme_symlink_tls_cert

View File

@ -1,8 +1,13 @@
# Makefile
#
# test
#
-include *.mk
IMG_REPO ?= mlan/kopano
IMG_VER ?= latest
_ver = $(if $(findstring latest,$(1)),$(2),$(1)-$(2))
TST_REPO ?= mlan/kopano
TST_VER ?= latest
_ver = $(if $(findstring latest,$(1)),$(2),$(2)-$(1))
NET_NAME ?= test-net
NET_ENV ?= --network $(NET_NAME)
@ -146,12 +151,12 @@ test-up_0: test-up-net
# run containers see if there are logs and stop.
#
#
docker run -d --name $(APP_NAME) $(IMG_REPO):$(call _ver,$(IMG_VER),core)
docker run -d --name $(APP_NAME) $(TST_REPO):$(call _ver,$(TST_VER),core)
sleep $(TST_W8L1)
docker container logs $(APP_NAME) | grep 'docker-entrypoint.sh'
docker rm -fv $(APP_NAME)
sleep $(TST_W8S1)
docker run -d --name $(APP_NAME) $(IMG_REPO):$(call _ver,$(IMG_VER),full)
docker run -d --name $(APP_NAME) $(TST_REPO):$(call _ver,$(TST_VER),full)
sleep $(TST_W8L1)
docker container logs $(APP_NAME) | grep 'docker-entrypoint.sh'
docker rm -fv $(APP_NAME)
@ -174,7 +179,7 @@ test-up_1: test-up-net test-up-deps_1 test-up-auth_1
# recv: curl imap://app
#
#
docker run -d $(APP_ENV) $(APP_VOL) $(IMG_REPO):$(call _ver,$(IMG_VER),core)
docker run -d $(APP_ENV) $(APP_VOL) $(TST_REPO):$(call _ver,$(TST_VER),core)
test-up_2: test-up-net test-up-deps_2 test-up-auth_2
#
@ -187,7 +192,7 @@ test-up_2: test-up-net test-up-deps_2 test-up-auth_2
# recv: curl imaps://app
#
#
docker run -d $(APPS_ENV) $(APP_VOL) $(IMG_REPO):$(call _ver,$(IMG_VER),core)
docker run -d $(APPS_ENV) $(APP_VOL) $(TST_REPO):$(call _ver,$(TST_VER),core)
test-up_3: test-up-net test-up-deps_3 test-up-auth_3 acme/acme.json
#
@ -201,7 +206,7 @@ test-up_3: test-up-net test-up-deps_3 test-up-auth_3 acme/acme.json
# web: curl http://app
#
#
docker run -d $(APPA_ENV) $(APP_VOL) $(IMG_REPO):$(call _ver,$(IMG_VER),full)
docker run -d $(APPA_ENV) $(APP_VOL) $(TST_REPO):$(call _ver,$(TST_VER),full)
test-up: test-up_1
@ -246,7 +251,7 @@ test-up-deps_%:
test-up-auth_%:
sleep $(TST_W8L1)
docker run $(TAW_ENV) $(IMG_REPO):$(call _ver,$(IMG_VER),core) \
docker run $(TAW_ENV) $(TST_REPO):$(call _ver,$(TST_VER),core) \
zcat /usr/share/doc/kopano/kopano.ldif.gz \
| docker exec -i $(AUT_NAME) ldapadd -Q
echo "$$LDIF_ADD_DATA" | docker exec -i $(AUT_NAME) ldapadd -Q