Skip to content

Commit 8c82d8f

Browse files
author
Christoph Wolfes
committed
Merge branch 'release/v3.5.9-2'
2 parents 6789152 + 9e0dfb0 commit 8c82d8f

22 files changed

+653
-34
lines changed

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Default ignored files
2+
/shelf/
3+
/.idea
4+
# Datasource local storage ignored files
5+
/dataSources/
6+
/dataSources.local.xml
7+
# Editor-based HTTP Client requests
8+
/httpRequests/
9+
integrationTests/node_modules

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [v3.5.9-2] - 2021-05-06
10+
### Added
11+
- Upgrade test of the Dogu in Jenkins pipeline (#7)
12+
- Possibility to set log level for the dogu (#7)
13+
- Possibility to set memory limit for the dogu (#7)
14+
915
## [v3.5.9-1] - 2021-03-22
1016
### Added
1117
- release workflow

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM registry.cloudogu.com/official/base:3.12.4-1
22
LABEL name="official/postfix" \
3-
version="3.5.9-1" \
3+
version="3.5.9-2" \
44
55

66
# INSTALL POSTFIX

Jenkinsfile

+39-4
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,29 @@ node('vagrant') {
2424
GitHub github = new GitHub(this, git)
2525
Changelog changelog = new Changelog(this)
2626

27+
String doguName = "postfix"
28+
2729
timestamps {
2830
properties([
2931
// Keep only the last x builds to preserve space
3032
buildDiscarder(logRotator(numToKeepStr: '10')),
3133
// Don't run concurrent builds for a branch, because they use the same workspace directory
32-
disableConcurrentBuilds()
34+
disableConcurrentBuilds(),
35+
// Parameter to activate dogu upgrade test on demand
36+
parameters([
37+
booleanParam(defaultValue: false, description: 'Test dogu upgrade from latest release or optionally from defined version below', name: 'TestDoguUpgrade'),
38+
string(defaultValue: '', description: 'Old Dogu version for the upgrade test (optional; e.g. 2.222.1-1)', name: 'OldDoguVersionForUpgradeTest')
39+
])
3340
])
3441

35-
EcoSystem ecoSystem = new EcoSystem(this, "gcloud-ces-operations-internal-packer", "jenkins-gcloud-ces-operations-internal")
3642

43+
EcoSystem ecoSystem = new EcoSystem(this, "gcloud-ces-operations-internal-packer", "jenkins-gcloud-ces-operations-internal")
44+
Vagrant vagrant = new Vagrant(this, "gcloud-ces-operations-internal-packer", "jenkins-gcloud-ces-operations-internal")
3745

3846
try {
3947

4048
stage('Provision') {
41-
ecoSystem.provision("/dogu");
49+
ecoSystem.provision("/dogu")
4250
}
4351

4452
stage('Setup') {
@@ -54,8 +62,20 @@ node('vagrant') {
5462
ecoSystem.verify("/dogu")
5563
}
5664

65+
if (params.TestDoguUpgrade != null && params.TestDoguUpgrade){
66+
stage('Upgrade dogu') {
67+
String doguVersionForUpgradeTest = params.OldDoguVersionForUpgradeTest
68+
purgeAndReinstallDogu(ecoSystem, vagrant, doguName, doguVersionForUpgradeTest, relayhost)
69+
70+
ecoSystem.upgradeDogu(ecoSystem)
71+
72+
// Wait for upgraded dogu to get healthy
73+
ecoSystem.waitForDogu(doguName)
74+
}
75+
}
76+
5777
if (gitflow.isReleaseBranch()) {
58-
String releaseVersion = git.getSimpleBranchName();
78+
String releaseVersion = git.getSimpleBranchName()
5979

6080
stage('Finish Release') {
6181
gitflow.finishRelease(releaseVersion)
@@ -78,5 +98,20 @@ node('vagrant') {
7898
}
7999
}
80100

101+
void purgeAndReinstallDogu(EcoSystem ecoSystem, Vagrant vagrant, String doguName, String doguVersionToInstall, String relayhost) {
102+
ecoSystem.purgeDogu(doguName)
81103

104+
// Set etcd entry required for postfix. This entry was removed during the previous purge.
105+
vagrant.ssh('etcdctl set /config/postfix/relayhost ' + relayhost)
82106

107+
if (doguVersionToInstall != '' && !doguVersionToInstall.contains('v')){
108+
println "Installing user defined version of dogu: " + params.OldDoguVersionForUpgradeTest
109+
ecoSystem.installDogu("official/" + doguName + " " + params.OldDoguVersionForUpgradeTest)
110+
} else {
111+
println "Installing latest released version of dogu..."
112+
ecoSystem.installDogu("official/" + doguName)
113+
}
114+
115+
ecoSystem.startDogu(doguName)
116+
ecoSystem.waitForDogu(doguName)
117+
}

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@
1818

1919
**Category:** Base Dogu
2020

21+
---
22+
23+
### How to install Postfix?
24+
25+
- [Installation des Postfix-Dogu](docs/operations/Install_Postfix_de.md)
26+
- [Installing the Postfix dogu](docs/operations/Install_Postfix_en.md)
27+
28+
### Where do I find more information about the Portainer dogu?
29+
30+
- [Deutsch] [Dokumentation](docs/getting_started_de.md)
31+
- [English] [Documentation](docs/getting_started_en.md)
32+
33+
---
34+
35+
2136
## Installation Ecosystem
2237
```
2338
cesapp install official/postfix
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: "Entwickler-Guide"
3+
---
4+
5+
# Entwickler-Guide
6+
7+
Dieser Artikel ist für all jene geeignet, welche an dem Postfix-Dogu entwickeln möchten.
8+
9+
## Voraussetzungen
10+
11+
* Es ist notwendig, die folgenden Programme zu installieren:
12+
* [git](https://git-scm.com/) - siehe Link
13+
* vagrant
14+
* docker
15+
16+
## Aufsetzten der Entwicklungsumgebung
17+
18+
1. Klone das Repository:
19+
```
20+
git clone https://github.com/cloudogu/postfix.git
21+
```
22+
23+
## Entwicklung am Postfix-Dogu
24+
25+
### Voraussetzungen
26+
27+
- Eine laufende Vagrant-Maschine für das CES
28+
29+
### Postfix-Dogu Bauen
30+
31+
Der Buildprozess des Dogus wird immer in der Vagrant-Maschine ausgeführt.
32+
33+
1. Wechsel in das Root-Verzeichnis des Postfix-Dogus (in vagrant)
34+
2. Baue das Dogu
35+
36+
```
37+
cesapp build .
38+
```
39+
40+
Jetzt sollte das Dogu automatisch gebaut, aktualisiert, und gestartet werden.
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: "Developer Guide
3+
---
4+
5+
# Developer Guide
6+
7+
This article is suitable for all those who want to develop on the Postfix dogu.
8+
9+
## Requirements
10+
11+
* It is necessary to install the following programs:
12+
* [git](https://git-scm.com/) - see link.
13+
* vagrant
14+
* docker
15+
16+
## Set up the development environment
17+
18+
1. clone the repository:
19+
```
20+
git clone https://github.com/cloudogu/postfix.git
21+
```
22+
23+
## Development on the Postfix dogu
24+
25+
### Prerequisites
26+
27+
- A running Vagrant machine for the CES
28+
29+
### Postfix Dogu build
30+
31+
The build process of the Dogus is always executed in the Vagrant machine.
32+
33+
1. change to the root directory of the Postfix dogu (in vagrant)
34+
2. build the dogu
35+
36+
```
37+
cesapp build .
38+
```
39+
40+
Now the dogu should be built, updated, and started automatically.
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: "Lokaler Mailversand"
3+
---
4+
5+
# Lokaler Mailversand
6+
7+
Zur Überprüfung, ob der Mailversand des Postfix-Dogus funktioniert, kann [MailHog](https://github.com/mailhog/MailHog)
8+
verwendet werden. MailHog ist ein Tool zum Testen von E-Mails in einer lokalen Entwicklungsumgebnung. MailHog richtet
9+
einen lokalen Pseudo-SMTP-Server ein.
10+
11+
## Einrichtung von MailHog
12+
13+
Kurz zusammengefasst wird MailHog lokal auf dem Host-Rechner als Docker-Container ausgeführt und im lokalen CES als
14+
Relay-Host des Postfix-Dogus eingetragen.
15+
16+
Konkret müssen folgende Schritte ausgeführt werden:
17+
18+
* MailHog auf dem Host-Rechner als Docker-Container ausführen:
19+
```
20+
docker run -d -p 1025:1025 -p 8025:8025 mailhog/mailhog
21+
```
22+
* MailHog im lokalen CES als Relay-Host des Postfix-Dogus setzen:
23+
```
24+
etcdctl set /config/postfix/relayhost 192.168.56.1:1025
25+
```
26+
* Postfix-Dogu über die cesapp entfernen und neu erzeugen
27+
```
28+
cesapp recreate postfix
29+
```
30+
* Postfix-Dogu starten
31+
```
32+
cesapp start postfix
33+
```
34+
* In die bash des Dogus wechseln
35+
```
36+
docker exec -it postfix bash
37+
```
38+
* Mail versenden
39+
```
40+
sendmail -t [email protected]
41+
Text 1234
42+
43+
<strg>+<d>
44+
```
45+
* In Web-Oberfläche vom MailHog - ```localhost:8025``` - Mail-Empfang prüfen
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: "Local mail dispatch"
3+
---
4+
5+
# Local mail dispatch
6+
7+
To check if the mail dispatch of the Postfix dogu works, [MailHog](https://github.com/mailhog/MailHog)
8+
can be used. MailHog is a tool for testing mail in a local development environment. MailHog sets up a local pseudo-SMTP
9+
server.
10+
11+
## Setting up MailHog
12+
13+
In a nutshell, MailHog runs locally on the host machine as a Docker container and is configured in the local CES as a
14+
Relay host of the postfix dogus entered.
15+
16+
Specifically, the following steps need to be performed:
17+
18+
* Run MailHog on the host machine as a Docker container:
19+
```
20+
docker run -d -p 1025:1025 -p 8025:8025 mailhog/mailhog
21+
```
22+
* Set MailHog in the local CES as the relay host of the Postfix dog:
23+
```
24+
etcdctl set /config/postfix/relayhost 192.168.56.1:1025
25+
```
26+
* Remove postfix-dogu via cesapp and create new one
27+
```
28+
cesapp recreate postfix
29+
```
30+
* Start postfix-dogu
31+
```
32+
cesapp start postfix
33+
```
34+
* Change to the bash of the Dogu
35+
```
36+
docker exec -it postfix bash
37+
```
38+
* Send mail
39+
```
40+
sendmail -t [email protected]
41+
text 1234
42+
43+
<strg>+<d>
44+
```
45+
* In web interface of MailHog - ```localhost:8025`` - check mail reception

docs/getting_started_de.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: "Getting Started"
3+
---
4+
5+
# Postfix Dokumentation
6+
7+
## Guides
8+
9+
- [Installation des Postfix-Dogu](operations/Install_Postfix_de.md)
10+
- [Konfiguration des Postfix-Dogu](operations/Configure_Dogu_de.md)
11+
12+
## Für Entwickler
13+
14+
- [Entwickler-Guide](development/Developers_Guide_de.md)
15+
- [Lokaler Mailversand](development/Send_Mails_locally_de.md)

docs/getting_started_en.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: "Getting Started"
3+
---
4+
5+
# Postfix documentation
6+
7+
## Guides
8+
9+
- [Installing the Postfix dogu](operations/Install_Postfix_en.md)
10+
- [Configuration of the Postfix dogu](operations/Configure_Dogu_en.md)
11+
12+
## For developers
13+
14+
- [Developer Guide](development/Developers_Guide_en.md)
15+
- [Local mail dispatch](development/Send_Mails_locally_en.md)

0 commit comments

Comments
 (0)