Skip to content
Snippets Groups Projects
Commit f09da8e9 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-1784 jenkins create namespace

parent 28d65b0d
Branches
Tags
No related merge requests found
...@@ -156,20 +156,36 @@ pipeline { ...@@ -156,20 +156,36 @@ pipeline {
script { script {
FAILED_STAGE=env.STAGE_NAME FAILED_STAGE=env.STAGE_NAME
} }
container("k8s") { container("k8s") {
script { script {
def branchName = env.BRANCH_NAME.replaceAll(/[^a-zA-Z0-9]+/, "").toLowerCase() def branchName = env.BRANCH_NAME.replaceAll(/[^a-zA-Z0-9]+/, "").toLowerCase()
def namespace = 'e2e-${branchName}-dev' def namespace = "e2e-${branchName}-dev"
echo ${namespace} println(namespace)
withCredentials([usernamePassword(credentialsId: 'jenkins-nexus-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) { configFileProvider([configFile(fileId: 'jenkins-kuby-kubeconfig', variable: 'KUBE_CONFIG')]) {
sh 'helm upgrade --install --create-namespace goofy goofy --version 0.3.0-SNAPSHOT -f values.yaml --namespace ${namespace} --repo https://nexus.ozg-sh.de/repository/ozg-base-apps-snapshot --username ${USER} --password ${PASSWORD}' sh 'mkdir ~/.kube'
sh 'cp ${KUBE_CONFIG} ~/.kube/config'
sh 'cat ~/.kube/config'
}
sh 'kubectl get nodes'
dir('goofy-client/apps/goofy-e2e/deployment-values/namespace') {
sh 'kubectl apply -f values.yaml'
} }
sh 'kubectl get pods -n ${namespace}'
dir('goofy-client/apps/goofy-e2e/deployment-values/goofy') {
withCredentials([usernamePassword(credentialsId: 'jenkins-nexus-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) {
sh "helm --install goofy goofy --version 0.3.0-SNAPSHOT -f values.yaml --namespace ${namespace}" + ' --repo https://nexus.ozg-sh.de/repository/ozg-base-apps-snapshot --username ${USER} --password ${PASSWORD}'
} }
} }
sh 'kubectl get pods -n ${namespace}'
}
}
// container("cypress") { // container("cypress") {
// dir('goofy-client') { // dir('goofy-client') {
// sh 'npm run cypress:version' // sh 'npm run cypress:version'
...@@ -181,18 +197,6 @@ pipeline { ...@@ -181,18 +197,6 @@ pipeline {
// sh 'helm uninstall ' // sh 'helm uninstall '
// } // }
} }
post {
always {
publishHTML (target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'goofy-client/apps/goofy-e2e/reports',
reportFiles: 'report_einheitlicher-ansprechpartner.html',
reportName: "Goofy E2E-Tests(EA)"
])
}
}
} }
// stage('E2E-Tests') { // stage('E2E-Tests') {
......
apiVersion: v1
kind: Namespace
metadata:
name: e2e-ozg1784-dev
annotations:
field.cattle.io/projectId: 'c-8g78g:p-f7nwp'
labels:
field.cattle.io/projectId: p-f7nwp
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment