Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend-clients
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
frontend-clients
Commits
29bc3718
Commit
29bc3718
authored
4 months ago
by
Stefan Hauffe
Browse files
Options
Downloads
Patches
Plain Diff
OZG-7324: Add version checks
parent
52843348
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
alfa-client/apps/admin/Jenkinsfile
+19
-0
19 additions, 0 deletions
alfa-client/apps/admin/Jenkinsfile
alfa-client/apps/info/Jenkinsfile
+29
-0
29 additions, 0 deletions
alfa-client/apps/info/Jenkinsfile
with
48 additions
and
0 deletions
alfa-client/apps/admin/Jenkinsfile
+
19
−
0
View file @
29bc3718
...
...
@@ -315,4 +315,23 @@ String getElementAccessToken() {
withCredentials
([
string
(
credentialsId:
'element-login-json'
,
variable:
'LOGIN_JSON'
)])
{
return
readJSON
(
text:
sh
(
script:
'''curl -XPOST -d \"$LOGIN_JSON\" https://matrix.ozg-sh.de/_matrix/client/v3/login'''
,
returnStdout:
true
)).
access_token
}
}
Boolean
isReleaseVersion
(
List
versions
)
{
return
matchRegexVersion
(
versions
,
RELEASE_REGEX
)
}
Boolean
isSnapshotVersion
(
List
versions
)
{
return
matchRegexVersion
(
versions
,
SNAPSHOT_REGEX
)
}
Boolean
matchRegexVersion
(
List
versions
,
String
regex
)
{
for
(
version
in
versions
)
{
println
version
if
(
!(
version
==~
regex
)
)
{
return
false
}
}
return
true
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
alfa-client/apps/info/Jenkinsfile
+
29
−
0
View file @
29bc3718
...
...
@@ -26,6 +26,16 @@ pipeline {
FAILED_STAGE
=
env
.
STAGE_NAME
dir
(
'alfa-client'
)
{
VERSION
=
getInfoPackageJsonVersion
()
if
(
isReleaseBranch
()){
if
(
!
isReleaseVersion
([
VERSION
])
)
{
error
(
"Keine Release Version für Branch ${env.BRANCH_NAME}."
)
}
}
else
{
if
(
!
isSnapshotVersion
([
VERSION
])
)
{
error
(
"Keine Snapshot Version für Branch ${env.BRANCH_NAME}."
)
}
}
}
}
}
...
...
@@ -294,4 +304,23 @@ String getElementAccessToken() {
withCredentials
([
string
(
credentialsId:
'element-login-json'
,
variable:
'LOGIN_JSON'
)])
{
return
readJSON
(
text:
sh
(
script:
'''curl -XPOST -d \"$LOGIN_JSON\" https://matrix.ozg-sh.de/_matrix/client/v3/login'''
,
returnStdout:
true
)).
access_token
}
}
Boolean
isReleaseVersion
(
List
versions
)
{
return
matchRegexVersion
(
versions
,
RELEASE_REGEX
)
}
Boolean
isSnapshotVersion
(
List
versions
)
{
return
matchRegexVersion
(
versions
,
SNAPSHOT_REGEX
)
}
Boolean
matchRegexVersion
(
List
versions
,
String
regex
)
{
for
(
version
in
versions
)
{
println
version
if
(
!(
version
==~
regex
)
)
{
return
false
}
}
return
true
}
\ No newline at end of file
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