Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xta-adapter
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
eingang
xta-adapter
Commits
40e1e4c1
Commit
40e1e4c1
authored
2 years ago
by
OZG-Cloud Team
Browse files
Options
Downloads
Patches
Plain Diff
OZG-3140 run on new jenkins
parent
efa0dddc
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
+26
-34
26 additions, 34 deletions
Jenkinsfile
with
26 additions
and
34 deletions
Jenkinsfile
+
26
−
34
View file @
40e1e4c1
pipeline
{
pipeline
{
agent
{
agent
{
node
{
node
{
label
'jenkins-
worker
'
label
'jenkins-
build-agent
'
}
}
}
}
...
@@ -60,21 +60,19 @@ pipeline {
...
@@ -60,21 +60,19 @@ pipeline {
script
{
script
{
FAILED_STAGE
=
env
.
STAGE_NAME
FAILED_STAGE
=
env
.
STAGE_NAME
}
}
container
(
"maven-17"
){
configFileProvider
([
configFile
(
fileId:
'maven-settings'
,
variable:
'MAVEN_SETTINGS'
)])
{
configFileProvider
([
configFile
(
fileId:
'maven-settings'
,
variable:
'MAVEN_SETTINGS'
)])
{
sh
'mvn --version'
sh
'mvn --version'
sh
'mvn -s $MAVEN_SETTINGS clean install spring-boot:build-image -Dmaven.wagon.http.retryHandler.count=3'
sh
'mvn -s $MAVEN_SETTINGS clean install spring-boot:build-image -Dmaven.wagon.http.retryHandler.count=3'
script
{
script
{
try
{
try
{
if
(
env
.
BRANCH_NAME
==
'master'
)
{
if
(
env
.
BRANCH_NAME
==
'master'
)
{
withSonarQubeEnv
(
'sonarqube-ozg-sh'
){
withSonarQubeEnv
(
'sonarqube-ozg-sh'
){
sh
'mvn -s $MAVEN_SETTINGS sonar:sonar'
sh
'mvn -s $MAVEN_SETTINGS sonar:sonar'
}
}
}
}
catch
(
Exception
e
)
{
}
unstable
(
"SonarQube failed"
)
}
catch
(
Exception
e
)
{
}
unstable
(
"SonarQube failed"
)
}
}
}
}
}
}
...
@@ -97,10 +95,8 @@ pipeline {
...
@@ -97,10 +95,8 @@ pipeline {
script
{
script
{
FAILED_STAGE
=
env
.
STAGE_NAME
FAILED_STAGE
=
env
.
STAGE_NAME
}
}
container
(
'maven-17'
)
{
configFileProvider
([
configFile
(
fileId:
'maven-settings'
,
variable:
'MAVEN_SETTINGS'
)])
{
configFileProvider
([
configFile
(
fileId:
'maven-settings'
,
variable:
'MAVEN_SETTINGS'
)])
{
sh
'mvn -s $MAVEN_SETTINGS -DskipTests deploy'
sh
'mvn -s $MAVEN_SETTINGS -DskipTests deploy'
}
}
}
}
}
}
}
...
@@ -128,20 +124,18 @@ pipeline {
...
@@ -128,20 +124,18 @@ pipeline {
stage
(
'Test, build and deploy Helm Chart'
)
{
stage
(
'Test, build and deploy Helm Chart'
)
{
steps
{
steps
{
container
(
'k8s'
)
{
script
{
script
{
FAILED_STAGE
=
env
.
STAGE_NAME
FAILED_STAGE
=
env
.
STAGE_NAME
HELM_CHART_VERSION
=
generateHelmChartVersion
()
HELM_CHART_VERSION
=
generateHelmChartVersion
()
dir
(
'src/main/helm'
)
{
dir
(
'src/main/helm'
)
{
sh
"helm lint -f test-values.yaml"
sh
"helm lint -f test-values.yaml"
sh
"helm unittest -f '../../test/helm/*.yaml' -v '../../test/unit-values.yaml' ."
sh
"helm unittest -f '../../test/helm/*.yaml' -v '../../test/unit-values.yaml' ."
sh
"helm package --version=${HELM_CHART_VERSION} ."
sh
"helm package --version=${HELM_CHART_VERSION} ."
deployHelmChart
(
HELM_CHART_VERSION
)
deployHelmChart
(
HELM_CHART_VERSION
)
}
}
}
}
}
}
}
...
@@ -293,13 +287,11 @@ Void checkoutProvisioningRepo() {
...
@@ -293,13 +287,11 @@ Void checkoutProvisioningRepo() {
}
}
Void
tagAndPushDockerImage
(
String
imageName
,
String
newTag
){
Void
tagAndPushDockerImage
(
String
imageName
,
String
newTag
){
container
(
"docker"
)
{
withCredentials
([
usernamePassword
(
credentialsId:
'jenkins-docker-login'
,
usernameVariable:
'USER'
,
passwordVariable:
'PASSWORD'
)])
{
withCredentials
([
usernamePassword
(
credentialsId:
'jenkins-docker-login'
,
usernameVariable:
'USER'
,
passwordVariable:
'PASSWORD'
)])
{
sh
'docker login docker.ozg-sh.de -u ${USER} -p ${PASSWORD}'
sh
'docker login docker.ozg-sh.de -u ${USER} -p ${PASSWORD}'
sh
"docker tag docker.ozg-sh.de/${imageName}:build-latest docker.ozg-sh.de/${imageName}:${newTag}"
sh
"docker tag docker.ozg-sh.de/${imageName}:build-latest docker.ozg-sh.de/${imageName}:${newTag}"
sh
"docker push docker.ozg-sh.de/${imageName}:${newTag}"
sh
"docker push docker.ozg-sh.de/${imageName}:${newTag}"
}
}
}
}
}
...
...
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