Skip to content

Commit cfb97fc

Browse files
kahoona77cesmarvin
authored andcommitted
Merge branch 'release/v1.26.2-3'
2 parents 5c28726 + 59d357f commit cfb97fc

34 files changed

+1307
-231
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [v1.26.2-3] - 2025-01-28
11+
### Changed
12+
- update Makefiles to 9.5.3
13+
14+
### Fixed
15+
- adapt font stack for warp menu to ces-theme-tailwind
16+
- better screenreader support for submenus as links
17+
1018
## [v1.26.2-2] - 2024-12-06
1119
### Changed
1220
- Update ces-about to v0.7.0 for updated license information

Dockerfile

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM node:lts-alpine as templating
22

33
ENV WORKDIR=/template \
44
# Used in template to invalidate caches - do not remove. The release script will auto update this line
5-
VERSION="1.26.2-2"
5+
VERSION="1.26.2-3"
66

77
RUN mkdir -p ${WORKDIR}
88
WORKDIR ${WORKDIR}
@@ -14,16 +14,16 @@ RUN yarn install
1414
RUN node template-colors.js ${WORKDIR}/resources/var/www/html/styles/default.css.tpl ${WORKDIR}/build/default.css
1515
RUN node template-error-pages.js ${WORKDIR}/resources/var/www/html/errors/error-page.html.tpl ${WORKDIR}/build/errors
1616

17-
FROM registry.cloudogu.com/official/base:3.20.3-3 as builder
17+
FROM registry.cloudogu.com/official/base:3.21.0-1 as builder
1818
LABEL maintainer="[email protected]"
1919

2020
# dockerfile is based on https://github.com/dockerfile/nginx and https://github.com/bellycard/docker-loadbalancer
2121
ENV NGINX_VERSION=1.26.2 \
2222
NGINX_TAR_SHA256="627fe086209bba80a2853a0add9d958d7ebbdffa1a8467a5784c9a6b4f03d738" \
23-
CES_CONFD_VERSION=0.9.0 \
24-
CES_CONFD_TAR_SHA256="8507f40824562b8d2c1f32afb43ce1aad576a82febd2f97bd2cf31b0753a8cbd" \
25-
WARP_MENU_VERSION=2.0.0 \
26-
WARP_MENU_TAR_SHA256="51a1010ec0f82b634999e48976d7fec98e6eb574a4401a841cd53f8cd0e14040" \
23+
CES_CONFD_VERSION=0.11.0 \
24+
CES_CONFD_TAR_SHA256="85809a3e9e0b56d58c53f958872809eab1026124a73a06eedfcdeba9ca73ec9a" \
25+
WARP_MENU_VERSION=2.0.3 \
26+
WARP_MENU_ZIP_SHA256="8dfd023579728b6786bdb4664fb6d3e629717d9d2d27cdd4b365f9a844f1858c" \
2727
CES_ABOUT_VERSION="0.7.0" \
2828
CES_ABOUT_TAR_SHA256="fcfdfb86dac75d5ae751cc0e8c3436ecee12f0d5ed830897c4f61029ae1df27e"
2929

@@ -62,17 +62,17 @@ RUN wget --progress=bar:force:noscroll -O /tmp/ces-about-v${CES_ABOUT_VERSION}.t
6262

6363
# install warp menu
6464
RUN wget --progress=bar:force:noscroll -O /tmp/warp.zip https://github.com/cloudogu/warp-menu/releases/download/v${WARP_MENU_VERSION}/warp-v${WARP_MENU_VERSION}.zip \
65-
&& echo "${WARP_MENU_TAR_SHA256} */tmp/warp.zip" | sha256sum -c - \
65+
&& echo "${WARP_MENU_ZIP_SHA256} */tmp/warp.zip" | sha256sum -c - \
6666
&& unzip /tmp/warp.zip -d /build/var/www/html
6767

68-
FROM registry.cloudogu.com/official/base:3.20.3-3
68+
FROM registry.cloudogu.com/official/base:3.21.0-1
6969
LABEL maintainer="[email protected]" \
7070
NAME="official/nginx" \
71-
VERSION="1.26.2-2"
71+
VERSION="1.26.2-3"
7272

7373
ENV CES_MAINTENANCE_MODE=false \
7474
# Used in template to invalidate caches - do not remove. The release script will auto update this line
75-
VERSION="1.26.2-2"
75+
VERSION="1.26.2-3"
7676

7777
RUN set -x -o errexit \
7878
&& set -o nounset \

Jenkinsfile

+22-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!groovy
2-
@Library(['github.com/cloudogu/dogu-build-lib@v2.5.0', 'github.com/cloudogu/ces-build-lib@3.0.0']) _
2+
@Library(['github.com/cloudogu/dogu-build-lib@v3.0.0', 'github.com/cloudogu/ces-build-lib@4.0.1']) _
33
import com.cloudogu.ces.dogubuildlib.*
44
import com.cloudogu.ces.cesbuildlib.*
55

@@ -16,7 +16,9 @@ node('vagrant') {
1616
booleanParam(defaultValue: true, description: 'Enables cypress to record video of the integration tests.', name: 'EnableVideoRecording'),
1717
booleanParam(defaultValue: true, description: 'Enables cypress to take screenshots of failing integration tests.', name: 'EnableScreenshotRecording'),
1818
booleanParam(defaultValue: false, description: 'Test dogu upgrade from latest release or optionally from defined version below', name: 'TestDoguUpgrade'),
19-
string(defaultValue: '', description: 'Old Dogu version for the upgrade test (optional; e.g. 3.23.0-1)', name: 'OldDoguVersionForUpgradeTest')
19+
string(defaultValue: '', description: 'Old Dogu version for the upgrade test (optional; e.g. 3.23.0-1)', name: 'OldDoguVersionForUpgradeTest'),
20+
choice(name: 'TrivySeverityLevels', choices: [TrivySeverityLevel.CRITICAL, TrivySeverityLevel.HIGH_AND_ABOVE, TrivySeverityLevel.MEDIUM_AND_ABOVE, TrivySeverityLevel.ALL], description: 'The levels to scan with trivy', defaultValue: TrivySeverityLevel.CRITICAL),
21+
choice(name: 'TrivyStrategy', choices: [TrivyScanStrategy.UNSTABLE, TrivyScanStrategy.FAIL, TrivyScanStrategy.IGNORE], description: 'Define whether the build should be unstable, fail or whether the error should be ignored if any vulnerability was found.', defaultValue: TrivyScanStrategy.UNSTABLE),
2022
])
2123
])
2224

@@ -49,6 +51,10 @@ node('vagrant') {
4951
try {
5052

5153
stage('Provision') {
54+
// change namespace to prerelease_namespace if in develop-branch
55+
if (gitflow.isPreReleaseBranch()) {
56+
sh "make prerelease_namespace"
57+
}
5258
ecoSystem.provision("/dogu")
5359
}
5460

@@ -61,6 +67,15 @@ node('vagrant') {
6167
ecoSystem.build("/dogu")
6268
}
6369

70+
stage('Trivy scan') {
71+
ecoSystem.copyDoguImageToJenkinsWorker("/dogu")
72+
Trivy trivy = new Trivy(this)
73+
trivy.scanDogu(".", params.TrivySeverityLevels, params.TrivyStrategy)
74+
trivy.saveFormattedTrivyReport(TrivyScanFormat.TABLE)
75+
trivy.saveFormattedTrivyReport(TrivyScanFormat.JSON)
76+
trivy.saveFormattedTrivyReport(TrivyScanFormat.HTML)
77+
}
78+
6479
stage('Prepare integration tests') {
6580
setIntegrationTestKeys(ecoSystem)
6681
}
@@ -118,6 +133,11 @@ node('vagrant') {
118133
stage ('Add Github-Release'){
119134
github.createReleaseWithChangelog(releaseVersion, changelog)
120135
}
136+
} else if (gitflow.isPreReleaseBranch()) {
137+
// push to registry in prerelease_namespace
138+
stage('Push Prerelease Dogu to registry') {
139+
ecoSystem.pushPreRelease("/dogu")
140+
}
121141
}
122142

123143
} finally {

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
MAKEFILES_VERSION=7.8.0
1+
MAKEFILES_VERSION=9.5.3
22

33
.DEFAULT_GOAL:=dogu-release
44

55
include build/make/variables.mk
66
include build/make/self-update.mk
77
include build/make/release.mk
8+
include build/make/prerelease.mk
89
include build/make/version-sha.mk
910

1011
NGINX_VERSION=$(shell grep NGINX_VERSION= Dockerfile | sed 's/.*NGINX_VERSION=\([^ ]*\).*/\1/g')

build/make/bats.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ BATS_SUPPORT=$(BATS_LIBRARY_DIR)/bats-support
99
BATS_FILE=$(BATS_LIBRARY_DIR)/bats-file
1010
BATS_BASE_IMAGE?=bats/bats
1111
BATS_CUSTOM_IMAGE?=cloudogu/bats
12-
BATS_TAG?=1.2.1
12+
BATS_TAG?=1.11.0
1313
BATS_DIR=build/make/bats
1414
BATS_WORKDIR="${WORKDIR}"/"${BATS_DIR}"
1515

build/make/bats/Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
ARG BATS_BASE_IMAGE
22
ARG BATS_TAG
33

4-
FROM ${BATS_BASE_IMAGE}:${BATS_TAG}
4+
FROM ${BATS_BASE_IMAGE:-bats/bats}:${BATS_TAG:-1.11.0}
55

66
# Make bash more findable by scripts and tests
7-
RUN apk add make git bash
7+
RUN apk add make git bash
8+
# suppress git "detected dubious ownership" error/warning for repos which are checked out later
9+
RUN git config --global --add safe.directory /workspace

build/make/build.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
ADDITIONAL_LDFLAGS?=-extldflags -static
44
LDFLAGS?=-ldflags "$(ADDITIONAL_LDFLAGS) -X main.Version=$(VERSION) -X main.CommitID=$(COMMIT_ID)"
55
GOIMAGE?=golang
6-
GOTAG?=1.14.13
6+
GOTAG?=1.23
77
GOOS?=linux
88
GOARCH?=amd64
99
PRE_COMPILE?=

build/make/coder-lib.sh

+182
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
#!/bin/bash
2+
# a collection of helpful functions to update coder workspaces for rapid development
3+
set -e -u -x -o pipefail
4+
5+
function getContainerBin() {
6+
if [ -x "$(command -v podman)" ]; then
7+
echo "podman";
8+
else
9+
echo "docker";
10+
fi
11+
}
12+
13+
function getCoderUser() {
14+
# check if coder is installed, so that there is no problem with build and release targets if this is called before
15+
if [ -x "$(command -v coder)" ]; then
16+
coder users show me -o json | jq -r '.username';
17+
fi
18+
}
19+
20+
function getAllWorkspaces() {
21+
coder list -c workspace | tail -n+2
22+
}
23+
24+
function doesWorkspaceExist() {
25+
coderUser="$1"
26+
workspaceName="$2"
27+
28+
workspace=$(coder list -a -o json | jq -r "select(.[].owner_name == \"${coderUser}\" and .[].name == \"${workspaceName}\") | .[0].name")
29+
if [ -z "$workspace" ]; then
30+
return 1 #workspace does not exist
31+
else
32+
return 0
33+
fi
34+
}
35+
36+
function generateUniqueWorkspaceName() {
37+
local wantedWorkspacePrefix="$1"
38+
# use time to make name unique
39+
local time
40+
time=$(date +'%H-%M-%S')
41+
local lengthOfTime=${#time}
42+
local delimiter='-'
43+
local lengthOfDelimiter=${#delimiter}
44+
# trim prefix, as workspace names are limited to 32 chars
45+
local trimmedPrefix="${wantedWorkspacePrefix:0:$((32 - lengthOfDelimiter - lengthOfTime))}"
46+
local uniqueName="${trimmedPrefix}${delimiter}${time}"
47+
# '--' is forbidden in coder, replace multiple '-' with a single one.
48+
echo "${uniqueName}" | awk '{gsub(/[-]+/,"-")}1'
49+
# returns sth like 'myPrefix-12-45-23'
50+
}
51+
52+
function buildImage() {
53+
local tag="$1"
54+
local containerBuildDir="${2:-./container}"
55+
local secretDir="${3:-./secrets}"
56+
local containerExec="${4:-podman}"
57+
58+
# include build-secrets if there are any
59+
local secretArgs=()
60+
if [ -d "$secretDir" ]; then
61+
# shellcheck disable=SC2231
62+
for secretPath in $secretDir/*; do
63+
# do not match .sh scripts
64+
[[ $secretPath == *.sh ]] && continue
65+
local secretName
66+
secretName=$(basename "$secretPath")
67+
secretArgs+=("--secret=id=$secretName,src=$secretDir/$secretName")
68+
done
69+
fi
70+
71+
if [ "$containerExec" = "podman" ]; then
72+
$containerExec build -t "$tag" --pull=newer "$containerBuildDir" "${secretArgs[@]}"
73+
else
74+
$containerExec build -t "$tag" --pull "$containerBuildDir" "${secretArgs[@]}"
75+
fi
76+
}
77+
78+
function doTrivyConvert() {
79+
local trivyFlags=$1
80+
local outputFile=$2
81+
local containerExec=$3
82+
local jsonScanToConvert=$4
83+
84+
local containerJsonScanFile="/tmp/scan.json"
85+
86+
# shellcheck disable=SC2086
87+
# as globbing is what we want here
88+
"$containerExec" run --rm --pull=always \
89+
-v trivy-cache:/root/.cache \
90+
-v "$jsonScanToConvert:$containerJsonScanFile" \
91+
aquasec/trivy -q \
92+
convert $trivyFlags "$containerJsonScanFile" > "$outputFile"
93+
}
94+
95+
function uploadTemplate() {
96+
local templateDir="${1:?"Error. you need to add the template directory as the first parameter"}"
97+
local templateName="${2:?"Error. you need to add the template name as the second parameter"}"
98+
# for terraform variables (not editable by workspace users)
99+
local variablesFile="${templateDir}/variables.yaml"
100+
if [ -f "$variablesFile" ]; then
101+
local doesVariablesFileExist=1
102+
fi
103+
if ! coder template push -y -d "$templateDir" ${doesVariablesFileExist:+--variables-file "$variablesFile"} "$templateName"; then
104+
# if template does not exist yet, create it in coder
105+
coder template create -y -d "$templateDir" ${doesVariablesFileExist:+--variables-file "$variablesFile"} "$templateName"
106+
fi
107+
}
108+
109+
function createNewWorkspace() {
110+
local templateName="$1"
111+
local workspaceName="$2"
112+
# 3. param is optional, set it to autofill prompts for coder params
113+
local templateDir="${3-unset}"
114+
local richParametersFile="${templateDir}/rich-parameters.yaml"
115+
if [ -n "${templateDir+x}" ] && [ -f "$richParametersFile" ]; then
116+
local doesRichParametersFileExist=1
117+
fi
118+
coder create -t "$templateName" -y "$workspaceName" ${doesRichParametersFileExist:+--rich-parameter-file "$richParametersFile"}
119+
}
120+
121+
function removeAllOtherWorkspaces() {
122+
local CODER_USER="$1"
123+
local WORKSPACE_PREFIX="$2"
124+
local IGNORED_WORKSPACE="$3"
125+
WORKSPACES="$(getAllWorkspaces)"
126+
for ws in $WORKSPACES; do
127+
if [ "$ws" != "$CODER_USER/$IGNORED_WORKSPACE" ] && [[ "$ws" =~ ^"$CODER_USER/$WORKSPACE_PREFIX" ]]; then
128+
echo "delete $ws"
129+
if ! coder delete "$ws" -y; then
130+
#do it twice as podman always throws an error at the first time
131+
coder delete "$ws" -y
132+
fi
133+
fi
134+
done
135+
}
136+
137+
function updateWorkspace() {
138+
local coderUser="$1"
139+
local workspaceName="$2"
140+
local qualifiedWorkspaceName="$coderUser/$workspaceName"
141+
if ! coder stop "$qualifiedWorkspaceName" -y; then
142+
#do it twice as podman always throws an error at the first time
143+
coder stop "$qualifiedWorkspaceName" -y
144+
fi
145+
coder update "$qualifiedWorkspaceName"
146+
}
147+
148+
function startTestWorkspace() {
149+
local coderUser="$1"
150+
local templateDir="$2"
151+
local workspacePrefix="$3"
152+
local templateName="$4"
153+
local reuseTestWorkspace="$5"
154+
155+
local newWorkspaceName
156+
if [ "$reuseTestWorkspace" = false ]; then
157+
newWorkspaceName="$(generateUniqueWorkspaceName "$workspacePrefix")"
158+
# do that before deleting others, so that i don't need to wait
159+
createNewWorkspace "$templateName" "$newWorkspaceName" "$templateDir"
160+
# trim prefix as the name of the workspace can also get trimmed
161+
removeAllOtherWorkspaces "$coderUser" "${workspacePrefix:0:22}" "$newWorkspaceName"
162+
else
163+
newWorkspaceName="$workspacePrefix"
164+
if ! doesWorkspaceExist "$coderUser" "$newWorkspaceName"; then
165+
createNewWorkspace "$templateName" "$newWorkspaceName" "$templateDir"
166+
else
167+
updateWorkspace "$coderUser" "$newWorkspaceName"
168+
fi
169+
fi
170+
}
171+
172+
function uploadToNexus() {
173+
local fileToUpload="$1"
174+
local fileNameNexus="${fileToUpload##*/}"
175+
local templateName="$2"
176+
local releaseVersion="$3"
177+
local nexusUrl="${4:-https://ecosystem.cloudogu.com/nexus/repository/itz-bund/coder}"
178+
set +x #disable command printing because of the password
179+
curl --progress-bar -u "$(cat secrets/nexus-user):$(cat secrets/nexus-pw)" --upload-file "$fileToUpload" \
180+
"$nexusUrl/$templateName/$releaseVersion/$fileNameNexus"
181+
set -x
182+
}

0 commit comments

Comments
 (0)