Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xta-test-server
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
lib
xta-test-server
Commits
68e6689d
Commit
68e6689d
authored
6 months ago
by
Zhenzhen Liu
Browse files
Options
Downloads
Patches
Plain Diff
update jenkinsfile
parent
7fa65db0
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!3
Resolve "xta-test-server helm-chart mit Deployment und Keystore-Secrets/Certificate-Resources"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Jenkinsfile
+7
-22
7 additions, 22 deletions
Jenkinsfile
with
7 additions
and
22 deletions
Jenkinsfile
+
7
−
22
View file @
68e6689d
...
...
@@ -97,7 +97,7 @@ pipeline {
steps
{
script
{
FAILED_STAGE
=
env
.
STAGE_NAME
IMAGE_TAG
=
generateImageTag
()
IMAGE_TAG
=
buildVersionName
()
tagAndPushDockerImage
(
IMAGE_TAG
)
...
...
@@ -116,7 +116,7 @@ pipeline {
steps
{
script
{
FAILED_STAGE
=
env
.
STAGE_NAME
HELM_CHART_VERSION
=
generateHelmChart
Version
()
HELM_CHART_VERSION
=
build
Version
Name
()
sh
"./run_helm_test.sh"
...
...
@@ -167,7 +167,7 @@ pipeline {
stage
(
'Deploy SBOM to DependencyTrack'
)
{
steps
{
script
{
IMAGE_TAG
=
"${env.BRANCH_NAME}-${getPom
Version('pom.xml')
}"
IMAGE_TAG
=
build
Version
Name
(
'pom.xml'
)
configFileProvider
([
configFile
(
fileId:
'maven-settings'
,
variable:
'MAVEN_SETTINGS'
)])
{
withCredentials
([
string
(
credentialsId:
'dependency-track-api-key'
,
variable:
'API_KEY'
)])
{
...
...
@@ -276,17 +276,12 @@ Void loginToDockerRepo() {
}
String
generateHelmChartVersion
()
{
def
chartVersion
=
getPomVersion
(
'pom.xml'
)
if
(
env
.
BRANCH_NAME
==
'master'
)
{
chartVersion
+=
"-${env.GIT_COMMIT.take(7)}"
String
buildVersionName
(
String
pomFile
)
{
if
(
isReleaseBranch
())
{
return
getPomVersion
(
pomFile
)
}
else
if
(
env
.
BRANCH_NAME
!=
'release'
)
{
chartVersion
+=
"-${env.BRANCH_NAME}"
}
return
chartVersion
.
replaceAll
(
"_"
,
"-"
)
return
"${getPomVersion(pomFile)}-${env.BRANCH_NAME}-${env.GIT_COMMIT.take(7)}"
.
replaceAll
(
"_"
,
"-"
)
}
Void
tagAndPushDockerImage
(
String
newTag
){
...
...
@@ -298,16 +293,6 @@ Void tagAndPushDockerImage(String newTag){
}
}
String
generateImageTag
()
{
def
imageTag
=
"${env.BRANCH_NAME}-${getPomVersion('pom.xml')}"
if
(
env
.
BRANCH_NAME
==
'master'
)
{
imageTag
+=
"-${env.GIT_COMMIT.take(7)}"
}
return
imageTag
}
Void
configureGit
()
{
final
email
=
"jenkins@ozg-sh.de"
final
name
=
"jenkins"
...
...
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