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
1782f186
Commit
1782f186
authored
2 years ago
by
OZGCloud
Browse files
Options
Downloads
Patches
Plain Diff
OZG-3184 e2e on new cluster
parent
7c892b20
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Jenkinsfile
+18
-5
18 additions, 5 deletions
Jenkinsfile
with
18 additions
and
5 deletions
Jenkinsfile
+
18
−
5
View file @
1782f186
...
...
@@ -10,7 +10,8 @@ pipeline {
RELEASE_REGEX
=
/\d+.\d+.\d+/
SNAPSHOT_REGEX
=
/\d+.\d+.\d+-SNAPSHOT/
BUNDESLAND
=
"by"
CLUSTER_BASE_URL
=
"dev.by.kop-cloud.de"
SSO_URL
=
"sso.dev.by.kop-cloud.de"
CLUSTER_BASE_URL
=
"apps01.dev.by.kop-cloud.de"
FAILED_STAGE
=
""
IMAGE_TAG
=
""
VERSION
=
""
...
...
@@ -409,6 +410,7 @@ Void setupAnsible(String imageTag, String stage, Boolean isEa, String chartVersi
copyTestEnvironmentToDev
(
stage
)
}
editProvisioningBundesland
(
stage
)
editEnvironemntVersion
(
stage
,
imageTag
,
isEa
,
chartVersion
)
if
(
isEa
)
{
...
...
@@ -473,6 +475,17 @@ Void editEnvironemntVersion(String stage, String imageTag, Boolean isEa, String
}
}
Void
editProvisioningBundesland
(
String
stage
)
{
dir
(
"${stage}/provisioning"
)
{
def
editEnvFile
=
"inventories/group_vars/all/env"
def
envVersions
=
readYaml
file:
editEnvFile
envVersions
.
kop_bundesland
=
env
.
BUNDESLAND
writeYaml
file:
editEnvFile
,
data:
envVersions
,
overwrite:
true
}
}
String
getSpringProfile
(
Boolean
isEa
)
{
if
(
isEa
)
{
return
"oc,ea,e2e,dev"
...
...
@@ -601,7 +614,7 @@ Void publishE2ETestResult(String reportFolder, String reportName) {
}
String
runTests
(
String
stageName
,
String
bezeichner
,
String
reportFolder
,
Integer
dbPort
)
{
def
configFile
=
generateCypressConfig
(
stageName
,
bezeichner
,
reportFolder
,
env
.
BUNDESLAND
,
dbPort
)
def
configFile
=
generateCypressConfig
(
stageName
,
bezeichner
,
reportFolder
,
dbPort
)
try
{
dir
(
"goofy-client"
)
{
...
...
@@ -650,6 +663,7 @@ String generateCypressConfig(String stage, String bezeichner, String testFolder,
config
.
baseUrl
=
"https://${bezeichner}.${env.CLUSTER_BASE_URL}"
as
String
config
.
env
.
dbUrl
=
"mongodb://pluto-database-user:XnHhfznNWg65NNd@localhost:${dbPort}/admin?ssl=false&directConnection=true"
as
String
config
.
env
.
keycloakUrl
=
"https://${env.SSO_URL}/"
as
String
config
.
env
.
keycloakRealm
=
namespace
as
String
config
.
env
.
keycloakClient
=
namespace
+
"-goofy"
as
String
config
.
env
.
sabineUuid
=
getKeycloakUuid
(
namespace
,
"sabine"
)
as
String
...
...
@@ -689,7 +703,7 @@ def getSecrect(namespace, secretName){
String
getKeycloakUuid
(
realm
,
userName
)
{
def
shScript
=
"""curl -H 'Content-Type: application/json' \
-H 'Authorization: bearer ${getKeycloakAccessToken()}' \
'https://
sso.
${env.
CLUSTER_BASE
_URL}/admin/realms/${realm}/users'
'https://${env.
SSO
_URL}/admin/realms/${realm}/users'
"""
def
users
=
readJSON
text:
sh
(
script:
shScript
,
returnStdout:
true
)
...
...
@@ -703,8 +717,7 @@ String getKeycloakUuid(realm, userName) {
String
getKeycloakAccessToken
()
{
withCredentials
([
usernamePassword
(
credentialsId:
'keycloak-dev-cluster'
,
usernameVariable:
'USER'
,
passwordVariable:
'PASSWORD'
)])
{
def
ssoURL
=
"https://sso.${env.CLUSTER_BASE_URL}/realms/master/protocol/openid-connect/token"
def
token
=
readJSON
text:
sh
(
script:
'curl -d "client_id=admin-cli" -d "username=$USER" -d "password=$PASSWORD" -d "grant_type=password" $ssoUrl'
,
returnStdout:
true
)
def
token
=
readJSON
text:
sh
(
script:
'curl -d "client_id=admin-cli" -d "username=$USER" -d "password=$PASSWORD" -d "grant_type=password" https://$SSO_URL/realms/master/protocol/openid-connect/token'
,
returnStdout:
true
)
return
token
.
access_token
}
...
...
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