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
6c7376fa
Commit
6c7376fa
authored
5 months ago
by
Martin
Browse files
Options
Downloads
Patches
Plain Diff
OZG-7121 adjust Service port name
parent
5d5d2638
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"
Checking pipeline status
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Jenkinsfile
+11
-8
11 additions, 8 deletions
Jenkinsfile
src/main/helm/templates/service.yaml
+1
-1
1 addition, 1 deletion
src/main/helm/templates/service.yaml
src/test/helm/service_test.yaml
+1
-1
1 addition, 1 deletion
src/test/helm/service_test.yaml
with
13 additions
and
10 deletions
Jenkinsfile
+
11
−
8
View file @
6c7376fa
...
@@ -256,19 +256,21 @@ String getElementAccessToken() {
...
@@ -256,19 +256,21 @@ String getElementAccessToken() {
Void
deployHelmChart
(
String
helmChartVersion
)
{
Void
deployHelmChart
(
String
helmChartVersion
)
{
withCredentials
([
usernamePassword
(
credentialsId:
'jenkins-nexus-login'
,
usernameVariable:
'USERNAME'
,
passwordVariable:
'PASSWORD'
)]){
withCredentials
([
usernamePassword
(
credentialsId:
'jenkins-nexus-login'
,
usernameVariable:
'USERNAME'
,
passwordVariable:
'PASSWORD'
)]){
if
(
env
.
BRANCH_NAME
==
'release'
)
{
result
=
sh
script:
'''curl -u $USERNAME:$PASSWORD https://nexus.ozg-sh.de/service/rest/v1/components?repository='''
+
getHelmChartRepository
()
+
''' -F file=@xta-test-server-'''
+
helmChartVersion
+
'''.tgz'''
,
returnStdout:
true
result
=
sh
script:
'''curl -u $USERNAME:$PASSWORD https://nexus.ozg-sh.de/service/rest/v1/components?repository=ozg-base-apps -F file=@xta-test-server-'''
+
helmChartVersion
+
'''.tgz'''
,
returnStdout:
true
}
else
{
result
=
sh
script:
'''curl -u $USERNAME:$PASSWORD https://nexus.ozg-sh.de/service/rest/v1/components?repository=ozg-base-apps-snapshot -F file=@xta-test-server-'''
+
helmChartVersion
+
'''.tgz'''
,
returnStdout:
true
}
if
(
result
!=
''
)
{
if
(
result
!=
''
)
{
error
(
result
)
error
(
result
)
}
}
}
}
}
}
String
getHelmChartRepository
(){
if
(
env
.
BRANCH_NAME
==
'release'
)
{
return
'ozg-base-apps'
}
return
'ozg-base-apps-snapshot'
}
}
Void
loginToDockerRepo
()
{
Void
loginToDockerRepo
()
{
withCredentials
([
usernamePassword
(
credentialsId:
'jenkins-nexus-login'
,
usernameVariable:
'USER'
,
passwordVariable:
'PASSWORD'
)])
{
withCredentials
([
usernamePassword
(
credentialsId:
'jenkins-nexus-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}'
...
@@ -286,11 +288,12 @@ String buildVersionName() {
...
@@ -286,11 +288,12 @@ String buildVersionName() {
Void
tagAndPushDockerImage
(
String
newTag
){
Void
tagAndPushDockerImage
(
String
newTag
){
withCredentials
([
usernamePassword
(
credentialsId:
'jenkins-nexus-login'
,
usernameVariable:
'USER'
,
passwordVariable:
'PASSWORD'
)])
{
withCredentials
([
usernamePassword
(
credentialsId:
'jenkins-nexus-login'
,
usernameVariable:
'USER'
,
passwordVariable:
'PASSWORD'
)])
{
sh
"chmod +x script/push-docker-image.sh"
sh
"""
sh
"""
export DOCKER_USER=${USER}
export DOCKER_USER=${USER}
export DOCKER_PASSWORD=${PASSWORD}
export DOCKER_PASSWORD=${PASSWORD}
export BRANCH_NAME=${env.BRANCH_NAME}
export BRANCH_NAME=${env.BRANCH_NAME}
./
tag_and_
push
_
docker
_
image.sh ${newTag} ${getPomVersion()}
./
script/
push
-
docker
-
image.sh ${newTag} ${getPomVersion()}
"""
"""
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/helm/templates/service.yaml
+
1
−
1
View file @
6c7376fa
...
@@ -35,7 +35,7 @@ spec:
...
@@ -35,7 +35,7 @@ spec:
-
name
:
8080tcp1
-
name
:
8080tcp1
port
:
8080
port
:
8080
protocol
:
TCP
protocol
:
TCP
-
name
:
8
080
tcp1
-
name
:
8
443
tcp1
port
:
8443
port
:
8443
protocol
:
TCP
protocol
:
TCP
-
name
:
metrics
-
name
:
metrics
...
...
This diff is collapsed.
Click to expand it.
src/test/helm/service_test.yaml
+
1
−
1
View file @
6c7376fa
...
@@ -55,7 +55,7 @@ tests:
...
@@ -55,7 +55,7 @@ tests:
-
contains
:
-
contains
:
path
:
spec.ports
path
:
spec.ports
content
:
content
:
name
:
8
080
tcp1
name
:
8
443
tcp1
port
:
8443
port
:
8443
protocol
:
TCP
protocol
:
TCP
...
...
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