Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aggregation-manager
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
aggregation-manager
Commits
c54aeb6e
Commit
c54aeb6e
authored
2 months ago
by
Felix Reichenbach
Browse files
Options
Downloads
Patches
Plain Diff
OZG-7906 build server image and helm chart in Jenkinsfile
parent
807a0bfd
No related branches found
No related tags found
1 merge request
!15
Ozg 7906 aggregation manager server
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Jenkinsfile
+50
-11
50 additions, 11 deletions
Jenkinsfile
with
50 additions
and
11 deletions
Jenkinsfile
+
50
−
11
View file @
c54aeb6e
...
...
@@ -49,10 +49,14 @@ pipeline {
script
{
FAILED_STAGE
=
env
.
STAGE_NAME
def
rootVersion
=
getPomVersion
(
'pom.xml'
)
def
jobVersion
=
getPomVersion
(
'pom.xml'
)
def
jobVersion
=
getPomVersion
(
'aggregation-manager-job/pom.xml'
)
def
jobVersion
=
getPomVersion
(
'aggregation-manager-server/pom.xml'
)
if
(
rootVersion
!=
jobVersion
)
{
error
(
"Version in aggregation-manager-job stimmt nicht mit parent überein."
)
error
(
"Version in aggregation-manager-job stimmt nicht mit dem parent überein."
)
}
if
(
rootVersion
!=
serverVersion
)
{
error
(
"Version in aggregation-manager-server stimmt nicht mit dem parent überein."
)
}
if
(
isReleaseBranch
()){
if
(
!(
rootVersion
==~
RELEASE_REGEX
))
{
...
...
@@ -110,7 +114,7 @@ pipeline {
}
}
}
stage
(
'Build Docker image'
)
{
stage
(
'Build Docker image
s
'
)
{
steps
{
script
{
FAILED_STAGE
=
env
.
STAGE_NAME
...
...
@@ -121,26 +125,29 @@ pipeline {
}
}
stage
(
'Tag and Push Docker image'
)
{
stage
(
'Tag and Push Docker image
s
'
)
{
steps
{
script
{
FAILED_STAGE
=
env
.
STAGE_NAME
IMAGE_TAG
=
buildVersionName
()
tagAndPushDockerImage
(
'aggregation-manager-job'
,
IMAGE_TAG
)
tagAndPushDockerImage
(
'aggregation-manager-server'
,
IMAGE_TAG
)
if
(
env
.
BRANCH_NAME
==
'main'
)
{
tagAndPushDockerImage
(
'aggregation-manager-job'
,
'snapshot-latest'
)
tagAndPushDockerImage
(
'aggregation-manager-server'
,
'snapshot-latest'
)
}
else
if
(
env
.
BRANCH_NAME
==
'release'
)
{
tagAndPushDockerImage
(
'aggregation-manager-job'
,
'latest'
)
tagAndPushDockerImage
(
'aggregation-manager-server'
,
'latest'
)
}
}
}
}
stage
(
'Test, build and deploy Helm Chart'
)
{
stage
(
'Test, build and deploy Helm Chart
for Aggregation Job
'
)
{
steps
{
script
{
FAILED_STAGE
=
env
.
STAGE_NAME
...
...
@@ -157,6 +164,23 @@ pipeline {
}
}
stage
(
'Test, build and deploy Helm Chart for Aggregation Server'
)
{
steps
{
script
{
FAILED_STAGE
=
env
.
STAGE_NAME
HELM_CHART_VERSION
=
buildVersionName
()
sh
"./run_helm_test_aggregation_server.sh"
dir
(
'aggregation-manager-server/src/main/helm'
)
{
sh
"helm package --version=${HELM_CHART_VERSION} ."
deployHelmChart
(
'aggregation-manager-server'
,
HELM_CHART_VERSION
)
}
}
}
}
stage
(
'Trigger Dev rollout'
)
{
when
{
...
...
@@ -343,21 +367,36 @@ Void cloneGitopsRepo() {
}
Void
setNewDevAggregationManagerVersion
()
{
setNewAggregationManagerGitopsVersion
(
"dev"
)
setNewAggregationManagerJobGitopsVersion
(
"dev"
)
setNewAggregationManagerServerGitopsVersion
(
"dev"
)
}
Void
setNewTestAggregationManagerVersion
()
{
setNewAggregationManagerGitopsVersion
(
"test"
)
setNewAggregationManagerJobGitopsVersion
(
"test"
)
setNewAggregationManagerServerGitopsVersion
(
"test"
)
}
Void
setNewAggregationManagerJobGitopsVersion
(
String
environment
)
{
dir
(
"gitops"
)
{
def
envFile
=
"${environment}/application/values/aggregation-manager-job-values.yaml"
def
envVersions
=
readYaml
file:
envFile
envVersions
.
aggregation_manager_job
.
image
.
tag
=
IMAGE_TAG
envVersions
.
aggregation_manager_job
.
helm
.
version
=
HELM_CHART_VERSION
writeYaml
file:
envFile
,
data:
envVersions
,
overwrite:
true
}
}
Void
setNewAggregationManagerGitopsVersion
(
String
environment
)
{
Void
setNewAggregationManager
Server
GitopsVersion
(
String
environment
)
{
dir
(
"gitops"
)
{
def
envFile
=
"${environment}/application/values/aggregation-manager-values.yaml"
def
envFile
=
"${environment}/application/values/aggregation-manager-
server-
values.yaml"
def
envVersions
=
readYaml
file:
envFile
envVersions
.
aggregation_manager
.
image
.
tag
=
IMAGE_TAG
envVersions
.
aggregation_manager
.
helm
.
version
=
HELM_CHART_VERSION
envVersions
.
aggregation_manager
_server
.
image
.
tag
=
IMAGE_TAG
envVersions
.
aggregation_manager
_server
.
helm
.
version
=
HELM_CHART_VERSION
writeYaml
file:
envFile
,
data:
envVersions
,
overwrite:
true
}
...
...
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