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
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
3e8ef2ff
Commit
3e8ef2ff
authored
3 years ago
by
OZGCloud
Browse files
Options
Downloads
Patches
Plain Diff
add kc user yaml
parent
f09da8e9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Jenkinsfile
+60
-27
60 additions, 27 deletions
Jenkinsfile
goofy-client/apps/goofy-e2e/deployment-values/goofy/user/user.yaml
+26
-0
26 additions, 0 deletions
...ent/apps/goofy-e2e/deployment-values/goofy/user/user.yaml
with
86 additions
and
27 deletions
Jenkinsfile
+
60
−
27
View file @
3e8ef2ff
...
@@ -148,54 +148,72 @@ pipeline {
...
@@ -148,54 +148,72 @@ pipeline {
// }
// }
// }
// }
stage
(
'E2E-
Tests(EA)
'
)
{
stage
(
'E2E-
EA-kc
'
)
{
when
{
when
{
branch
'ozg-1784'
branch
'ozg-1784'
}
}
steps
{
steps
{
script
{
script
{
FAILED_STAGE
=
env
.
STAGE_NAME
FAILED_STAGE
=
env
.
STAGE_NAME
}
container
(
"k8s"
)
{
script
{
def
branchName
=
env
.
BRANCH_NAME
.
replaceAll
(
/[^a-zA-Z0-9]+/
,
""
).
toLowerCase
()
def
namespace
=
"e2e-${branchName}-dev"
namespace
=
createNamespaceName
(
env
.
STAGE_NAME
)
createKEycloakUser
(
env
.
STAGE_NAME
)
container
(
"k8s"
)
{
println
(
namespace
)
println
(
namespace
)
configFileProvider
([
configFile
(
fileId:
'jenkins-kuby-kubeconfig'
,
variable:
'KUBE_CONFIG'
)])
{
configFileProvider
([
configFile
(
fileId:
'jenkins-kuby-kubeconfig'
,
variable:
'KUBE_CONFIG'
)])
{
sh
'mkdir ~/.kube'
sh
'mkdir ~/.kube'
sh
'cp ${KUBE_CONFIG} ~/.kube/config'
sh
'cp ${KUBE_CONFIG} ~/.kube/config'
sh
'cat ~/.kube/config'
}
}
sh
'helm version'
sh
'kubectl get nodes'
sh
'kubectl get nodes'
dir
(
'goofy-client/apps/goofy-e2e/deployment-values/namespace'
)
{
def
namespaceList
=
sh
(
script:
'kubectl get namespaces'
,
returnStdout:
true
)
sh
'kubectl apply -f values.yaml'
println
(
namespaceList
)
}
sh
'kubectl get pods -n ${namespace}'
if
(
namespaceList
.
contains
(
namespace
))
{
error
(
"Namespace: ${namespace} existiert bereits"
)
}
parallel
(
startGoofy:
{
dir
(
'goofy-client/apps/goofy-e2e/deployment-values/goofy'
)
{
dir
(
'goofy-client/apps/goofy-e2e/deployment-values/goofy'
)
{
withCredentials
([
usernamePassword
(
credentialsId:
'jenkins-nexus-login'
,
usernameVariable:
'USER'
,
passwordVariable:
'PASSWORD'
)])
{
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
"helm
upgrade
--install
--create-namespace goofy goofy
-f values.yaml --namespace ${namespace}"
+
' --repo https://nexus.ozg-sh.de/repository/ozg-base-apps --username ${USER} --password ${PASSWORD}
--wait --wait-for-jobs
'
}
}
}
}
},
sh
'kubectl get pods -n ${namespace}'
startPluto:
{
dir
(
'goofy-client/apps/goofy-e2e/deployment-values/pluto'
)
{
withCredentials
([
usernamePassword
(
credentialsId:
'jenkins-nexus-login'
,
usernameVariable:
'USER'
,
passwordVariable:
'PASSWORD'
)])
{
sh
"helm upgrade --install --create-namespace pluto pluto -f values.yaml --namespace ${namespace}"
+
' --repo https://nexus.ozg-sh.de/repository/ozg-base-apps --username ${USER} --password ${PASSWORD} --wait --wait-for-jobs'
}
}
}
sh
"kubectl rollout status statefulset/pluto-database -n ${namespace}"
}
)
println
(
'running'
)
println
(
'testing'
)
// sh "helm uninstall goofy --namespace ${namespace} --wait"
// sh "helm uninstall pluto --namespace ${namespace} --wait"
// sh "kubectl delete namespace ${namespace}"
}
}
// container("cypress") {
// container("cypress") {
// dir('goofy-client') {
// dir('goofy-client') {
// sh 'npm run cypress:version'
// sh 'npm run cypress:version'
// sh 'npm run cypress:ci-
ea-
run --BASE_URL=https://e2e.dev.ozg-sh.de'//TODO: durch eine dynamische url ersetzen
// sh 'npm run cypress:ci-run --BASE_URL=https://e2e.dev.ozg-sh.de'//TODO: durch eine dynamische url ersetzen
// }
// }
// }
// }
}
// container("k8s"){
// sh 'helm uninstall '
// }
}
}
}
}
...
@@ -314,3 +332,18 @@ pipeline {
...
@@ -314,3 +332,18 @@ pipeline {
// }
// }
// }
// }
}
}
String
createNamespaceName
(
String
stage
)
{
branchName
=
env
.
BRANCH_NAME
.
replaceAll
(
/[^a-zA-Z0-9]+/
,
""
).
toLowerCase
()
stageName
=
stage
.
replaceAll
(
/[^a-zA-Z0-9]+/
,
""
).
toLowerCase
()
return
"e2e-${branchName}${stageName}-dev"
}
Void
createKEycloakUser
(
String
stage
)
{
namespace
=
createNamespaceName
(
stage
)
dir
(
'goofy-client/apps/goofy-e2e/deployment-values/goofy'
)
{
userYaml
=
readYaml
file:
"user.yaml"
println
(
userYaml
)
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
goofy-client/apps/goofy-e2e/deployment-values/goofy/user/user.yaml
0 → 100644
+
26
−
0
View file @
3e8ef2ff
apiVersion
:
keycloak.org/v1alpha1
kind
:
KeycloakUser
metadata
:
name
:
e2e-ozg1784e2eeakc-dev-emil
namespace
:
keycloak
labels
:
realm
:
e2e-ozg1784e2eeakc-dev
spec
:
realmSelector
:
matchLabels
:
realm
:
e2e-ozg1784e2eeakc-dev
user
:
username
:
"
emil"
firstName
:
"
Emil"
lastName
:
"
Ernst"
enabled
:
True
emailVerified
:
False
credentials
:
-
type
:
"
password"
value
:
"
Einfallsreich"
realmRoles
:
-
"
offline_access"
-
"
uma_authorization"
clientRoles
:
e2e-ozg1784e2eeakc-dev
:
-
"
VERWALTUNG_USER"
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