Skip to content

Commit d2d8e6a

Browse files
cbeyer42cesmarvin
authored andcommitted
Merge branch 'release/v12.14-2'
2 parents 3f7968c + 38cf02c commit d2d8e6a

35 files changed

+855
-250
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [v12.14-2] - 2023-04-21
11+
### Changed
12+
- [#20] Upgrade Base Image to 3.17.3-2
13+
14+
### Security
15+
- [#20] Fixed CVE-2023-27536, CVE-2023-27536 and some others
16+
1017
## [v12.14-1] - 2023-03-14
1118
### Changed
1219
- Upgrade to PostgreSQL 12.14; #18

Dockerfile

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
1-
FROM registry.cloudogu.com/official/base:3.17.1-1
1+
FROM registry.cloudogu.com/official/base:3.17.3-2 as builder
2+
3+
ENV GOSU_SHA256=0f25a21cf64e58078057adc78f38705163c1d564a959ff30a891c31917011a54
4+
5+
WORKDIR /build
6+
7+
RUN set -x -o errexit \
8+
&& set -o nounset \
9+
&& set -o pipefail \
10+
&& apk update \
11+
&& apk upgrade \
12+
&& apk add wget \
13+
&& mkdir -p /build/usr/local/bin \
14+
&& wget --progress=bar:force:noscroll -O /build/usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/1.12/gosu-amd64" \
15+
&& echo "${GOSU_SHA256} */build/usr/local/bin/gosu" | sha256sum -c - \
16+
&& chmod +x /build/usr/local/bin/gosu
17+
18+
FROM registry.cloudogu.com/official/base:3.17.3-2
219

320
LABEL NAME="official/postgresql" \
4-
VERSION="12.14-1" \
21+
VERSION="12.14-2" \
522
maintainer="[email protected]"
623

724
ENV LANG=en_US.utf8 \
825
PGDATA=/var/lib/postgresql \
9-
POSTGRESQL_VERSION=12.14-r0 \
10-
GOSU_SHA256=0f25a21cf64e58078057adc78f38705163c1d564a959ff30a891c31917011a54
26+
POSTGRESQL_VERSION=12.14-r0
1127

1228
# install postgresql and gosu
1329
# Note: the current postgresql version from alpine is installed
@@ -17,14 +33,10 @@ RUN set -x -o errexit \
1733
&& set -o pipefail \
1834
&& apk update \
1935
&& apk upgrade \
20-
&& apk add --update postgresql12="${POSTGRESQL_VERSION}" \
21-
&& wget --progress=bar:force:noscroll "https://github.com/tianon/gosu/releases/download/1.12/gosu-amd64" \
22-
&& echo "${GOSU_SHA256} *gosu-amd64" | sha256sum -c - \
23-
&& mv /gosu-amd64 /usr/local/bin/gosu \
24-
&& chmod +x /usr/local/bin/gosu \
25-
&& rm -rf /var/cache/apk/*
36+
&& apk add --no-cache --update postgresql12="${POSTGRESQL_VERSION}"
2637

2738
COPY resources/ /
39+
COPY --from=builder /build /
2840

2941
VOLUME ["/var/lib/postgresql"]
3042

Jenkinsfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!groovy
2-
@Library(['github.com/cloudogu/ces-build-lib@1.48.0', 'github.com/cloudogu/dogu-build-lib@v1.6.0'])
2+
@Library(['github.com/cloudogu/ces-build-lib@1.64.1', 'github.com/cloudogu/dogu-build-lib@v2.0.0'])
33
import com.cloudogu.ces.cesbuildlib.*
44
import com.cloudogu.ces.dogubuildlib.*
55

@@ -12,10 +12,16 @@ node('docker') {
1212
lintDockerfile()
1313
shellCheck('resources/backup-consumer.sh resources/create-sa.sh resources/pre-upgrade.sh resources/remove-sa.sh resources/startup.sh resources/upgrade-notification.sh')
1414
}
15+
16+
stage('Check Markdown Links') {
17+
Markdown markdown = new Markdown(this, "3.11.0")
18+
markdown.check()
19+
}
1520
}
1621

1722
node('vagrant') {
1823

24+
String doguName = 'postgresql'
1925
Git git = new Git(this, 'cesmarvin')
2026
git.committerName = 'cesmarvin'
2127
git.committerEmail = '[email protected]'

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MAKEFILES_VERSION=4.2.0
1+
MAKEFILES_VERSION=7.5.0
22

33
.DEFAULT_GOAL:=dogu-release
44

build/make/bats.mk

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
WORKSPACE=/workspace
2+
BATS_LIBRARY_DIR=$(TARGET_DIR)/bats_libs
3+
TESTS_DIR=$(WORKDIR)/batsTests
4+
BASH_TEST_REPORT_DIR=$(TARGET_DIR)/shell_test_reports
5+
BASH_TEST_REPORTS=$(BASH_TEST_REPORT_DIR)/TestReport-*.xml
6+
BATS_ASSERT=$(BATS_LIBRARY_DIR)/bats-assert
7+
BATS_MOCK=$(BATS_LIBRARY_DIR)/bats-mock
8+
BATS_SUPPORT=$(BATS_LIBRARY_DIR)/bats-support
9+
BATS_FILE=$(BATS_LIBRARY_DIR)/bats-file
10+
BATS_BASE_IMAGE?=bats/bats
11+
BATS_CUSTOM_IMAGE?=cloudogu/bats
12+
BATS_TAG?=1.2.1
13+
BATS_DIR=build/make/bats
14+
BATS_WORKDIR="${WORKDIR}"/"${BATS_DIR}"
15+
16+
.PHONY unit-test-shell:
17+
unit-test-shell: unit-test-shell-$(ENVIRONMENT)
18+
19+
$(BATS_ASSERT):
20+
@git clone --depth 1 https://github.com/bats-core/bats-assert $@
21+
22+
$(BATS_MOCK):
23+
@git clone --depth 1 https://github.com/grayhemp/bats-mock $@
24+
25+
$(BATS_SUPPORT):
26+
@git clone --depth 1 https://github.com/bats-core/bats-support $@
27+
28+
$(BATS_FILE):
29+
@git clone --depth 1 https://github.com/bats-core/bats-file $@
30+
31+
$(BASH_SRC):
32+
BASH_SRC:=$(shell find "${WORKDIR}" -type f -name "*.sh")
33+
34+
${BASH_TEST_REPORT_DIR}: $(TARGET_DIR)
35+
@mkdir -p $(BASH_TEST_REPORT_DIR)
36+
37+
unit-test-shell-ci: $(BASH_SRC) $(BASH_TEST_REPORT_DIR) $(BATS_ASSERT) $(BATS_MOCK) $(BATS_SUPPORT) $(BATS_FILE)
38+
@echo "Test shell units on CI server"
39+
@make unit-test-shell-generic
40+
41+
unit-test-shell-local: $(BASH_SRC) $(PASSWD) $(ETCGROUP) $(HOME_DIR) buildTestImage $(BASH_TEST_REPORT_DIR) $(BATS_ASSERT) $(BATS_MOCK) $(BATS_SUPPORT) $(BATS_FILE)
42+
@echo "Test shell units locally (in Docker)"
43+
@docker run --rm \
44+
-v $(HOME_DIR):/home/$(USER) \
45+
-v $(WORKDIR):$(WORKSPACE) \
46+
-w $(WORKSPACE) \
47+
--entrypoint="" \
48+
$(BATS_CUSTOM_IMAGE):$(BATS_TAG) \
49+
"${BATS_DIR}"/customBatsEntrypoint.sh make unit-test-shell-generic-no-junit
50+
51+
unit-test-shell-generic:
52+
@bats --formatter junit --output ${BASH_TEST_REPORT_DIR} ${TESTS_DIR}
53+
54+
unit-test-shell-generic-no-junit:
55+
@bats ${TESTS_DIR}
56+
57+
.PHONY buildTestImage:
58+
buildTestImage:
59+
@echo "Build shell test container"
60+
@cd $(BATS_WORKDIR) && docker build \
61+
--build-arg=BATS_BASE_IMAGE=${BATS_BASE_IMAGE} \
62+
--build-arg=BATS_TAG=${BATS_TAG} \
63+
-t ${BATS_CUSTOM_IMAGE}:${BATS_TAG} \
64+
.

build/make/bats/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ARG BATS_BASE_IMAGE
2+
ARG BATS_TAG
3+
4+
FROM ${BATS_BASE_IMAGE}:${BATS_TAG}
5+
6+
# Make bash more findable by scripts and tests
7+
RUN apk add make git bash
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
set -o errexit
3+
set -o nounset
4+
set -o pipefail
5+
6+
"$@"

build/make/bower.mk

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
##@ Bower dependency management
2+
13
BOWER_JSON=$(WORKDIR)/bower.json
24

35
.PHONY: bower-install
4-
bower-install: $(BOWER_TARGET)
6+
bower-install: $(BOWER_TARGET) ## Execute yarn run bower (in Docker)
57

68
ifeq ($(ENVIRONMENT), ci)
79

@@ -19,7 +21,7 @@ $(BOWER_TARGET): $(BOWER_JSON) $(PASSWD) $(YARN_TARGET)
1921
-v $(PASSWD):/etc/passwd:ro \
2022
-v $(WORKDIR):$(WORKDIR) \
2123
-w $(WORKDIR) \
22-
node:8 \
24+
node:$(NODE_VERSION) \
2325
yarn run bower
2426
@touch $@
2527

build/make/build.mk

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
1+
##@ Compiling go software
2+
13
ADDITIONAL_LDFLAGS?=-extldflags -static
24
LDFLAGS?=-ldflags "$(ADDITIONAL_LDFLAGS) -X main.Version=$(VERSION) -X main.CommitID=$(COMMIT_ID)"
3-
GOIMAGE?=cloudogu/golang
4-
GOTAG?=1.10.2-2
5+
GOIMAGE?=golang
6+
GOTAG?=1.14.13
57
GOOS?=linux
68
GOARCH?=amd64
79
PRE_COMPILE?=
810
GO_ENV_VARS?=
11+
CUSTOM_GO_MOUNT?=-v /tmp:/tmp
12+
GO_BUILD_FLAGS?=-mod=vendor -a -tags netgo $(LDFLAGS) -installsuffix cgo -o $(BINARY)
913

1014
.PHONY: compile
11-
compile: $(BINARY)
15+
compile: $(BINARY) ## Compile the go program via Docker
1216

13-
compile-ci:
17+
compile-ci: ## Compile the go program without Docker
1418
@echo "Compiling (CI)..."
1519
make compile-generic
1620

1721
compile-generic:
1822
@echo "Compiling..."
1923
# here is go called without mod capabilities because of error "go: error loading module requirements"
2024
# see https://github.com/golang/go/issues/30868#issuecomment-474199640
21-
@$(GO_ENV_VARS) go build -a -tags netgo $(LDFLAGS) -installsuffix cgo -o $(BINARY)
25+
@$(GO_ENV_VARS) go build $(GO_BUILD_FLAGS)
2226

2327

2428
ifeq ($(ENVIRONMENT), ci)
@@ -29,17 +33,19 @@ $(BINARY): $(SRC) vendor $(PRE_COMPILE)
2933

3034
else
3135

32-
$(BINARY): $(SRC) vendor $(PASSWD) $(HOME_DIR) $(PRE_COMPILE)
36+
$(BINARY): $(SRC) vendor $(PASSWD) $(ETCGROUP) $(HOME_DIR) $(PRE_COMPILE)
3337
@echo "Building locally (in Docker)"
3438
@docker run --rm \
35-
-e GOOS=$(GOOS) \
36-
-e GOARCH=$(GOARCH) \
37-
-u "$(UID_NR):$(GID_NR)" \
38-
-v $(PASSWD):/etc/passwd:ro \
39-
-v $(HOME_DIR):/home/$(USER) \
40-
-v $(WORKDIR):/go/src/github.com/cloudogu/$(ARTIFACT_ID) \
41-
-w /go/src/github.com/cloudogu/$(ARTIFACT_ID) \
42-
$(GOIMAGE):$(GOTAG) \
39+
-e GOOS=$(GOOS) \
40+
-e GOARCH=$(GOARCH) \
41+
-u "$(UID_NR):$(GID_NR)" \
42+
-v $(PASSWD):/etc/passwd:ro \
43+
-v $(ETCGROUP):/etc/group:ro \
44+
-v $(HOME_DIR):/home/$(USER) \
45+
-v $(WORKDIR):/go/src/github.com/cloudogu/$(ARTIFACT_ID) \
46+
$(CUSTOM_GO_MOUNT) \
47+
-w /go/src/github.com/cloudogu/$(ARTIFACT_ID) \
48+
$(GOIMAGE):$(GOTAG) \
4349
make compile-generic
4450

4551
endif

build/make/clean.mk

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
##@ Cleaning
2+
13
.PHONY: clean
2-
clean: $(ADDITIONAL_CLEAN)
4+
clean: $(ADDITIONAL_CLEAN) ## Remove target and tmp directories
35
rm -rf ${TARGET_DIR}
46
rm -rf ${TMP_DIR}
7+
rm -rf ${UTILITY_BIN_PATH}
58

69
.PHONY: dist-clean
7-
dist-clean: clean
10+
dist-clean: clean ## Remove all generated directories
811
rm -rf node_modules
912
rm -rf public/vendor
1013
rm -rf vendor

build/make/dependencies-glide.mk

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

build/make/dependencies-godep.mk

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

build/make/dependencies-gomod.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
##@ Go mod dependency management
2+
13
.PHONY: dependencies
2-
dependencies: vendor
4+
dependencies: vendor ## Install dependencies using go mod
35

46
vendor: go.mod go.sum
57
@echo "Installing dependencies using go modules..."

build/make/deploy-debian.mk

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
##@ Debian package deployment
2+
13
# This Makefile holds all targets for deploying and undeploying
24
# Uses the variable APT_REPO to determine which apt repos should be used to deploy
35

@@ -21,11 +23,8 @@ ifeq ($(APT_REPO), ces-premium)
2123
@echo "... add package to ces-premium repository"
2224
@$(APTLY) -X POST "${APT_API_BASE_URL}/repos/ces-premium/file/$$(basename ${DEBIAN_PACKAGE})"
2325
else
24-
@echo "... add package to ces and xenial repositories"
25-
# heads up: For migration to a new repo structure we use two repos, new (ces) and old (xenial)
26-
# '?noRemove=1': aptly removes the file on success. This leads to an error on the second package add. Keep it this round
27-
@$(APTLY) -X POST "${APT_API_BASE_URL}/repos/ces/file/$$(basename ${DEBIAN_PACKAGE})?noRemove=1"
28-
@$(APTLY) -X POST "${APT_API_BASE_URL}/repos/xenial/file/$$(basename ${DEBIAN_PACKAGE})"
26+
@echo "\n... add package to ces repository"
27+
@$(APTLY) -X POST "${APT_API_BASE_URL}/repos/ces/file/$$(basename ${DEBIAN_PACKAGE})"
2928
endif
3029

3130
define aptly_publish
@@ -34,17 +33,16 @@ endef
3433

3534
.PHONY: publish
3635
publish:
37-
@echo "... publish packages"
36+
@echo "\n... publish packages"
3837
ifeq ($(APT_REPO), ces-premium)
3938
@$(call aptly_publish,ces-premium,bionic)
4039
else
41-
@$(call aptly_publish,xenial,xenial)
42-
@$(call aptly_publish,ces,xenial)
40+
@$(call aptly_publish,ces,focal)
4341
@$(call aptly_publish,ces,bionic)
4442
endif
4543

4644
.PHONY: deploy
47-
deploy: add-package-to-repo publish
45+
deploy: add-package-to-repo publish ## Deploy package to apt repository
4846

4947
define aptly_undeploy
5048
PREF=$$(${APTLY} "${APT_API_BASE_URL}/repos/$(1)/packages?q=${ARTIFACT_ID}%20(${VERSION})"); \
@@ -56,13 +54,12 @@ remove-package-from-repo:
5654
ifeq ($(APT_REPO), ces-premium)
5755
@$(call aptly_undeploy,ces-premium)
5856
else
59-
@$(call aptly_undeploy,xenial)
6057
@$(call aptly_undeploy,ces)
6158
endif
6259

6360
.PHONY: undeploy
64-
undeploy: deploy-check remove-package-from-repo publish
61+
undeploy: deploy-check remove-package-from-repo publish ## Undeploy package from apt repository
6562

6663
.PHONE: lint-deb-package
67-
lint-deb-package: debian
64+
lint-deb-package: debian ## Lint debian package
6865
@lintian -i $(DEBIAN_PACKAGE)

0 commit comments

Comments
 (0)