Skip to content

Commit 4e65f37

Browse files
nhinze23cesmarvin
authored andcommitted
Merge branch 'release/v3.40.1-1'
2 parents 6bfc4ed + bc87cf2 commit 4e65f37

26 files changed

+727
-190
lines changed

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.40.1-1] - 2022-07-12
10+
### Changed
11+
- Upgrade Sonatype Nexus to v3.40.1-01; #106
12+
- Upgrade Makefiles to 6.0.3
13+
- Upgrade Base Image to 8u302-3
14+
915
## [v3.37.3-4] - 2022-04-06
1016
### Changed
1117
- Upgrade zlib package to fix CVE-2018-25032; #100

Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# registry.cloudogu.com/official/nexus
2-
FROM registry.cloudogu.com/official/java:8u302-1
2+
FROM registry.cloudogu.com/official/java:8u302-3
33
LABEL maintainer="[email protected]" \
44
NAME="official/nexus" \
5-
VERSION="3.37.3-4"
5+
VERSION="3.40.1-1"
66

77
# The version of nexus to install
8-
ENV NEXUS_VERSION=3.37.3-02 \
8+
ENV NEXUS_VERSION=3.40.1-01 \
99
TINI_VERSION=0.19.0 \
1010
NEXUS_CLAIM_VERSION=1.0.0 \
1111
NEXUS_CARP_VERSION=1.3.1 \
@@ -16,7 +16,7 @@ ENV NEXUS_VERSION=3.37.3-02 \
1616
NEXUS_WORKDIR=/opt/sonatype/nexus \
1717
NEXUS_SERVER="http://localhost:8081/nexus" \
1818
SHA256_TINI="c5b0666b4cb676901f90dfcb37106783c5fe2077b04590973b885950611b30ee" \
19-
SHA256_NEXUS_TAR="c1db431908c5a76b44015c555d6ef4517abf0a86844faffee0f5d6c62359312d" \
19+
SHA256_NEXUS_TAR="97f4e847e5c2ba714b09456f9fb5f449c7e89b2f0a2b8c175f36cc31f345774e" \
2020
SHA256_NEXUS_CLAIM="a34608ac7b516d6bc91f8a157bea286919c14e5fb5ecc76fc15edccb35adec42" \
2121
SHA256_NEXUS_SCRIPTING="60c7f3d8a0c97b1d90d954ebad9dc07dbeb7927934b618c874b2e72295cafb48" \
2222
SHA256_NEXUS_CARP="f9a9d9f9efcabd27fb4df2544142000d5607c8feb9772e77f23239d7a6647458"

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
MAKEFILES_VERSION=4.2.0
1+
MAKEFILES_VERSION=6.0.3
2+
VERSION=3.40.1-1
23

34
.DEFAULT_GOAL:=dogu-release
45

build/make/bower.mk

+4-2
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

+20-14
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

+5-2
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-gomod.mk

+3-1
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

+9-12
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)

build/make/digital-signature.mk

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
##@ Digital signatures
2+
13
CHECKSUM=$(TARGET_DIR)/$(ARTIFACT_ID).sha256sum
24

35
.PHONY: checksum
4-
checksum: $(CHECKSUM)
6+
checksum: $(CHECKSUM) ## Generate checksums
57
# we have to depend on target dir, because we want to rebuild the checksum
68
# if one of the artefacts was changed
79
$(CHECKSUM): $(TARGET_DIR)
@@ -11,7 +13,12 @@ $(CHECKSUM): $(TARGET_DIR)
1113
SIGNATURE=$(CHECKSUM).asc
1214

1315
.PHONY: signature
14-
signature: $(SIGNATURE)
16+
signature: $(SIGNATURE) ## Generate signature
1517
$(SIGNATURE): $(CHECKSUM)
1618
@echo "Generating Signature"
1719
@gpg --batch --yes --detach-sign --armor -o $@ $<
20+
21+
.PHONY: signature-ci
22+
signature-ci: $(CHECKSUM)
23+
@echo "Generating Signature"
24+
@gpg2 --batch --pinentry-mode loopback --passphrase="${passphrase}" --yes --detach-sign --armor -o ${SIGNATURE} $<

build/make/k8s-controller.mk

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# This script can be used to build and deploy kubernetes controllers. It is required to implement the controller
2+
# specific targets `manifests` and `generate`:
3+
#
4+
# Examples:
5+
#
6+
#.PHONY: manifests
7+
#manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
8+
# @echo "Generate manifests..."
9+
# @$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
10+
#
11+
#.PHONY: generate
12+
#generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
13+
# @echo "Auto-generate deepcopy functions..."
14+
# @$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
15+
16+
# This script requires the k8s.mk script
17+
include $(WORKDIR)/build/make/k8s.mk
18+
19+
## Variables
20+
21+
# Setting SHELL to bash allows bash commands to be executed by recipes.
22+
# This is a requirement for 'setup-envtest.sh' in the test target.
23+
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
24+
SHELL = /usr/bin/env bash -o pipefail
25+
.SHELLFLAGS = -ec
26+
27+
# make sure to create a statically linked binary otherwise it may quit with
28+
# "exec user process caused: no such file or directory"
29+
GO_BUILD_FLAGS=-mod=vendor -a -tags netgo,osusergo $(LDFLAGS) -o $(BINARY)
30+
31+
# remove DWARF symbol table and strip other symbols to shave ~13 MB from binary
32+
ADDITIONAL_LDFLAGS=-extldflags -static -w -s
33+
34+
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
35+
ENVTEST_K8S_VERSION = 1.23
36+
K8S_INTEGRATION_TEST_DIR=${TARGET_DIR}/k8s-integration-test
37+
38+
##@ K8s - EcoSystem
39+
40+
.PHONY: build
41+
build: image-import k8s-apply ## Builds a new version of the dogu and deploys it into the K8s-EcoSystem.
42+
43+
##@ Release
44+
45+
.PHONY: controller-release
46+
controller-release: ## Interactively starts the release workflow.
47+
@echo "Starting git flow release..."
48+
@build/make/release.sh controller-tool
49+
50+
##@ K8s - Development
51+
52+
.PHONY: build-controller
53+
build-controller: ${SRC} compile ## Builds the controller Go binary.
54+
55+
# Allows to perform tasks before locally running the controller
56+
K8S_RUN_PRE_TARGETS ?=
57+
.PHONY: run
58+
run: manifests generate vet $(K8S_RUN_PRE_TARGETS) ## Run a controller from your host.
59+
go run -ldflags "-X main.Version=$(VERSION)" ./main.go
60+
61+
##@ K8s - Integration test with envtest
62+
63+
$(K8S_INTEGRATION_TEST_DIR):
64+
@mkdir -p $@
65+
66+
.PHONY: k8s-integration-test
67+
k8s-integration-test: $(K8S_INTEGRATION_TEST_DIR) manifests generate vet envtest ## Run k8s integration tests.
68+
@echo "Running K8s integration tests..."
69+
@KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test -tags=k8s_integration ./... -coverprofile ${K8S_INTEGRATION_TEST_DIR}/report-k8s-integration.out
70+
71+
##@ K8s - Controller Resource
72+
73+
# The pre generation script creates a K8s resource yaml containing generated manager yaml.
74+
.PHONY: k8s-create-temporary-resource
75+
k8s-create-temporary-resource: ${TARGET_DIR} manifests kustomize
76+
@echo "Generating temporary k8s resources $(K8S_RESOURCE_TEMP_YAML)..."
77+
cd $(WORKDIR)/config/manager && $(KUSTOMIZE) edit set image controller=$(IMAGE)
78+
$(KUSTOMIZE) build config/default > $(K8S_RESOURCE_TEMP_YAML)
79+
@echo "Done."
80+
81+
##@ K8s - Download Kubernetes Utility Tools
82+
83+
CONTROLLER_GEN = $(UTILITY_BIN_PATH)/controller-gen
84+
.PHONY: controller-gen
85+
controller-gen: ## Download controller-gen locally if necessary.
86+
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/[email protected])
87+
88+
KUSTOMIZE = $(UTILITY_BIN_PATH)/kustomize
89+
.PHONY: kustomize
90+
kustomize: ## Download kustomize locally if necessary.
91+
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected])
92+
93+
ENVTEST = $(UTILITY_BIN_PATH)/setup-envtest
94+
.PHONY: envtest
95+
envtest: ## Download envtest-setup locally if necessary.
96+
$(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest)

build/make/k8s-dogu.mk

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
# Variables
3+
4+
# Path to the dogu json of the dogu
5+
DOGU_JSON_FILE=$(WORKDIR)/dogu.json
6+
DOGU_JSON_DEV_FILE=${TARGET_DIR}/dogu.json
7+
# Name of the dogu is extracted from the dogu.json
8+
ARTIFACT_ID=$(shell yq -e ".Name" $(DOGU_JSON_FILE) | sed "s|.*/||g")
9+
# Namespace of the dogu is extracted from the dogu.json
10+
ARTIFACT_NAMESPACE=$(shell yq -e ".Name" $(DOGU_JSON_FILE) | sed "s|/.*||g")
11+
# Namespace of the dogu is extracted from the dogu.json
12+
VERSION=$(shell yq -e ".Version" $(DOGU_JSON_FILE))
13+
# Image of the dogu is extracted from the dogu.json
14+
IMAGE=$(shell yq -e ".Image" $(DOGU_JSON_FILE)):$(VERSION)
15+
IMAGE_DEV_WITHOUT_TAG=$(shell yq -e ".Image" $(DOGU_JSON_FILE) | sed "s|registry\.cloudogu\.com\(.\+\)|${K3CES_REGISTRY_URL_PREFIX}\1|g")
16+
IMAGE_DEV=${IMAGE_DEV_WITHOUT_TAG}:${VERSION}
17+
18+
include $(WORKDIR)/build/make/k8s.mk
19+
20+
##@ K8s - EcoSystem
21+
22+
.PHONY: build
23+
build: image-import install-dogu-descriptor k8s-apply ## Builds a new version of the dogu and deploys it into the K8s-EcoSystem.
24+
25+
##@ K8s - Dogu - Resource
26+
27+
# The additional k8s yaml files
28+
K8S_RESOURCE_PRODUCTIVE_FOLDER ?= $(WORKDIR)/k8s
29+
K8S_RESOURCE_PRODUCTIVE_YAML ?= $(K8S_RESOURCE_PRODUCTIVE_FOLDER)/$(ARTIFACT_ID).yaml
30+
K8S_RESOURCE_DOGU_CR_TEMPLATE_YAML ?= $(WORKDIR)/build/make/k8s-dogu.tpl
31+
# The pre generation script creates a k8s resource yaml containing the dogu crd and the content from the k8s folder.
32+
.PHONY: k8s-create-temporary-resource
33+
k8s-create-temporary-resource: $(TARGET_DIR) $(K8S_RESOURCE_TEMP_FOLDER)
34+
@echo "Generating temporary K8s resources $(K8S_RESOURCE_TEMP_YAML)..."
35+
@rm -f $(K8S_RESOURCE_TEMP_YAML)
36+
@sed "s|NAMESPACE|$(ARTIFACT_NAMESPACE)|g" $(K8S_RESOURCE_DOGU_CR_TEMPLATE_YAML) | sed "s|NAME|$(ARTIFACT_ID)|g" | sed "s|VERSION|$(VERSION)|g" >> $(K8S_RESOURCE_TEMP_YAML)
37+
@echo "Done."
38+
39+
##@ K8s - Dogu
40+
41+
.PHONY: install-dogu-descriptor
42+
install-dogu-descriptor: $(TARGET_DIR) ## Installs a configmap with current dogu.json into the cluster.
43+
@echo "Generate configmap from dogu.json..."
44+
@jq ".Image=\"${IMAGE_DEV_WITHOUT_TAG}\"" ${DOGU_JSON_FILE} > ${DOGU_JSON_DEV_FILE}
45+
@kubectl create configmap "$(ARTIFACT_ID)-descriptor" --from-file=$(DOGU_JSON_DEV_FILE) --dry-run=client -o yaml | kubectl apply -f -
46+
@echo "Done."

build/make/k8s-dogu.tpl

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: k8s.cloudogu.com/v1
2+
kind: Dogu
3+
metadata:
4+
name: NAME
5+
labels:
6+
dogu: NAME
7+
spec:
8+
name: NAMESPACE/NAME
9+
version: VERSION

0 commit comments

Comments
 (0)