Skip to content

Commit 6789152

Browse files
Joshua Spreycesmarvin
Joshua Sprey
authored andcommitted
Merge branch 'release/v3.5.9-1'
2 parents 4c1f241 + 3658ce5 commit 6789152

32 files changed

+919
-64
lines changed

CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [Unreleased]
8+
9+
## [v3.5.9-1] - 2021-03-22
10+
### Added
11+
- release workflow
12+
- basic docker healthcheck
13+
14+
### Changed
15+
- upgrade base image to 3.12.4-1 which leads to an update of the postfix version to 3.5.9

Dockerfile

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
FROM registry.cloudogu.com/official/base:3.7-4
2-
MAINTAINER Stephan Christann <[email protected]>
1+
FROM registry.cloudogu.com/official/base:3.12.4-1
2+
LABEL name="official/postfix" \
3+
version="3.5.9-1" \
4+
35

46
# INSTALL POSTFIX
57
RUN apk add --update postfix openrc supervisor rsyslog \
@@ -10,5 +12,7 @@ COPY resources /
1012
# POSTFIX PORT
1113
EXPOSE 25/tcp 587/tcp
1214

15+
HEALTHCHECK CMD doguctl healthy postfix || exit 1
16+
1317
# FIRE IT UP
1418
CMD ["/bin/bash", "-c", "/startup.sh"]

Jenkinsfile

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!groovy
2+
@Library(['github.com/cloudogu/[email protected]', 'github.com/cloudogu/[email protected]'])
3+
import com.cloudogu.ces.cesbuildlib.*
4+
import com.cloudogu.ces.dogubuildlib.*
5+
6+
node('docker') {
7+
stage('Checkout') {
8+
checkout scm
9+
}
10+
11+
stage('Lint') {
12+
lintDockerfile()
13+
}
14+
15+
stage('Shellcheck') {
16+
shellCheck()
17+
}
18+
}
19+
node('vagrant') {
20+
Git git = new Git(this, "cesmarvin")
21+
git.committerName = 'cesmarvin'
22+
git.committerEmail = '[email protected]'
23+
GitFlow gitflow = new GitFlow(this, git)
24+
GitHub github = new GitHub(this, git)
25+
Changelog changelog = new Changelog(this)
26+
27+
timestamps {
28+
properties([
29+
// Keep only the last x builds to preserve space
30+
buildDiscarder(logRotator(numToKeepStr: '10')),
31+
// Don't run concurrent builds for a branch, because they use the same workspace directory
32+
disableConcurrentBuilds()
33+
])
34+
35+
EcoSystem ecoSystem = new EcoSystem(this, "gcloud-ces-operations-internal-packer", "jenkins-gcloud-ces-operations-internal")
36+
37+
38+
try {
39+
40+
stage('Provision') {
41+
ecoSystem.provision("/dogu");
42+
}
43+
44+
stage('Setup') {
45+
ecoSystem.loginBackend('cesmarvin-setup')
46+
ecoSystem.setup()
47+
}
48+
49+
stage('Build') {
50+
ecoSystem.build("/dogu")
51+
}
52+
53+
stage('Verify') {
54+
ecoSystem.verify("/dogu")
55+
}
56+
57+
if (gitflow.isReleaseBranch()) {
58+
String releaseVersion = git.getSimpleBranchName();
59+
60+
stage('Finish Release') {
61+
gitflow.finishRelease(releaseVersion)
62+
}
63+
64+
stage('Push Dogu to registry') {
65+
ecoSystem.push("/dogu")
66+
}
67+
68+
stage('Add Github-Release') {
69+
github.createReleaseWithChangelog(releaseVersion, changelog)
70+
}
71+
}
72+
73+
} finally {
74+
stage('Clean') {
75+
ecoSystem.destroy()
76+
}
77+
}
78+
}
79+
}
80+
81+
82+

Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
MAKEFILES_VERSION=4.4.0
2+
3+
.DEFAULT_GOAL:=dogu-release
4+
5+
include build/make/variables.mk
6+
include build/make/self-update.mk
7+
include build/make/release.mk

README.md

+40-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,40 @@
1-
# postfix
2-
Postfix MTA Dogu for the Cloudogu EcoSystem
1+
<img src="https://cloudogu.com/images/dogus/postfix.png" alt="postfix logo" height="100px">
2+
3+
4+
[![GitHub license](https://img.shields.io/github/license/cloudogu/postfix.svg)](https://github.com/cloudogu/postfix/blob/master/LICENSE)
5+
[![GitHub release](https://img.shields.io/github/release/cloudogu/postfix.svg)](https://github.com/cloudogu/postfix/releases)
6+
7+
# Postfix Dogu
8+
9+
## About this Dogu
10+
11+
**Name:** official/postfix
12+
13+
**Description:** [Postfix](https://en.wikipedia.org/wiki/Postfix_(software)) is a free and open-source mail transfer agent (MTA) that routes and delivers electronic mail.
14+
15+
**Website:** www.postfix.org
16+
17+
**Dependencies:** none
18+
19+
**Category:** Base Dogu
20+
21+
## Installation Ecosystem
22+
```
23+
cesapp install official/postfix
24+
25+
cesapp start postfix
26+
```
27+
28+
---
29+
### What is the Cloudogu EcoSystem?
30+
The Cloudogu EcoSystem is an open platform, which lets you choose how and where your team creates great software. Each service or tool is delivered as a Dogu, a Docker container. Each Dogu can easily be integrated in your environment just by pulling it from our registry. We have a growing number of ready-to-use Dogus, e.g. SCM-Manager, Jenkins, Nexus, SonarQube, Redmine and many more. Every Dogu can be tailored to your specific needs. Take advantage of a central authentication service, a dynamic navigation, that lets you easily switch between the web UIs and a smart configuration magic, which automatically detects and responds to dependencies between Dogus. The Cloudogu EcoSystem is open source and it runs either on-premises or in the cloud. The Cloudogu EcoSystem is developed by Cloudogu GmbH under [MIT License](https://cloudogu.com/license.html).
31+
32+
### How to get in touch?
33+
Want to talk to the Cloudogu team? Need help or support? There are several ways to get in touch with us:
34+
35+
* [Website](https://cloudogu.com)
36+
* [myCloudogu-Forum](https://forum.cloudogu.com/topic/34?ctx=1)
37+
38+
39+
---
40+
&copy; 2021 Cloudogu GmbH - MADE WITH :heart:&nbsp;FOR DEV ADDICTS. [Legal notice / Impressum](https://cloudogu.com/imprint.html)

build/.editorconfig

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[*.mk]
2+
indent_style = tab

build/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
deb
2+
tmp

build/make/bower.mk

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
BOWER_JSON=$(WORKDIR)/bower.json
2+
3+
.PHONY: bower-install
4+
bower-install: $(BOWER_TARGET)
5+
6+
ifeq ($(ENVIRONMENT), ci)
7+
8+
$(BOWER_TARGET): $(BOWER_JSON) $(YARN_TARGET)
9+
@echo "Yarn run bower on CI server"
10+
@yarn run bower
11+
12+
else
13+
14+
$(BOWER_TARGET): $(BOWER_JSON) $(PASSWD) $(YARN_TARGET)
15+
@echo "Executing bower..."
16+
@docker run --rm \
17+
-e HOME=/tmp \
18+
-u "$(UID_NR):$(GID_NR)" \
19+
-v $(PASSWD):/etc/passwd:ro \
20+
-v $(WORKDIR):$(WORKDIR) \
21+
-w $(WORKDIR) \
22+
node:8 \
23+
yarn run bower
24+
@touch $@
25+
26+
endif

build/make/build.mk

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
ADDITIONAL_LDFLAGS?=-extldflags -static
2+
LDFLAGS?=-ldflags "$(ADDITIONAL_LDFLAGS) -X main.Version=$(VERSION) -X main.CommitID=$(COMMIT_ID)"
3+
GOIMAGE?=golang
4+
GOTAG?=1.14.13
5+
GOOS?=linux
6+
GOARCH?=amd64
7+
PRE_COMPILE?=
8+
GO_ENV_VARS?=
9+
CUSTOM_GO_MOUNT?=-v /tmp:/tmp
10+
GO_BUILD_FLAGS?=-mod=vendor -a -tags netgo $(LDFLAGS) -installsuffix cgo -o $(BINARY)
11+
12+
.PHONY: compile
13+
compile: $(BINARY)
14+
15+
compile-ci:
16+
@echo "Compiling (CI)..."
17+
make compile-generic
18+
19+
compile-generic:
20+
@echo "Compiling..."
21+
# here is go called without mod capabilities because of error "go: error loading module requirements"
22+
# see https://github.com/golang/go/issues/30868#issuecomment-474199640
23+
@$(GO_ENV_VARS) go build $(GO_BUILD_FLAGS)
24+
25+
26+
ifeq ($(ENVIRONMENT), ci)
27+
28+
$(BINARY): $(SRC) vendor $(PRE_COMPILE)
29+
@echo "Built on CI server"
30+
@make compile-generic
31+
32+
else
33+
34+
$(BINARY): $(SRC) vendor $(PASSWD) $(ETCGROUP) $(HOME_DIR) $(PRE_COMPILE)
35+
@echo "Building locally (in Docker)"
36+
@docker run --rm \
37+
-e GOOS=$(GOOS) \
38+
-e GOARCH=$(GOARCH) \
39+
-u "$(UID_NR):$(GID_NR)" \
40+
-v $(PASSWD):/etc/passwd:ro \
41+
-v $(ETCGROUP):/etc/group:ro \
42+
-v $(HOME_DIR):/home/$(USER) \
43+
-v $(WORKDIR):/go/src/github.com/cloudogu/$(ARTIFACT_ID) \
44+
$(CUSTOM_GO_MOUNT) \
45+
-w /go/src/github.com/cloudogu/$(ARTIFACT_ID) \
46+
$(GOIMAGE):$(GOTAG) \
47+
make compile-generic
48+
49+
endif

build/make/clean.mk

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.PHONY: clean
2+
clean: $(ADDITIONAL_CLEAN)
3+
rm -rf ${TARGET_DIR}
4+
rm -rf ${TMP_DIR}
5+
6+
.PHONY: dist-clean
7+
dist-clean: clean
8+
rm -rf node_modules
9+
rm -rf public/vendor
10+
rm -rf vendor
11+
rm -rf npm-cache
12+
rm -rf bower

build/make/dependencies-glide.mk

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
GLIDE=$(GOPATH)/bin/glide
2+
GLIDEFLAGS=
3+
GLIDEHOME=$(GLIDE_HOME)
4+
5+
ifeq ($(ENVIRONMENT), ci)
6+
GLIDEFLAGS+=--no-color
7+
GLIDEHOME=$(WORKDIR)/.glide_home
8+
GLIDEFLAGS+= --home $(GLIDEHOME)
9+
endif
10+
11+
.PHONY: update-dependencies
12+
update-dependencies: $(GLIDE)
13+
14+
.PHONY: dependencies
15+
dependencies: vendor
16+
17+
vendor: $(GLIDE) glide.yaml glide.lock
18+
@echo "Installing dependencies using Glide..."
19+
$(GLIDE) $(GLIDEFLAGS) install -v
20+
21+
$(GLIDE):
22+
@echo "installing glide"
23+
@curl https://glide.sh/get | sh
24+

build/make/dependencies-godep.mk

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
GODEP=$(GOPATH)/bin/dep
2+
3+
$(GODEP):
4+
@curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
5+
6+
vendor: $(GODEP) Gopkg.toml Gopkg.lock
7+
@echo "Installing dependencies using go dep..."
8+
@dep ensure
9+
10+
dependencies: vendor

build/make/dependencies-gomod.mk

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.PHONY: dependencies
2+
dependencies: vendor
3+
4+
vendor: go.mod go.sum
5+
@echo "Installing dependencies using go modules..."
6+
${GO_CALL} mod vendor

build/make/deploy-debian.mk

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# This Makefile holds all targets for deploying and undeploying
2+
# Uses the variable APT_REPO to determine which apt repos should be used to deploy
3+
4+
# Attention: This Makefile depends on package-debian.mk!
5+
6+
.PHONY: deploy-check
7+
deploy-check:
8+
@case X"${VERSION}" in *-SNAPSHOT) echo "i will not upload a snaphot version for you" ; exit 1; esac;
9+
@if [ X"${APT_API_USERNAME}" = X"" ] ; then echo "supply an APT_API_USERNAME environment variable"; exit 1; fi;
10+
@if [ X"${APT_API_PASSWORD}" = X"" ] ; then echo "supply an APT_API_PASSWORD environment variable"; exit 1; fi;
11+
@if [ X"${APT_API_SIGNPHRASE}" = X"" ] ; then echo "supply an APT_API_SIGNPHRASE environment variable"; exit 1; fi;
12+
13+
.PHONY: upload-package
14+
upload-package: deploy-check $(DEBIAN_PACKAGE)
15+
@echo "... uploading package"
16+
@$(APTLY) -F file=@"${DEBIAN_PACKAGE}" "${APT_API_BASE_URL}/files/$$(basename ${DEBIAN_PACKAGE})"
17+
18+
.PHONY: add-package-to-repo
19+
add-package-to-repo: upload-package
20+
ifeq ($(APT_REPO), ces-premium)
21+
@echo "... add package to ces-premium repository"
22+
@$(APTLY) -X POST "${APT_API_BASE_URL}/repos/ces-premium/file/$$(basename ${DEBIAN_PACKAGE})"
23+
else
24+
@echo "\n... add package to ces repository"
25+
@$(APTLY) -X POST "${APT_API_BASE_URL}/repos/ces/file/$$(basename ${DEBIAN_PACKAGE})"
26+
endif
27+
28+
define aptly_publish
29+
$(APTLY) -X PUT -H "Content-Type: application/json" --data '{"Signing": { "Batch": true, "Passphrase": "${APT_API_SIGNPHRASE}"}}' ${APT_API_BASE_URL}/publish/$(1)/$(2)
30+
endef
31+
32+
.PHONY: publish
33+
publish:
34+
@echo "\n... publish packages"
35+
ifeq ($(APT_REPO), ces-premium)
36+
@$(call aptly_publish,ces-premium,bionic)
37+
else
38+
@$(call aptly_publish,ces,focal)
39+
@$(call aptly_publish,ces,bionic)
40+
endif
41+
42+
.PHONY: deploy
43+
deploy: add-package-to-repo publish
44+
45+
define aptly_undeploy
46+
PREF=$$(${APTLY} "${APT_API_BASE_URL}/repos/$(1)/packages?q=${ARTIFACT_ID}%20(${VERSION})"); \
47+
${APTLY} -X DELETE -H 'Content-Type: application/json' --data "{\"PackageRefs\": $${PREF}}" ${APT_API_BASE_URL}/repos/$(1)/packages
48+
endef
49+
50+
.PHONY: remove-package-from-repo
51+
remove-package-from-repo:
52+
ifeq ($(APT_REPO), ces-premium)
53+
@$(call aptly_undeploy,ces-premium)
54+
else
55+
@$(call aptly_undeploy,ces)
56+
endif
57+
58+
.PHONY: undeploy
59+
undeploy: deploy-check remove-package-from-repo publish
60+
61+
.PHONE: lint-deb-package
62+
lint-deb-package: debian
63+
@lintian -i $(DEBIAN_PACKAGE)

build/make/digital-signature.mk

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CHECKSUM=$(TARGET_DIR)/$(ARTIFACT_ID).sha256sum
2+
3+
.PHONY: checksum
4+
checksum: $(CHECKSUM)
5+
# we have to depend on target dir, because we want to rebuild the checksum
6+
# if one of the artefacts was changed
7+
$(CHECKSUM): $(TARGET_DIR)
8+
@echo "Generating Checksums"
9+
@cd $(TARGET_DIR); find . -maxdepth 1 -not -type d | egrep -v ".(sha256sum|asc)$$" | xargs shasum -a 256 > $$(basename $@)
10+
11+
SIGNATURE=$(CHECKSUM).asc
12+
13+
.PHONY: signature
14+
signature: $(SIGNATURE)
15+
$(SIGNATURE): $(CHECKSUM)
16+
@echo "Generating Signature"
17+
@gpg --batch --yes --detach-sign --armor -o $@ $<

0 commit comments

Comments
 (0)