Skip to content

Commit 36cd29a

Browse files
ppxlcesmarvin
authored andcommitted
Merge branch 'release/v0.16.0' into main
2 parents 977faa5 + cb745e4 commit 36cd29a

18 files changed

+1034
-675
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
99

10+
## [v0.16.0] - 2025-01-06
11+
### Added
12+
- [#53] Add Security field to `dogu_v2`, which can be to define security policies for the dogu.
13+
- This can be used for example in the pod security context on the kubernetes platform.
14+
1015
## [v0.15.0] - 2024-11-13
1116
### Added
1217
- [#43] add a timestamp to `dogu_v1` and `dogu_v2` which represents the date and time when a dogu was created

Jenkinsfile

+5-4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ changelog = new Changelog(this)
1414
repositoryOwner = "cloudogu"
1515
repositoryName = "cesapp-lib"
1616
project = "github.com/${repositoryOwner}/${repositoryName}"
17+
goVersion = "1.23.4"
1718

1819
// Configuration of branches
1920
productionReleaseBranch = "main"
@@ -132,7 +133,7 @@ void withBuildDependencies(Closure closure) {
132133
etcdImage.withRun("--network ${buildnetwork} --name ${etcdContainerName}", 'etcd --listen-client-urls http://0.0.0.0:4001 --advertise-client-urls http://0.0.0.0:4001')
133134
{
134135
new Docker(this)
135-
.image('golang:1.18.6')
136+
.image("golang:${goVersion}")
136137
.mountJenkinsUser()
137138
.inside("--network ${buildnetwork} -e ETCD=${etcdContainerName} -e SKIP_SYSLOG_TESTS=true -e SKIP_DOCKER_TESTS=true --volume ${WORKSPACE}:/go/src/${project} -w /go/src/${project}")
138139
{
@@ -146,7 +147,7 @@ void potentiallyCreateDoguDocPR() {
146147
def targetDoguDocDir = "target/dogu-doc"
147148
def coreDoguChapter = "compendium_en.md"
148149
def oldCoreDoguChapter = "${targetDoguDocDir}/docs/core/${coreDoguChapter}"
149-
def newCoreDoguChapter = "target/${coreDoguChapter}"
150+
def newCoreDoguChapter = "target/compendium_en.md"
150151
def doguDocRepoParts = "cloudogu/dogu-development-docs"
151152
def doguDocRepo = "github.com/${doguDocRepoParts}.git"
152153
def doguDocTargetBranch = "main"
@@ -155,7 +156,7 @@ void potentiallyCreateDoguDocPR() {
155156
def gomarkVersion = "v0.4.1-8"
156157

157158
new Docker(this)
158-
.image('golang:1.20') // gomarkdoc needs /go/doc/comment from go 1.19+
159+
.image("golang:${goVersion}") // gomarkdoc needs /go/doc/comment from go 1.19+
159160
.mountJenkinsUser()
160161
.inside("--volume ${WORKSPACE}:/go/src/${project} -w /go/src/${project}") {
161162

@@ -165,7 +166,7 @@ void potentiallyCreateDoguDocPR() {
165166

166167
stage('Build new dogu doc page') {
167168
sh "go install github.com/cloudogu/gomarkdoc/cmd/gomarkdoc@${gomarkVersion}"
168-
sh "gomarkdoc --output ${newCoreDoguChapter} core/dogu_v2.go --include-files dogu_v2.go"
169+
sh "gomarkdoc --output ${newCoreDoguChapter} core/dogu_v2.go --include-files dogu_v2.go,dogu_v2_security.go,dogu_v2_configuration_field.go,dogu_v2_dependency.go,dogu_v2_versions.go,dogu_v2_volume.go"
169170
}
170171

171172
def shouldCreateDoguDocsPR = false

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Set these to the desired values
22
ARTIFACT_ID=cesapp-lib
3-
VERSION=0.15.0
3+
VERSION=0.16.0
44

5-
GOTAG?=1.18.6
5+
GOTAG?=1.23.4
66
MAKEFILES_VERSION=7.4.0
77

88
GO_BUILD_FLAGS?=-mod=vendor -a ./...

core/dogu_format_manager.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package core
22

33
import (
4+
"fmt"
45
"io/ioutil"
5-
6-
"github.com/pkg/errors"
76
)
87

98
const (
@@ -58,17 +57,17 @@ func (d *DoguFormatHandler) GetFormatProviders() []DoguFormatProvider {
5857
func ReadDoguFromFile(filePath string) (*Dogu, DoguApiVersion, error) {
5958
fileContent, err := GetContentOfFile(filePath)
6059
if err != nil {
61-
return nil, DoguApiVersionUnknown, errors.Wrap(err, "Cannot read dogu from invalid file")
60+
return nil, DoguApiVersionUnknown, fmt.Errorf("cannot read dogu from invalid file: %w", err)
6261
}
6362

6463
return ReadDoguFromString(fileContent)
6564
}
6665

67-
// ReadDogusFromFile reads all dogus from a given file and returns them along with a their dogu API version.
66+
// ReadDogusFromFile reads all dogus from a given file and returns them along with their dogu API version.
6867
func ReadDogusFromFile(filePath string) ([]*Dogu, DoguApiVersion, error) {
6968
fileContent, err := GetContentOfFile(filePath)
7069
if err != nil {
71-
return nil, DoguApiVersionUnknown, errors.Wrap(err, "Cannot read dogus from invalid file")
70+
return nil, DoguApiVersionUnknown, fmt.Errorf("cannot read dogus from invalid file: %w", err)
7271
}
7372

7473
return ReadDogusFromString(fileContent)

core/dogu_format_manager_test.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ func Test_DoguFormatProvider_WriteDoguToString(t *testing.T) {
646646
}
647647
dogu := Dogu{Name: "jenkins", Version: "1.625.2", DisplayName: "Jenkins CI", Dependencies: expectedDependencies}
648648
expectedRepresentationV1 := "{\"Name\":\"jenkins\",\"Version\":\"1.625.2\",\"PublishedAt\":\"0001-01-01T00:00:00Z\",\"DisplayName\":\"Jenkins CI\",\"Description\":\"\",\"Category\":\"\",\"Tags\":null,\"Logo\":\"\",\"URL\":\"\",\"Image\":\"\",\"ExposedPorts\":null,\"ExposedCommands\":null,\"Volumes\":null,\"HealthCheck\":{\"Type\":\"\",\"State\":\"\",\"Port\":0,\"Path\":\"\",\"Parameters\":null},\"HealthChecks\":null,\"ServiceAccounts\":null,\"Privileged\":false,\"Configuration\":null,\"Properties\":null,\"EnvironmentVariables\":null,\"Dependencies\":[\"cas\"],\"OptionalDependencies\":null}"
649-
expectedRepresentationV2 := "{\"Name\":\"jenkins\",\"Version\":\"1.625.2\",\"PublishedAt\":\"0001-01-01T00:00:00Z\",\"DisplayName\":\"Jenkins CI\",\"Description\":\"\",\"Category\":\"\",\"Tags\":null,\"Logo\":\"\",\"URL\":\"\",\"Image\":\"\",\"ExposedPorts\":null,\"ExposedCommands\":null,\"Volumes\":null,\"HealthCheck\":{\"Type\":\"\",\"State\":\"\",\"Port\":0,\"Path\":\"\",\"Parameters\":null},\"HealthChecks\":null,\"ServiceAccounts\":null,\"Privileged\":false,\"Configuration\":null,\"Properties\":null,\"EnvironmentVariables\":null,\"Dependencies\":[{\"type\":\"dogu\",\"name\":\"cas\",\"version\":\"\"}],\"OptionalDependencies\":null}"
649+
expectedRepresentationV2 := "{\"Name\":\"jenkins\",\"Version\":\"1.625.2\",\"PublishedAt\":\"0001-01-01T00:00:00Z\",\"DisplayName\":\"Jenkins CI\",\"Description\":\"\",\"Category\":\"\",\"Tags\":null,\"Logo\":\"\",\"URL\":\"\",\"Image\":\"\",\"ExposedPorts\":null,\"ExposedCommands\":null,\"Volumes\":null,\"HealthCheck\":{\"Type\":\"\",\"State\":\"\",\"Port\":0,\"Path\":\"\",\"Parameters\":null},\"HealthChecks\":null,\"ServiceAccounts\":null,\"Privileged\":false,\"Security\":{\"Capabilities\":{},\"RunAsNonRoot\":false,\"ReadOnlyRootFileSystem\":false},\"Configuration\":null,\"Properties\":null,\"EnvironmentVariables\":null,\"Dependencies\":[{\"type\":\"dogu\",\"name\":\"cas\",\"version\":\"\"}],\"OptionalDependencies\":null}"
650650

651651
t.Run("Convert given dogu object into the string representation", func(t *testing.T) {
652652
tests := []formatTest{
@@ -682,7 +682,7 @@ func Test_DoguFormatProvider_WriteDogusToString(t *testing.T) {
682682
dogu2 := Dogu{Name: "scm", Version: "2.625.2", DisplayName: "Scm Manager", Dependencies: expectedDependencies}
683683
dogus := []*Dogu{&dogu1, &dogu2}
684684
expectedRepresentationV1 := "[{\"Name\":\"jenkins\",\"Version\":\"1.625.2\",\"PublishedAt\":\"0001-01-01T00:00:00Z\",\"DisplayName\":\"Jenkins CI\",\"Description\":\"\",\"Category\":\"\",\"Tags\":null,\"Logo\":\"\",\"URL\":\"\",\"Image\":\"\",\"ExposedPorts\":null,\"ExposedCommands\":null,\"Volumes\":null,\"HealthCheck\":{\"Type\":\"\",\"State\":\"\",\"Port\":0,\"Path\":\"\",\"Parameters\":null},\"HealthChecks\":null,\"ServiceAccounts\":null,\"Privileged\":false,\"Configuration\":null,\"Properties\":null,\"EnvironmentVariables\":null,\"Dependencies\":[\"cas\"],\"OptionalDependencies\":null},{\"Name\":\"scm\",\"Version\":\"2.625.2\",\"PublishedAt\":\"0001-01-01T00:00:00Z\",\"DisplayName\":\"Scm Manager\",\"Description\":\"\",\"Category\":\"\",\"Tags\":null,\"Logo\":\"\",\"URL\":\"\",\"Image\":\"\",\"ExposedPorts\":null,\"ExposedCommands\":null,\"Volumes\":null,\"HealthCheck\":{\"Type\":\"\",\"State\":\"\",\"Port\":0,\"Path\":\"\",\"Parameters\":null},\"HealthChecks\":null,\"ServiceAccounts\":null,\"Privileged\":false,\"Configuration\":null,\"Properties\":null,\"EnvironmentVariables\":null,\"Dependencies\":[\"cas\"],\"OptionalDependencies\":null}]"
685-
expectedRepresentationV2 := "[{\"Name\":\"jenkins\",\"Version\":\"1.625.2\",\"PublishedAt\":\"0001-01-01T00:00:00Z\",\"DisplayName\":\"Jenkins CI\",\"Description\":\"\",\"Category\":\"\",\"Tags\":null,\"Logo\":\"\",\"URL\":\"\",\"Image\":\"\",\"ExposedPorts\":null,\"ExposedCommands\":null,\"Volumes\":null,\"HealthCheck\":{\"Type\":\"\",\"State\":\"\",\"Port\":0,\"Path\":\"\",\"Parameters\":null},\"HealthChecks\":null,\"ServiceAccounts\":null,\"Privileged\":false,\"Configuration\":null,\"Properties\":null,\"EnvironmentVariables\":null,\"Dependencies\":[{\"type\":\"dogu\",\"name\":\"cas\",\"version\":\"\"}],\"OptionalDependencies\":null},{\"Name\":\"scm\",\"Version\":\"2.625.2\",\"PublishedAt\":\"0001-01-01T00:00:00Z\",\"DisplayName\":\"Scm Manager\",\"Description\":\"\",\"Category\":\"\",\"Tags\":null,\"Logo\":\"\",\"URL\":\"\",\"Image\":\"\",\"ExposedPorts\":null,\"ExposedCommands\":null,\"Volumes\":null,\"HealthCheck\":{\"Type\":\"\",\"State\":\"\",\"Port\":0,\"Path\":\"\",\"Parameters\":null},\"HealthChecks\":null,\"ServiceAccounts\":null,\"Privileged\":false,\"Configuration\":null,\"Properties\":null,\"EnvironmentVariables\":null,\"Dependencies\":[{\"type\":\"dogu\",\"name\":\"cas\",\"version\":\"\"}],\"OptionalDependencies\":null}]"
685+
expectedRepresentationV2 := "[{\"Name\":\"jenkins\",\"Version\":\"1.625.2\",\"PublishedAt\":\"0001-01-01T00:00:00Z\",\"DisplayName\":\"Jenkins CI\",\"Description\":\"\",\"Category\":\"\",\"Tags\":null,\"Logo\":\"\",\"URL\":\"\",\"Image\":\"\",\"ExposedPorts\":null,\"ExposedCommands\":null,\"Volumes\":null,\"HealthCheck\":{\"Type\":\"\",\"State\":\"\",\"Port\":0,\"Path\":\"\",\"Parameters\":null},\"HealthChecks\":null,\"ServiceAccounts\":null,\"Privileged\":false,\"Security\":{\"Capabilities\":{},\"RunAsNonRoot\":false,\"ReadOnlyRootFileSystem\":false},\"Configuration\":null,\"Properties\":null,\"EnvironmentVariables\":null,\"Dependencies\":[{\"type\":\"dogu\",\"name\":\"cas\",\"version\":\"\"}],\"OptionalDependencies\":null},{\"Name\":\"scm\",\"Version\":\"2.625.2\",\"PublishedAt\":\"0001-01-01T00:00:00Z\",\"DisplayName\":\"Scm Manager\",\"Description\":\"\",\"Category\":\"\",\"Tags\":null,\"Logo\":\"\",\"URL\":\"\",\"Image\":\"\",\"ExposedPorts\":null,\"ExposedCommands\":null,\"Volumes\":null,\"HealthCheck\":{\"Type\":\"\",\"State\":\"\",\"Port\":0,\"Path\":\"\",\"Parameters\":null},\"HealthChecks\":null,\"ServiceAccounts\":null,\"Privileged\":false,\"Security\":{\"Capabilities\":{},\"RunAsNonRoot\":false,\"ReadOnlyRootFileSystem\":false},\"Configuration\":null,\"Properties\":null,\"EnvironmentVariables\":null,\"Dependencies\":[{\"type\":\"dogu\",\"name\":\"cas\",\"version\":\"\"}],\"OptionalDependencies\":null}]"
686686

687687
t.Run("Convert given dogu object into the string representation", func(t *testing.T) {
688688
tests := []formatTest{
@@ -713,3 +713,11 @@ func Test_DoguFormatProvider_WriteDogusToString(t *testing.T) {
713713
}
714714
})
715715
}
716+
717+
func TestUnmarshalProperties(t *testing.T) {
718+
dogu := &Dogu{}
719+
dogu, _, err := ReadDoguFromFile("../resources/test/unmarshalProperties.json")
720+
require.Nil(t, err)
721+
assert.Equal(t, "http://test.test", dogu.Properties["logoutUrl"])
722+
assert.Equal(t, "25", dogu.Properties["TestPort"])
723+
}

0 commit comments

Comments
 (0)