Skip to content

Commit 472174b

Browse files
ci: add run-local-instance target to Makefile (docker-mailserver#3663)
1 parent 68f9671 commit 472174b

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ All notable changes to this project will be documented in this file. The format
66

77
> **Note**: Changes and additions listed here are contained in the `:edge` image tag. These changes may not be as stable as released changes.
88
9+
### Added
10+
11+
- command (`run-local-instance`) to test a version of DMS that was built locally to test changes
12+
913
### Fixed
1014

1115
- **Internal**:

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,22 @@ clean: ALWAYS_RUN
3232
-@ while read -r LINE; do [[ $${LINE} =~ test/.+ ]] && FILES+=("/mnt$${LINE#test}"); done < .gitignore ; \
3333
docker run --rm -v "$(REPOSITORY_ROOT)/test/:/mnt" alpine ash -c "rm -rf $${FILES[@]}"
3434

35+
run-local-instance: ALWAYS_RUN
36+
bash -c 'sleep 8 ; ./setup.sh email add [email protected] 123' &
37+
docker run --rm --interactive --tty --name dms-test_example \
38+
--env OVERRIDE_HOSTNAME=mail.example.test \
39+
--env POSTFIX_INET_PROTOCOLS=ipv4 \
40+
--env DOVECOT_INET_PROTOCOLS=ipv4 \
41+
--env ENABLE_CLAMAV=0 \
42+
--env ENABLE_AMAVIS=0 \
43+
--env ENABLE_RSPAMD=0 \
44+
--env ENABLE_OPENDKIM=0 \
45+
--env ENABLE_OPENDMARC=0 \
46+
--env ENABLE_POLICYD_SPF=0 \
47+
--env ENABLE_SPAMASSASSIN=0 \
48+
--env LOG_LEVEL=trace \
49+
$(IMAGE_NAME)
50+
3551
# -----------------------------------------------
3652
# --- Tests ------------------------------------
3753
# -----------------------------------------------

docs/content/contributing/tests.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ We use `make` to run commands.
7878

7979
When writing tests, ensure that parallel set tests still pass when run in parallel. You need to account for other tests running in parallel that may interfere with your own tests logic.
8080

81+
!!! tip
82+
83+
You may use `make run-local-instance` to run a version of the image built locally to test and edit your changes in a running DMS instance.
84+
8185
### An Example
8286

8387
In this example, you've made a change to the Rspamd feature support (_or adjusted it's tests_). First verify no regressions have been introduced by running it's specific test file:

0 commit comments

Comments
 (0)