Skip to content

Commit

Permalink
Merge branch 'release/v4.2.8-1'
Browse files Browse the repository at this point in the history
  • Loading branch information
sklein94 authored and cesmarvin committed Oct 6, 2022
2 parents 79b1004 + fc6ded5 commit 23d8580
Show file tree
Hide file tree
Showing 39 changed files with 796 additions and 326 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v4.2.8-1] - 2022-10-06
### Changed
- Upgrade to Redmine 4.2.8; #105
- Upgrade makefiles to version `7.0.1`; #105
- Upgrade makefiles to ces-build-lib `1.57.0`; #105
- Upgrade makefiles to dogu-build-lib `1.6.0`; #105

### Fixed
- Redmine plugins are not saved in the backup. This behaviour is invalid and was reversed; #105

## [v4.2.7-1] - 2022-09-30
### Changed
- Upgrade to Redmine 4.2.7; #103
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
FROM registry.cloudogu.com/official/base:3.14.3-1

LABEL NAME="official/redmine" \
VERSION="4.2.7-1" \
VERSION="4.2.8-1" \
maintainer="[email protected]"

# This Dockerfile is based on https://github.com/docker-library/redmine/blob/master/4.0/alpine/Dockerfile

# set environment variables
ENV REDMINE_VERSION=4.2.7 \
ENV REDMINE_VERSION=4.2.8 \
CAS_PLUGIN_VERSION=2.0.0 \
ACTIVERECORD_SESSION_STORE_PLUGIN_VERSION=0.1.0 \
EXTENDED_REST_API_PLUGIN_VERSION=1.1.0 \
Expand All @@ -18,7 +18,7 @@ ENV REDMINE_VERSION=4.2.7 \
WORKDIR=/usr/share/webapps/redmine \
SERVICE_TAGS=webapp \
RAILS_ENV=production \
REDMINE_TARGZ_SHA256=ed4be03b5ab63c2641a87db8978739dd997c0f646bfa1010ac9e5210c343724e \
REDMINE_TARGZ_SHA256=0b431c052d8fd36b93201dafaf3615cdb8d03460efcf2400e7d32662b2ab6272 \
CAS_PLUGIN_TARGZ_SHA256=f296de1a13ee1d52d545c0ee29c685f8eb46b606ccabd16fe3e392008c892f96 \
EXTENDED_REST_API_TARGZ_SHA256=7def9dee6a72f7a98c34c3d0beb17dabd414a1af86153624eb03ffe631272b31 \
ACTIVERECORD_TARGZ_SHA256=a5d3a5ac6c5329212621bab128a2f94b0ad6bb59084f3cc714786a297bcdc7ee \
Expand Down
26 changes: 4 additions & 22 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!groovy
@Library(['github.com/cloudogu/ces-build-lib@v1.48.0', 'github.com/cloudogu/dogu-build-lib@v1.5.1']) _
@Library(['github.com/cloudogu/ces-build-lib@1.57.0', 'github.com/cloudogu/dogu-build-lib@v1.6.0']) _
import com.cloudogu.ces.cesbuildlib.*
import com.cloudogu.ces.dogubuildlib.*
import com.cloudogu.ces.zaleniumbuildlib.*
Expand Down Expand Up @@ -47,8 +47,9 @@ node('vagrant') {
}

try {
stage('Shell tests') {
executeShellTests()
stage('Bats Tests') {
Bats bats = new Bats(this, docker)
bats.checkAndExecuteTests()
}

stage('Provision') {
Expand All @@ -59,7 +60,6 @@ node('vagrant') {
stage('Setup') {
ecoSystem.loginBackend('cesmarvin-setup')
ecoSystem.setup([additionalDependencies: ['official/postgresql']])

}

stage('Wait for dependencies') {
Expand Down Expand Up @@ -174,21 +174,3 @@ def runIntegrationTests(EcoSystem ecoSystem, String additionalCypressArgs) {
additionalCypressArgs: "${additionalCypressArgs}"
])
}

def executeShellTests() {
def bats_base_image = "bats/bats"
def bats_custom_image = "cloudogu/bats"
def bats_tag = "1.2.1"

def batsImage = docker.build("${bats_custom_image}:${bats_tag}", "--build-arg=BATS_BASE_IMAGE=${bats_base_image} --build-arg=BATS_TAG=${bats_tag} ./unitTests")
try {
sh "mkdir -p target"
sh "mkdir -p testdir"

batsContainer = batsImage.inside("--entrypoint='' -v ${WORKSPACE}:/workspace -v ${WORKSPACE}/testdir:/usr/share/webapps") {
sh "make unit-test-shell-ci"
}
} finally {
junit allowEmptyResults: true, testResults: 'target/shell_test_reports/*.xml'
}
}
63 changes: 2 additions & 61 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,67 +1,8 @@
MAKEFILES_VERSION=4.2.0
MAKEFILES_VERSION=7.0.1

.DEFAULT_GOAL:=dogu-release

WORKSPACE=/workspace
BATS_LIBRARY_DIR=$(TARGET_DIR)/bats_libs
TESTS_DIR=./unitTests
BASH_TEST_REPORT_DIR=$(TARGET_DIR)/shell_test_reports
BASH_TEST_REPORTS=$(BASH_TEST_REPORT_DIR)/TestReport-*.xml
BATS_ASSERT=$(BATS_LIBRARY_DIR)/bats-assert
BATS_MOCK=$(BATS_LIBRARY_DIR)/bats-mock
BATS_SUPPORT=$(BATS_LIBRARY_DIR)/bats-support
BATS_FILE=$(BATS_LIBRARY_DIR)/bats-file
BATS_BASE_IMAGE?=bats/bats
BATS_CUSTOM_IMAGE?=cloudogu/bats
BATS_TAG?=1.2.1

include build/make/variables.mk
include build/make/self-update.mk
include build/make/release.mk

.PHONY unit-test-shell:
unit-test-shell: unit-test-shell-$(ENVIRONMENT)

$(BATS_ASSERT):
@git clone --depth 1 https://github.com/bats-core/bats-assert $@

$(BATS_MOCK):
@git clone --depth 1 https://github.com/grayhemp/bats-mock $@

$(BATS_SUPPORT):
@git clone --depth 1 https://github.com/bats-core/bats-support $@

$(BATS_FILE):
@git clone --depth 1 https://github.com/bats-core/bats-file $@

$(BASH_SRC):
BASH_SRC:=$(shell find "${WORKDIR}" -type f -name "*.sh")

${BASH_TEST_REPORT_DIR}: $(TARGET_DIR)
@mkdir -p $(BASH_TEST_REPORT_DIR)

unit-test-shell-ci: $(BASH_SRC) $(BASH_TEST_REPORT_DIR) $(BATS_ASSERT) $(BATS_MOCK) $(BATS_SUPPORT) $(BATS_FILE)
@echo "Test shell units on CI server"
@make unit-test-shell-generic

unit-test-shell-local: $(BASH_SRC) $(PASSWD) $(ETCGROUP) $(HOME_DIR) buildTestImage $(BASH_TEST_REPORT_DIR) $(BATS_ASSERT) $(BATS_MOCK) $(BATS_SUPPORT) $(BATS_FILE)
@echo "Test shell units locally (in Docker)"
@docker run --rm \
-v $(HOME_DIR):/home/$(USER) \
-v $(WORKDIR):$(WORKSPACE) \
-w $(WORKSPACE) \
--entrypoint="" \
$(BATS_CUSTOM_IMAGE):$(BATS_TAG) \
${TESTS_DIR}/customBatsEntrypoint.sh make unit-test-shell-generic

unit-test-shell-generic:
@bats --formatter junit --output ${BASH_TEST_REPORT_DIR} ${TESTS_DIR}

.PHONY buildTestImage:
buildTestImage:
@echo "Build shell test container"
@cd ${TESTS_DIR} && docker build \
--build-arg=BATS_BASE_IMAGE=${BATS_BASE_IMAGE} \
--build-arg=BATS_TAG=${BATS_TAG} \
-t ${BATS_CUSTOM_IMAGE}:${BATS_TAG} \
.
include build/make/bats.mk
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
64 changes: 64 additions & 0 deletions build/make/bats.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
WORKSPACE=/workspace
BATS_LIBRARY_DIR=$(TARGET_DIR)/bats_libs
TESTS_DIR=$(WORKDIR)/batsTests
BASH_TEST_REPORT_DIR=$(TARGET_DIR)/shell_test_reports
BASH_TEST_REPORTS=$(BASH_TEST_REPORT_DIR)/TestReport-*.xml
BATS_ASSERT=$(BATS_LIBRARY_DIR)/bats-assert
BATS_MOCK=$(BATS_LIBRARY_DIR)/bats-mock
BATS_SUPPORT=$(BATS_LIBRARY_DIR)/bats-support
BATS_FILE=$(BATS_LIBRARY_DIR)/bats-file
BATS_BASE_IMAGE?=bats/bats
BATS_CUSTOM_IMAGE?=cloudogu/bats
BATS_TAG?=1.2.1
BATS_DIR=build/make/bats
BATS_WORKDIR="${WORKDIR}"/"${BATS_DIR}"

.PHONY unit-test-shell:
unit-test-shell: unit-test-shell-$(ENVIRONMENT)

$(BATS_ASSERT):
@git clone --depth 1 https://github.com/bats-core/bats-assert $@

$(BATS_MOCK):
@git clone --depth 1 https://github.com/grayhemp/bats-mock $@

$(BATS_SUPPORT):
@git clone --depth 1 https://github.com/bats-core/bats-support $@

$(BATS_FILE):
@git clone --depth 1 https://github.com/bats-core/bats-file $@

$(BASH_SRC):
BASH_SRC:=$(shell find "${WORKDIR}" -type f -name "*.sh")

${BASH_TEST_REPORT_DIR}: $(TARGET_DIR)
@mkdir -p $(BASH_TEST_REPORT_DIR)

unit-test-shell-ci: $(BASH_SRC) $(BASH_TEST_REPORT_DIR) $(BATS_ASSERT) $(BATS_MOCK) $(BATS_SUPPORT) $(BATS_FILE)
@echo "Test shell units on CI server"
@make unit-test-shell-generic

unit-test-shell-local: $(BASH_SRC) $(PASSWD) $(ETCGROUP) $(HOME_DIR) buildTestImage $(BASH_TEST_REPORT_DIR) $(BATS_ASSERT) $(BATS_MOCK) $(BATS_SUPPORT) $(BATS_FILE)
@echo "Test shell units locally (in Docker)"
@docker run --rm \
-v $(HOME_DIR):/home/$(USER) \
-v $(WORKDIR):$(WORKSPACE) \
-w $(WORKSPACE) \
--entrypoint="" \
$(BATS_CUSTOM_IMAGE):$(BATS_TAG) \
"${BATS_DIR}"/customBatsEntrypoint.sh make unit-test-shell-generic-no-junit

unit-test-shell-generic:
@bats --formatter junit --output ${BASH_TEST_REPORT_DIR} ${TESTS_DIR}

unit-test-shell-generic-no-junit:
@bats ${TESTS_DIR}

.PHONY buildTestImage:
buildTestImage:
@echo "Build shell test container"
@cd $(BATS_WORKDIR) && docker build \
--build-arg=BATS_BASE_IMAGE=${BATS_BASE_IMAGE} \
--build-arg=BATS_TAG=${BATS_TAG} \
-t ${BATS_CUSTOM_IMAGE}:${BATS_TAG} \
.
File renamed without changes.
File renamed without changes.
6 changes: 4 additions & 2 deletions build/make/bower.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
##@ Bower dependency management

BOWER_JSON=$(WORKDIR)/bower.json

.PHONY: bower-install
bower-install: $(BOWER_TARGET)
bower-install: $(BOWER_TARGET) ## Execute yarn run bower (in Docker)

ifeq ($(ENVIRONMENT), ci)

Expand All @@ -19,7 +21,7 @@ $(BOWER_TARGET): $(BOWER_JSON) $(PASSWD) $(YARN_TARGET)
-v $(PASSWD):/etc/passwd:ro \
-v $(WORKDIR):$(WORKDIR) \
-w $(WORKDIR) \
node:8 \
node:$(NODE_VERSION) \
yarn run bower
@touch $@

Expand Down
34 changes: 20 additions & 14 deletions build/make/build.mk
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
##@ Compiling go software

ADDITIONAL_LDFLAGS?=-extldflags -static
LDFLAGS?=-ldflags "$(ADDITIONAL_LDFLAGS) -X main.Version=$(VERSION) -X main.CommitID=$(COMMIT_ID)"
GOIMAGE?=cloudogu/golang
GOTAG?=1.10.2-2
GOIMAGE?=golang
GOTAG?=1.14.13
GOOS?=linux
GOARCH?=amd64
PRE_COMPILE?=
GO_ENV_VARS?=
CUSTOM_GO_MOUNT?=-v /tmp:/tmp
GO_BUILD_FLAGS?=-mod=vendor -a -tags netgo $(LDFLAGS) -installsuffix cgo -o $(BINARY)

.PHONY: compile
compile: $(BINARY)
compile: $(BINARY) ## Compile the go program via Docker

compile-ci:
compile-ci: ## Compile the go program without Docker
@echo "Compiling (CI)..."
make compile-generic

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


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

else

$(BINARY): $(SRC) vendor $(PASSWD) $(HOME_DIR) $(PRE_COMPILE)
$(BINARY): $(SRC) vendor $(PASSWD) $(ETCGROUP) $(HOME_DIR) $(PRE_COMPILE)
@echo "Building locally (in Docker)"
@docker run --rm \
-e GOOS=$(GOOS) \
-e GOARCH=$(GOARCH) \
-u "$(UID_NR):$(GID_NR)" \
-v $(PASSWD):/etc/passwd:ro \
-v $(HOME_DIR):/home/$(USER) \
-v $(WORKDIR):/go/src/github.com/cloudogu/$(ARTIFACT_ID) \
-w /go/src/github.com/cloudogu/$(ARTIFACT_ID) \
$(GOIMAGE):$(GOTAG) \
-e GOOS=$(GOOS) \
-e GOARCH=$(GOARCH) \
-u "$(UID_NR):$(GID_NR)" \
-v $(PASSWD):/etc/passwd:ro \
-v $(ETCGROUP):/etc/group:ro \
-v $(HOME_DIR):/home/$(USER) \
-v $(WORKDIR):/go/src/github.com/cloudogu/$(ARTIFACT_ID) \
$(CUSTOM_GO_MOUNT) \
-w /go/src/github.com/cloudogu/$(ARTIFACT_ID) \
$(GOIMAGE):$(GOTAG) \
make compile-generic

endif
7 changes: 5 additions & 2 deletions build/make/clean.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
##@ Cleaning

.PHONY: clean
clean: $(ADDITIONAL_CLEAN)
clean: $(ADDITIONAL_CLEAN) ## Remove target and tmp directories
rm -rf ${TARGET_DIR}
rm -rf ${TMP_DIR}
rm -rf ${UTILITY_BIN_PATH}

.PHONY: dist-clean
dist-clean: clean
dist-clean: clean ## Remove all generated directories
rm -rf node_modules
rm -rf public/vendor
rm -rf vendor
Expand Down
24 changes: 0 additions & 24 deletions build/make/dependencies-glide.mk

This file was deleted.

10 changes: 0 additions & 10 deletions build/make/dependencies-godep.mk

This file was deleted.

4 changes: 3 additions & 1 deletion build/make/dependencies-gomod.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
##@ Go mod dependency management

.PHONY: dependencies
dependencies: vendor
dependencies: vendor ## Install dependencies using go mod

vendor: go.mod go.sum
@echo "Installing dependencies using go modules..."
Expand Down
Loading

0 comments on commit 23d8580

Please sign in to comment.