Skip to content

Commit 189e537

Browse files
georglauterbachcasperkleinradicandwilliamdes
authored
Final Migration Step (docker-mailserver#6)
* first migration steps * altered issue templates * altered README * removed .travis.yml * adjusting registry & repository, Dockerfile and compose.env * Close stale issues automatically * Integrated CI with Github Actions (docker-mailserver#3) * feat: integrated ci with github actions * fix: use secrets for docker org and update image * docs: clarify why we use -t if no tty exists * fix: correct remaining references to old repo chore: prettier automatically updated markdown as well * fix: hardcode docker org * change testing image to just testing * ci: add armv7 as a supported platform * finished migration steps * corrected linting in build-push action * corrected linting in build-push action (2) * minor preps for PR * correcting push on pull request and minor details * adjusted workflows to adhere closer to @wernerfred's diagram * minor patches * adjusting Dockerfile's installation of base packages * adjusting schedule for stale issue action * reverting license text * improving CONTRIBUTING.md PR text * Update CONTRIBUTING.md * a bigger patch at the end * moved all scripts into one directory under target/scripts/ * moved the quota-warning.sh script into target/scripts/ and removed empty directory /target/dovecot/scripts * minor fixes here and there * adjusted workflows for use a fully qualified name (i.e. docker.io/...) * improved on the Dockerfile layer count * corrected local tests - now they (actually) work (fine)! * corrected start-mailserver.sh to make use of defaults consistently * removed very old, deprecated variables (actually only one) * various smaller improvements in the end * last commit before merging docker-mailserver#6 * rearranging variables to use alphabetic order Co-authored-by: casperklein <[email protected]> Co-authored-by: Nick Pappas <[email protected]> Co-authored-by: William Desportes <[email protected]>
1 parent 66422cb commit 189e537

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1627
-1654
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.github
22
.git
3+
.idea
4+
.vscode
35

46
test/

.github/CONTRIBUTING.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 36 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
---
22
name: "\U0001F41E Bug report"
33
about: Create a report about a reproducible bug
4-
title: ''
5-
labels: bug, needs triage
6-
assignees: ''
7-
4+
title: "[BUG]"
5+
labels: area/bug, meta/needs triage, priority/medium
6+
assignees: ""
87
---
9-
<!--- Provide a general summary of the issue in the Title above -->
10-
11-
<!-- Thanks for the bug report! -->
12-
138

149
<!---
15-
## Possible answers to you issue
10+
Possible answers to your issue
11+
1612
* ClamAV keeps restarting:
17-
https://github.com/tomav/docker-mailserver#requirements
13+
https://github.com/docker-mailserver/docker-mailserver#requirements
1814
1915
* Email seen as spam:
2016
https://github.com/tomav/docker-mailserver/wiki/Configure-SPF
@@ -34,53 +30,52 @@ assignees: ''
3430
https://github.com/tomav/docker-mailserver/wiki
3531
3632
* Open issues
37-
https://github.com/tomav/docker-mailserver/issues
33+
https://github.com/docker-mailserver/docker-mailserver/issues
3834
-->
3935

40-
## Context
41-
<!--- Provide a more detailed introduction to the issue itself -->
42-
<!--- How has this issue affected you? What were you trying to accomplish? -->
43-
44-
### *What* is affected by this bug?
36+
# Bug Report
4537

38+
## Context
4639

40+
<!--- Provide a general summary of the bug -->
4741

48-
### *When* does this occur?
42+
### What is affected by this bug?
4943

44+
### When does this occur?
5045

51-
## *How* do we replicate the issue?
52-
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
53-
<!--- reproduce this issue include code to reproduce, if relevant -->
46+
### How do we replicate the issue?
5447

5548
1.
5649
2.
5750
3.
5851
4.
5952

60-
## Actual Behavior
61-
<!--- Tell us what happens instead -->
53+
## Behavior
6254

63-
## Expected behavior (i.e. solution)
64-
<!--- Tell us what should happen -->
55+
### Actual Behavior
6556

57+
### Expected Behavior
6658

6759
## Your Environment
60+
6861
<!--- Include as many relevant details about the environment you experienced the issue in -->
69-
* Amount of RAM available:
70-
* Mailserver version used:
71-
* Docker version used:
72-
* Environment settings relevant to the config:
73-
* Any relevant stack traces ("Full trace" preferred):
74-
75-
<!---
76-
Please remember to format code using triple backticks (`) so that it is neatly formatted when the issue is posted.
77-
78-
Spoilers are recommended for readability:
79-
<details>
80-
<summary>Click me to expand </summary>
81-
```sh
82-
echo "hello world"
83-
```
84-
</details>
8562

86-
-->
63+
- version: `v`
64+
- available RAM: `GB`
65+
- Docker version: `v`
66+
67+
### Environment Variables
68+
69+
```CFG
70+
71+
```
72+
73+
### Relevant Stack Traces
74+
75+
<!-- Remember to format code using triple backticks (`) so that it is neatly formatted when the issue is posted. -->
76+
77+
```BASH
78+
# BEGIN
79+
80+
# END
81+
```
Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,48 @@
11
---
22
name: "\U0001F389 Feature request"
33
about: Suggest an idea for this project
4-
title: ''
5-
labels: feature request, needs triage
4+
title: '[FR]'
5+
labels: area/enhancement, kind/feature request, meta/needs triage, priority/low
66
assignees: ''
77

88
---
99

10-
## Is your feature request related to a problem?
11-
<!-- A clear and concise description of what the problem is. -->
10+
# Feature Request
1211

12+
## Context
1313

1414

15-
## Describe the solution you'd like
16-
<!-- A clear and concise description of what you want to happen. -->
1715

16+
### Is your Feature Request related to a Problem?
1817

1918

20-
## Alternatives you've considered
21-
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
2219

20+
### Describe the Solution you'd like
2321

2422

25-
## Who will that feature be useful to?
26-
<!-- Is it solving a common problem, or is it an improvement that all current users will benefit from? -->
2723

24+
### Are you going to implement it?
2825

26+
<!-- Select one, remove the other and do not shorten the sentence -->
2927

30-
## What have you done already?
31-
<!-- If you already built a prototype or a complete implementation of that feature, where is it possible to see it? -->
28+
Yes, because I know the probability of someone else doing it is low and I can learn from it.
3229

30+
No, and I understand that it is highly likely no one will implement it. Furthermore, I understand that this issue will likely become stale and will be closed.
3331

34-
35-
## What are you going to contribute?
36-
<!-- Besides testing volunteering work made by other people, what are you going to contribute in order to help have that feature implemented, tested and documented? -->
32+
### What are you going to contribute??
3733

3834

3935

4036
## Additional context
41-
<!-- Add any other context about the feature request here. -->
37+
38+
### Alternatives you've considered
39+
40+
41+
42+
### Who will that Feature be useful to?
43+
44+
45+
46+
### What have you done already?
47+
4248

.github/ISSUE_TEMPLATE/questions.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
---
2-
name: "❓ Question"
2+
name: "❓ Question / Other"
33
about: Ask a question about docker-mailserver
44
title: ''
5-
labels: question, needs triage
5+
labels: kind/question, priority/low, meta/help wanted, meta/needs triage
66
assignees: ''
77

88
---
99

10-
## Subject
11-
<!-- Select one, remove the others: -->
10+
# Subject
1211

13-
* [ ] I would like to contribute to the project (code, documentation, advocacy, integration, ...)
14-
* [ ] I would like some help for integrating this container with another service (rainloop, PostFWD, ...)
15-
* [ ] I would like to configure a not documented mail server use case
16-
* [ ] I would like some feedback concerning a use case
17-
* [ ] I have questions about TLS/SSL/STARTTLS/OpenSSL
18-
* [ ] Other
12+
<!-- Select one, remove the others -->
13+
14+
I would like to contribute to the project
15+
I would like to configure a not documented mail server use case
16+
I would like some feedback concerning a use case
17+
I have questions about TLS/SSL/STARTTLS/OpenSSL
18+
Other
1919

2020
## Description
2121

22+
<!-- When copy/pasting code, format the code with tripe backticks (`) ! -->
23+
24+
``` BASH
25+
# CODE GOES HERE
26+
27+
```
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Close Stale Issues"
2+
3+
on:
4+
schedule:
5+
- cron: "0 1 * * *"
6+
7+
jobs:
8+
stale:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/stale@v3
12+
with:
13+
repo-token: ${{ secrets.GITHUB_TOKEN }}
14+
days-before-stale: 1 # TODO just for testing purposes, otherwise (20)
15+
days-before-close: 1 # TODO just for testing purposes, otherwise (10)
16+
stale-issue-label: "meta/stale"
17+
close-issue-label: "meta/frozen due to age or inactivity"
18+
stale-issue-message: >
19+
This issue has become stale because it has been open for 20 days without
20+
activity. Remove the label and comment or this issue will be closed in 10 days.
21+
close-issue-message: >
22+
This issue was closed due to inactivity.

.github/workflows/default_on_push.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: "Build, Test & Deploy"
2+
3+
on:
4+
push:
5+
branches: [ "master", "stable" ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
imagetag: ${{ steps.prep.outputs.imagetag }}
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
with:
16+
submodules: recursive
17+
- name: Prepare
18+
id: prep
19+
run: |
20+
DOCKER_IMAGE=docker.io/mailserver/testing
21+
TAGS="${DOCKER_IMAGE}:${GITHUB_SHA::8},${DOCKER_IMAGE}:latest"
22+
echo ::set-output name=tags::${TAGS}
23+
- name: Set up QEMU
24+
uses: docker/setup-qemu-action@v1
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v1
27+
id: buildx
28+
- name: Cache Docker layers
29+
uses: actions/cache@v2
30+
with:
31+
path: /tmp/.buildx-cache
32+
key: ${{ runner.os }}-buildx-${{ github.sha }}
33+
restore-keys: |
34+
${{ runner.os }}-buildx-
35+
- name: Login to DockerHub
36+
uses: docker/login-action@v1
37+
with:
38+
username: ${{ secrets.DOCKER_USERNAME }}
39+
password: ${{ secrets.DOCKER_PASSWORD }}
40+
- name: Build image locally
41+
uses: docker/build-push-action@v2
42+
with:
43+
builder: ${{ steps.buildx.outputs.name }}
44+
context: .
45+
file: ./Dockerfile
46+
build-args: |
47+
VCS_REF=${{ github.sha }}
48+
VCS_VER=${{ github.ref }}
49+
platforms: linux/amd64,linux/arm/v7,linux/arm64
50+
pull: true
51+
push: true
52+
tags: ${{ steps.prep.outputs.tags }}
53+
cache-to: type=local,dest=/tmp/.buildx-cache
54+
55+
test:
56+
needs: build
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v2
61+
with:
62+
submodules: recursive
63+
- name: run test suite
64+
run: |
65+
NAME=docker.io/mailserver/testing:${GITHUB_SHA::8} bash -c 'make generate-accounts tests'
66+
env:
67+
CI: true
68+
69+
publish:
70+
needs: test
71+
runs-on: ubuntu-latest
72+
steps:
73+
- name: Checkout
74+
uses: actions/checkout@v2
75+
with:
76+
submodules: recursive
77+
- name: Prepare
78+
id: prep
79+
run: |
80+
DOCKER_IMAGE=docker.io/mailserver/docker-mailserver
81+
VERSION=latest
82+
[[ $GITHUB_REF == refs/tags/* ]] && VERSION=${GITHUB_REF#refs/tags/v}
83+
TAGS="${DOCKER_IMAGE}:${VERSION}"
84+
[[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]] && TAGS="$TAGS,${DOCKER_IMAGE}:latest"
85+
echo ::set-output name=tags::${TAGS}
86+
- name: Set up QEMU
87+
uses: docker/setup-qemu-action@v1
88+
- name: Set up Docker Buildx
89+
uses: docker/setup-buildx-action@v1
90+
id: buildx
91+
- name: Cache Docker layers
92+
uses: actions/cache@v2
93+
with:
94+
path: /tmp/.buildx-cache
95+
key: ${{ runner.os }}-buildx-${{ github.sha }}
96+
restore-keys: |
97+
${{ runner.os }}-buildx-
98+
- name: Login to DockerHub
99+
uses: docker/login-action@v1
100+
with:
101+
username: ${{ secrets.DOCKER_USERNAME }}
102+
password: ${{ secrets.DOCKER_PASSWORD }}
103+
- name: Build image locally
104+
uses: docker/build-push-action@v2
105+
with:
106+
builder: ${{ steps.buildx.outputs.name }}
107+
context: .
108+
file: ./Dockerfile
109+
build-args: |
110+
VCS_REF=${{ github.sha }}
111+
VCS_VER=${{ github.ref }}
112+
platforms: linux/amd64,linux/arm/v7,linux/arm64
113+
pull: true
114+
push: true
115+
tags: ${{ steps.prep.outputs.tags }}
116+
cache-from: type=local,src=/tmp/.buildx-cache

0 commit comments

Comments
 (0)