Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
alfa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OZG-Cloud
app
alfa
Commits
eb013283
Commit
eb013283
authored
1 year ago
by
OZGCloud
Browse files
Options
Downloads
Patches
Plain Diff
adjust e2e static pipeline
parent
3d5800b1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
goofy-client/apps/goofy-e2e/Jenkinsfile-static
+78
-84
78 additions, 84 deletions
goofy-client/apps/goofy-e2e/Jenkinsfile-static
with
78 additions
and
84 deletions
goofy-client/apps/goofy-e2e/Jenkinsfile-static
+
78
−
84
View file @
eb013283
...
@@ -9,20 +9,20 @@ def EXECUTE_MAIN = false;
...
@@ -9,20 +9,20 @@ def EXECUTE_MAIN = false;
pipeline {
pipeline {
agent {
agent {
node {
node {
label 'jenkins-build-agent-nodejs-1
6
'
label 'jenkins-build-agent-nodejs-1
8
'
}
}
}
}
environment {
environment {
BLUE_OCEAN_URL = "https://jenkins.ozg-sh.de/job/E2E%20Tests/job/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/"
BLUE_OCEAN_URL = "https://jenkins.ozg-sh.de/job/E2E%20Tests/job/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/"
BUNDESLAND =
"
by
"
BUNDESLAND =
'
by
'
ENVIRONMENT =
"
dev
"
ENVIRONMENT =
'
dev
'
SSO_URL =
"
sso.dev.by.ozg-cloud.de
"
SSO_URL =
'
sso.dev.by.ozg-cloud.de
'
CLUSTER_BASE_URL =
"
dev.by.ozg-cloud.de
"
CLUSTER_BASE_URL =
'
dev.by.ozg-cloud.de
'
FAILED_STAGE =
""
FAILED_STAGE =
''
FAILED_PARALLEL_STAGE =
" "
FAILED_PARALLEL_STAGE =
' '
EA_BEZEICHNER =
"
e2e-ea
"
EA_BEZEICHNER =
'
e2e-ea
'
MAIN_BEZEICHNER =
"
e2e-main
"
MAIN_BEZEICHNER =
'
e2e-main
'
SH_SUCCESS_STATUS_CODE = 0
SH_SUCCESS_STATUS_CODE = 0
}
}
...
@@ -30,7 +30,7 @@ pipeline {
...
@@ -30,7 +30,7 @@ pipeline {
options {
options {
timeout(time: 2, unit: 'HOURS')
timeout(time: 2, unit: 'HOURS')
disableConcurrentBuilds()
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '
5
'))
buildDiscarder(logRotator(numToKeepStr: '
10
'))
skipDefaultCheckout(true)
skipDefaultCheckout(true)
}
}
...
@@ -62,7 +62,7 @@ pipeline {
...
@@ -62,7 +62,7 @@ pipeline {
}
}
}
}
}
}
stage(
"
Clone Gitops Repo
"
) {
stage(
'
Clone Gitops Repo
'
) {
when {
when {
expression { !SKIP_RUN }
expression { !SKIP_RUN }
}
}
...
@@ -75,8 +75,7 @@ pipeline {
...
@@ -75,8 +75,7 @@ pipeline {
}
}
}
}
stage('Update Alfa?') {
stage("Update Namespaces?(Alfa)") {
when {
when {
expression { !SKIP_RUN }
expression { !SKIP_RUN }
beforeInput true
beforeInput true
...
@@ -88,7 +87,7 @@ pipeline {
...
@@ -88,7 +87,7 @@ pipeline {
catchError {
catchError {
timeout(time: 5, unit: 'MINUTES') {
timeout(time: 5, unit: 'MINUTES') {
userInput = input message:
"
Update Namespace?
"
, parameters: [
userInput = input message:
'
Update Namespace?
'
, parameters: [
booleanParam(name: 'UpdateNamespaceToCurrentMaster', defaultValue: false)
booleanParam(name: 'UpdateNamespaceToCurrentMaster', defaultValue: false)
]
]
UPDATE_NAMESPACE = userInput;
UPDATE_NAMESPACE = userInput;
...
@@ -99,7 +98,7 @@ pipeline {
...
@@ -99,7 +98,7 @@ pipeline {
}
}
}
}
stage(
"
Do Update Namespaces(
Goofy/
Alfa)
"
) {
stage(
'
Do Update Namespaces(Alfa)
'
) {
when {
when {
expression { !SKIP_RUN && UPDATE_NAMESPACE }
expression { !SKIP_RUN && UPDATE_NAMESPACE }
beforeInput true
beforeInput true
...
@@ -115,7 +114,7 @@ pipeline {
...
@@ -115,7 +114,7 @@ pipeline {
}
}
}
}
stage(
"
Test Execution
"
) {
stage(
'
Test Execution
'
) {
when {
when {
expression { !SKIP_RUN && !UPDATE_NAMESPACE }
expression { !SKIP_RUN && !UPDATE_NAMESPACE }
beforeInput true
beforeInput true
...
@@ -142,7 +141,7 @@ pipeline {
...
@@ -142,7 +141,7 @@ pipeline {
}
}
}
}
stage(
"
Install Cypress
"
) {
stage(
'
Install Cypress
'
) {
when {
when {
expression { !SKIP_RUN && !UPDATE_NAMESPACE && (EXECUTE_EA || EXECUTE_MAIN) }
expression { !SKIP_RUN && !UPDATE_NAMESPACE && (EXECUTE_EA || EXECUTE_MAIN) }
}
}
...
@@ -153,7 +152,7 @@ pipeline {
...
@@ -153,7 +152,7 @@ pipeline {
sh 'npm --version'
sh 'npm --version'
dir('goofy-client') {
dir('goofy-client') {
sh 'echo "registry=https://nexus.ozg-sh.de/repository/npm-proxy" >> ~/.npmrc'
sh 'echo "registry=https://nexus.ozg-sh.de/repository/npm-proxy" >> ~/.npmrc'
sh 'echo "//nexus.ozg-sh.de/:_auth=amVua2luczp
QaihzX0ZNNFU5ZC8
=" >> ~/.npmrc'
sh 'echo "//nexus.ozg-sh.de/:_auth=amVua2luczp
rTSFnNVUhMVQzNDZxWQ=
=" >> ~/.npmrc'
sh 'npm cache verify'
sh 'npm cache verify'
sh 'npm install'
sh 'npm install'
...
@@ -171,7 +170,7 @@ pipeline {
...
@@ -171,7 +170,7 @@ pipeline {
script {
script {
FAILED_STAGE = env.STAGE_NAME
FAILED_STAGE = env.STAGE_NAME
configFileProvider([configFile(fileId: 'kubeconfig-
ovh
-cluster', variable: 'KUBE_CONFIG')]) {
configFileProvider([configFile(fileId: 'kubeconfig-
dev-okd
-cluster', variable: 'KUBE_CONFIG')]) {
sh 'mkdir ~/.kube'
sh 'mkdir ~/.kube'
sh 'cp ${KUBE_CONFIG} ~/.kube/config'
sh 'cp ${KUBE_CONFIG} ~/.kube/config'
}
}
...
@@ -181,16 +180,9 @@ pipeline {
...
@@ -181,16 +180,9 @@ pipeline {
}
}
}
}
stage('Run E2E-Tests') {
when {
expression { !SKIP_RUN && !UPDATE_NAMESPACE }
}
failFast false
parallel {
stage('E2E-EA') {
stage('E2E-EA') {
when {
when {
expression { EXECUTE_EA }
expression { EXECUTE_EA
&& (!SKIP_RUN && !UPDATE_NAMESPACE)
}
}
}
steps {
steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
...
@@ -220,7 +212,7 @@ pipeline {
...
@@ -220,7 +212,7 @@ pipeline {
stage('E2E-Main') {
stage('E2E-Main') {
when {
when {
expression { EXECUTE_MAIN }
expression { EXECUTE_MAIN
&& (!SKIP_RUN && !UPDATE_NAMESPACE)
}
}
}
steps {
steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
...
@@ -249,8 +241,6 @@ pipeline {
...
@@ -249,8 +241,6 @@ pipeline {
}
}
}
}
}
}
}
}
def cloneGitopsRepo() {
def cloneGitopsRepo() {
final email = "jenkins@ozg-sh.de"
final email = "jenkins@ozg-sh.de"
...
@@ -267,9 +257,9 @@ def cloneGitopsRepo() {
...
@@ -267,9 +257,9 @@ def cloneGitopsRepo() {
}
}
Void updateGoofyToCurrentMaster() {
Void updateGoofyToCurrentMaster() {
def
goofyV
alues = getApplicationValues('goofy');
def
v
alues = getApplicationValues('goofy');
def imageTag = getImageTag(
goofyV
alues);
def imageTag = getImageTag(
v
alues);
def helmVersion = getHelmVersion(
goofyV
alues);
def helmVersion = getHelmVersion(
v
alues);
def eaNamespace = generateNamespace(EA_BEZEICHNER);
def eaNamespace = generateNamespace(EA_BEZEICHNER);
updateNamespaceYaml(eaNamespace, imageTag, helmVersion);
updateNamespaceYaml(eaNamespace, imageTag, helmVersion);
...
@@ -280,7 +270,7 @@ Void updateGoofyToCurrentMaster() {
...
@@ -280,7 +270,7 @@ Void updateGoofyToCurrentMaster() {
dir("gitops") {
dir("gitops") {
sh "git add dev/namespace/namespaces/${eaNamespace}.yaml";
sh "git add dev/namespace/namespaces/${eaNamespace}.yaml";
sh "git add dev/namespace/namespaces/${mainNamespace}.yaml";
sh "git add dev/namespace/namespaces/${mainNamespace}.yaml";
sh "git commit -m 'update static e2e namespaces(
goofy
to master version)'";
sh "git commit -m 'update static e2e namespaces(
alfa
to master version)'";
}
}
}
}
...
@@ -338,17 +328,17 @@ Void publishE2ETestResult(String reportFolder, String reportName) {
...
@@ -338,17 +328,17 @@ Void publishE2ETestResult(String reportFolder, String reportName) {
}
}
String runTests(String bezeichner, String reportFolder, Integer dbPort, String stageName) {
String runTests(String bezeichner, String reportFolder, Integer dbPort, String stageName) {
def config
File
= generateCypressConfig(bezeichner, reportFolder, dbPort)
def config = generateCypressConfig(bezeichner, reportFolder, dbPort)
try {
try {
dir(
"
goofy-client
"
) {
dir(
'
goofy-client
'
) {
sh "npm run cypress:version"
sh "npm run cypress:version"
sh "
npm run cypress:ci-run --CONFIG_FILE=${configFile} --REPORT_FOLDER=
${reportFolder}"
sh "
apps/goofy-e2e/run-tests.sh
${reportFolder}
${config}
"
}
}
} catch (Exception e) {
} catch (Exception e) {
printNpmDebugLog()
printNpmDebugLog()
error("Fehler in Stage ${stageName}")
error("Fehler in Stage ${stageName}
, Exception: ${e}
")
}
}
}
}
...
@@ -357,7 +347,7 @@ Void printNpmDebugLog() {
...
@@ -357,7 +347,7 @@ Void printNpmDebugLog() {
sh "cat /root/.npm/_logs/*-debug.log"
sh "cat /root/.npm/_logs/*-debug.log"
}
}
else {
else {
echo
"
Npm debug log not found
"
echo
'
Npm debug log not found
'
}
}
}
}
...
@@ -432,6 +422,10 @@ Map getUserManagerDatabaseSecret(String namespace) {
...
@@ -432,6 +422,10 @@ Map getUserManagerDatabaseSecret(String namespace) {
return readJSON ( text: sh (script: "kubectl get secret ozg-mongodb-admin-user-manager-user -n ${namespace} -o jsonpath={.data}", returnStdout: true))
return readJSON ( text: sh (script: "kubectl get secret ozg-mongodb-admin-user-manager-user -n ${namespace} -o jsonpath={.data}", returnStdout: true))
}
}
String makePasswordUrlConform(String password) {
return sh (script: "printf %s ${password} | jq -sRr @uri", returnStdout: true);
}
String getKeycloakUuid(realm, userName) {
String getKeycloakUuid(realm, userName) {
def shScript = """curl -H 'Content-Type: application/json' \
def shScript = """curl -H 'Content-Type: application/json' \
-H 'Authorization: bearer ${getKeycloakAccessToken(realm)}' \
-H 'Authorization: bearer ${getKeycloakAccessToken(realm)}' \
...
@@ -535,7 +529,7 @@ Boolean isElasticSearchForwarded() {
...
@@ -535,7 +529,7 @@ Boolean isElasticSearchForwarded() {
}
}
Void forwardDatenbank(String namespace, port) {
Void forwardDatenbank(String namespace, port) {
sh "kubectl port-forward
pluto-database
-0 ${port}:27017 -n ${namespace} &"
sh "kubectl port-forward
ozg-mongodb
-0 ${port}:27017 -n ${namespace} &"
}
}
String generateNamespace(String bezeichner) {
String generateNamespace(String bezeichner) {
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment