Skip to content

Commit

Permalink
Merge branch 'release/v3.59.0-1'
Browse files Browse the repository at this point in the history
  • Loading branch information
nhinze23 authored and cesmarvin committed Aug 18, 2023
2 parents 785e6bc + e974a1f commit 00b6300
Show file tree
Hide file tree
Showing 21 changed files with 1,285 additions and 3,602 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v3.59.0-1] - 2023-08-18
### Changed
- [#120] Fix integration tests after CAS-Upgrade
- [#122] Upgrade Sonatype Nexus to 3.59.0-01

## [v3.52.0-2] - 2023-06-27
### Added
- [#118] Configuration options for resource requirements
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
FROM registry.cloudogu.com/official/java:8u362-1 as builder
LABEL maintainer="[email protected]" \
NAME="official/nexus" \
VERSION="3.52.0-2"
VERSION="3.59.0-1"

WORKDIR /build

# The version of nexus to install
ENV NEXUS_VERSION=3.52.0-01 \
ENV NEXUS_VERSION=3.59.0-01 \
TINI_VERSION=0.19.0 \
NEXUS_CLAIM_VERSION=1.0.0 \
NEXUS_CARP_VERSION=1.3.1 \
Expand All @@ -16,7 +16,7 @@ ENV NEXUS_VERSION=3.52.0-01 \
NEXUS_BUILD_DIR=/build/opt/sonatype/nexus \
BUILD_BIN_DIR=/build/usr/bin \
SHA256_TINI="c5b0666b4cb676901f90dfcb37106783c5fe2077b04590973b885950611b30ee" \
SHA256_NEXUS_TAR="f87766bb2ed606d5088c4059c8b804ddadfe2ff9403478b2d55441276b3af3a5" \
SHA256_NEXUS_TAR="19bc207fbf05e232d9c521e95cb7253e946a5e56521b828c4252a0b72f7262a8" \
SHA256_NEXUS_CLAIM="a34608ac7b516d6bc91f8a157bea286919c14e5fb5ecc76fc15edccb35adec42" \
SHA256_NEXUS_SCRIPTING="60c7f3d8a0c97b1d90d954ebad9dc07dbeb7927934b618c874b2e72295cafb48" \
SHA256_NEXUS_CARP="f9a9d9f9efcabd27fb4df2544142000d5607c8feb9772e77f23239d7a6647458"
Expand Down
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!groovy
@Library(['github.com/cloudogu/[email protected].0', 'github.com/cloudogu/dogu-build-lib@v2.1.0'])
@Library(['github.com/cloudogu/[email protected].1', 'github.com/cloudogu/dogu-build-lib@v2.2.0'])
import com.cloudogu.ces.cesbuildlib.*
import com.cloudogu.ces.dogubuildlib.*

Expand Down Expand Up @@ -73,7 +73,7 @@ node('vagrant') {
}

stage('Integration Tests') {
ecoSystem.runCypressIntegrationTests([cypressImage : "cypress/included:8.6.0",
ecoSystem.runCypressIntegrationTests([cypressImage : "cypress/included:12.9.0",
enableVideo : params.EnableVideoRecording,
enableScreenshots: params.EnableScreenshotRecording])
}
Expand Down Expand Up @@ -101,7 +101,7 @@ node('vagrant') {

stage('Integration Tests - After Upgrade') {
ecoSystem.runCypressIntegrationTests([
cypressImage : "cypress/included:8.6.0",
cypressImage : "cypress/included:12.9.0",
enableVideo : params.EnableVideoRecording,
enableScreenshots: params.EnableScreenshotRecording
])
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MAKEFILES_VERSION=7.6.0
VERSION=3.52.0-2
MAKEFILES_VERSION=7.10.0
VERSION=3.59.0-1

.DEFAULT_GOAL:=dogu-release

Expand Down
2 changes: 1 addition & 1 deletion build/make/k8s-dogu.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DOGU_JSON_DEV_FILE=${TARGET_DIR}/dogu.json
ARTIFACT_ID=$(shell $(BINARY_YQ) -e ".Name" $(DOGU_JSON_FILE) | sed "s|.*/||g")
# Namespace of the dogu is extracted from the dogu.json
ARTIFACT_NAMESPACE=$(shell $(BINARY_YQ) -e ".Name" $(DOGU_JSON_FILE) | sed "s|/.*||g")
# Namespace of the dogu is extracted from the dogu.json
# Version of the dogu is extracted from the dogu.json
VERSION=$(shell $(BINARY_YQ) -e ".Version" $(DOGU_JSON_FILE))
# Image of the dogu is extracted from the dogu.json
IMAGE=$(shell $(BINARY_YQ) -e ".Image" $(DOGU_JSON_FILE)):$(VERSION)
Expand Down
60 changes: 58 additions & 2 deletions build/make/k8s.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ endif
## Variables

BINARY_YQ = $(UTILITY_BIN_PATH)/yq
BINARY_HELM = $(UTILITY_BIN_PATH)/helm

# The productive tag of the image
IMAGE ?=
Expand All @@ -19,6 +20,8 @@ K3CES_REGISTRY_URL_PREFIX="${K3S_CLUSTER_FQDN}:${K3S_LOCAL_REGISTRY_PORT}"
# the current namespace and the dev image.
K8S_RESOURCE_TEMP_FOLDER ?= $(TARGET_DIR)/make/k8s
K8S_RESOURCE_TEMP_YAML ?= $(K8S_RESOURCE_TEMP_FOLDER)/$(ARTIFACT_ID)_$(VERSION).yaml
K8S_HELM_TARGET ?= $(K8S_RESOURCE_TEMP_FOLDER)/helm
K8S_HELM_RESSOURCES ?= k8s/helm

##@ K8s - Variables

Expand Down Expand Up @@ -75,6 +78,56 @@ k8s-apply: k8s-generate $(K8S_POST_GENERATE_TARGETS) ## Applies all generated K8
@echo "Apply generated K8s resources..."
@kubectl apply -f $(K8S_RESOURCE_TEMP_YAML) --namespace=${NAMESPACE}

##@ K8s - Helm general

${K8S_HELM_RESSOURCES}/Chart.yaml: ${BINARY_HELM} ## Creates the Chart.yaml-template if missing
@echo "Create Chart.yaml..."
@mkdir -p ${K8S_HELM_RESSOURCES}/tmp/
@${BINARY_HELM} create ${K8S_HELM_RESSOURCES}/tmp/${ARTIFACT_ID}
@cp ${K8S_HELM_RESSOURCES}/tmp/${ARTIFACT_ID}/Chart.yaml ${K8S_HELM_RESSOURCES}/
@rm -dr ${K8S_HELM_RESSOURCES}/tmp
@sed -i 's/appVersion: ".*"/appVersion: "0.0.0-replaceme"/' ${K8S_HELM_RESSOURCES}/Chart.yaml
@sed -i 's/version: .*/version: 0.0.0-replaceme/' ${K8S_HELM_RESSOURCES}/Chart.yaml

.PHONY: k8s-helm-delete
k8s-helm-delete: ${BINARY_HELM} ## Uninstalls the current helm chart.
@echo "Uninstall helm chart"
@${BINARY_HELM} uninstall ${ARTIFACT_ID}

.PHONY: k8s-helm-generate-chart
k8s-helm-generate-chart: ${K8S_HELM_RESSOURCES}/Chart.yaml $(K8S_RESOURCE_TEMP_FOLDER) ## Generates the final helm chart.
@echo "Generate helm chart..."
@rm -drf ${K8S_HELM_TARGET} # delete folder, so Chart.yaml is newly created from template
@mkdir -p ${K8S_HELM_TARGET}/templates
@cp $(K8S_RESOURCE_TEMP_YAML) ${K8S_HELM_TARGET}/templates
@cp ${K8S_HELM_RESSOURCES}/Chart.yaml ${K8S_HELM_TARGET}
@sed -i 's/appVersion: "0.0.0-replaceme"/appVersion: "${VERSION}"/' ${K8S_HELM_TARGET}/Chart.yaml
@sed -i 's/version: 0.0.0-replaceme/version: ${VERSION}/' ${K8S_HELM_TARGET}/Chart.yaml

##@ K8s - Helm dev targets

.PHONY: k8s-helm-generate
k8s-helm-generate: k8s-generate k8s-helm-generate-chart ## Generates the final helm chart with dev-urls.

.PHONY: k8s-helm-apply
k8s-helm-apply: ${BINARY_HELM} image-import k8s-helm-generate $(K8S_POST_GENERATE_TARGETS) ## Generates and installs the helm chart.
@echo "Apply generated helm chart"
@${BINARY_HELM} upgrade -i ${ARTIFACT_ID} ${K8S_HELM_TARGET}

.PHONY: k8s-helm-reinstall
k8s-helm-reinstall: k8s-helm-delete k8s-helm-apply ## Uninstalls the current helm chart and reinstalls it.

##@ K8s - Helm release targets

.PHONY: k8s-helm-generate-release
k8s-helm-generate-release: $(K8S_PRE_GENERATE_TARGETS) k8s-helm-generate-chart ## Generates the final helm chart with release urls.
@sed -i "s/'{{ .Namespace }}'/'{{ .Release.Namespace }}'/" ${K8S_HELM_TARGET}/templates/$(ARTIFACT_ID)_$(VERSION).yaml

.PHONY: k8s-helm-package-release
k8s-helm-package-release: ${BINARY_HELM} k8s-helm-generate-release $(K8S_POST_GENERATE_TARGETS) ## Generates and packages the helm chart with release urls.
@echo "Package generated helm chart"
@${BINARY_HELM} package ${K8S_HELM_TARGET} -d ${K8S_HELM_TARGET}

##@ K8s - Docker

.PHONY: docker-build
Expand Down Expand Up @@ -115,5 +168,8 @@ __check_defined = \
$(if $(value $1),, \
$(error Undefined $1$(if $2, ($2))))

${BINARY_YQ}: $(UTILITY_BIN_PATH) ## Download controller-gen locally if necessary.
$(call go-get-tool,$(BINARY_YQ),github.com/mikefarah/yq/[email protected])
${BINARY_YQ}: $(UTILITY_BIN_PATH) ## Download yq locally if necessary.
$(call go-get-tool,$(BINARY_YQ),github.com/mikefarah/yq/[email protected])

${BINARY_HELM}: $(UTILITY_BIN_PATH) ## Download helm locally if necessary.
$(call go-get-tool,$(BINARY_HELM),helm.sh/helm/v3/cmd/helm@latest)
2 changes: 1 addition & 1 deletion dogu.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Name": "official/nexus",
"Version": "3.52.0-2",
"Version": "3.59.0-1",
"DisplayName": "Sonatype Nexus",
"Description": "The Nexus Repository is like the local warehouse where all of the parts and finished goods used in your software supply chain are stored and distributed.",
"Url": "http://www.sonatype.org/nexus",
Expand Down
3 changes: 3 additions & 0 deletions integrationTests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
cypress/videos
cypress/screenshots
37 changes: 37 additions & 0 deletions integrationTests/cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const doguTestLibrary = require('@cloudogu/dogu-integration-test-library');
const { defineConfig } = require('cypress');
const createBundler = require("@bahmutov/cypress-esbuild-preprocessor");
const preprocessor = require("@badeball/cypress-cucumber-preprocessor");
const createEsbuildPlugin = require("@badeball/cypress-cucumber-preprocessor/esbuild");

async function setupNodeEvents(on, config) {
// This is required for the preprocessor to be able to generate JSON reports after each run, and more,
await preprocessor.addCucumberPreprocessorPlugin(on, config);

on(
"file:preprocessor",
createBundler({
plugins: [createEsbuildPlugin.default(config)],
})
);

config = doguTestLibrary.configure(config);

return config;
}

module.exports = defineConfig({
e2e: {
baseUrl: 'https://192.168.56.2',
env: {
"DoguName": "nexus",
"MaxLoginRetries": 3,
"AdminUsername": "ces-admin",
"AdminPassword": "ecosystem2016",
"AdminGroup": "CesAdministrators"
},
videoCompression: false,
specPattern: ["cypress/e2e/**/*.feature"],
setupNodeEvents,
},
});
12 changes: 0 additions & 12 deletions integrationTests/cypress.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@ Feature: Browser-based CAS login and logout functionality
Scenario: logged out user can log in to the dogu
Given the user is logged out of the CES
When the user opens the dogu start page
And the user types in correct login credentials
And the user clicks the login button
And the test user logs in with correct credentials
Then the user is logged in to the dogu

@requires_testuser
Scenario: logged out user can not log in to the dogu with wrong credentials
Given the user is logged out of the CES
When the user opens the dogu start page
And the user types in wrong login credentials
And the user clicks the login button
And the user logs in with wrong credentials
Then the login page informs the user about invalid credentials

@requires_testuser
Expand Down
11 changes: 0 additions & 11 deletions integrationTests/cypress/plugins/index.js

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
const {
When,
Then
} = require("@badeball/cypress-cucumber-preprocessor");

// Loads all steps from the dogu integration library into this project
const doguTestLibrary = require('@cloudogu/dogu-integration-test-library')
doguTestLibrary.registerSteps()
const doguTestLibrary = require('@cloudogu/dogu-integration-test-library');
doguTestLibrary.registerSteps();

When(/^the user clicks the dogu logout button$/, function () {
Cypress.on('uncaught:exception', () => { return false; }); // Catch nexus errors and prevent test from failing
Expand Down
46 changes: 0 additions & 46 deletions integrationTests/cypress/support/step_definitions/nexus_gui.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
const {
Given,
When,
Then
} = require("cypress-cucumber-preprocessor/steps");
const env = require('@cloudogu/dogu-integration-test-library/lib/environment_variables');
} = require("@badeball/cypress-cucumber-preprocessor");

//
//
// Then
//
//

Then(/^the user can see administration icon$/, function () {
cy.get('#button-1125-btnIconEl').should('be.visible')
});

Then(/^the user cannot see administration icon$/, function () {
cy.get('#button-1125-btnIconEl').should('not.be.visible')
});

Then(/^the user can access scripts api$/, function () {
cy.fixture("testuser_data").then(function (testUser) {
Expand Down
9 changes: 9 additions & 0 deletions integrationTests/cypress/support/step_definitions/when.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const {
When
} = require("@badeball/cypress-cucumber-preprocessor");


When(/^the user clicks the logout button$/, function () {
cy.get('#nx-header-signout-1144-btnEl').click();
});

10 changes: 6 additions & 4 deletions integrationTests/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"dependencies": {
"cypress": "8.6.0",
"cypress-cucumber-preprocessor": "4.1.0",
"@cloudogu/dogu-integration-test-library": "1.0.0"
"@badeball/cypress-cucumber-preprocessor": "^16.0.0",
"@bahmutov/cypress-esbuild-preprocessor": "^2.2.0",
"@cloudogu/dogu-integration-test-library": "6.0.1",
"cypress": "^12.9.0",
"@bahmutov/cy-api": "^2.2.4"
},
"scripts": {
"updateTests": "mkdir -p cypress/integration/dogu_integration_test_lib && cp -r node_modules/@cloudogu/dogu-integration-test-library/lib/integration/* cypress/integration/dogu_integration_test_lib"
"updateTests": "mkdir -p cypress/e2e/dogu_integration_test_lib && cp -r node_modules/@cloudogu/dogu-integration-test-library/lib/integration/* cypress/e2e/dogu_integration_test_lib"
}
}
Loading

0 comments on commit 00b6300

Please sign in to comment.