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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OZG-Cloud
app
frontend-clients
Commits
430eaab4
Commit
430eaab4
authored
4 years ago
by
OZGCloud
Browse files
Options
Downloads
Patches
Plain Diff
OZG-533 jenkins on rancher
parent
80353786
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Jenkinsfile
+60
-89
60 additions, 89 deletions
Jenkinsfile
goofy-client/apps/goofy-e2e/cypress-ci.json
+2
-2
2 additions, 2 deletions
goofy-client/apps/goofy-e2e/cypress-ci.json
goofy-client/package.json
+3
-1
3 additions, 1 deletion
goofy-client/package.json
with
65 additions
and
92 deletions
Jenkinsfile
+
60
−
89
View file @
430eaab4
def
FAILED_STAGE
pipeline
{
agent
any
tools
{
maven
'maven3'
jdk
'jdk11'
nodejs
'node14'
agent
{
node
{
label
'jenkins-worker'
}
//{
// node {
// label 'goofy'
//}
//}
environment
{
//BLUE_OCEAN_URL = "https://jenkins-dev-tools.apps.lab.okd.local/blue/organizations/jenkins/OZG%2Fgoofy/detail/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/pipeline"
BLUE_OCEAN_URL
=
"https://jenkins.ozg-sh.de/blue/organizations/jenkins/OZG%2Fgoofy/detail/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/pipeline"
}
options
{
...
...
@@ -27,13 +16,16 @@ pipeline {
stages
{
stage
(
'Client'
)
{
steps
{
//
container("nodejs"){
container
(
"nodejs"
){
script
{
FAILED_STAGE
=
env
.
STAGE_NAME
sh
'npm --version'
dir
(
'goofy-client'
)
{
sh
'npm install'
sh
'echo "registry=http://nexus.ozg-sh.de/repository/npm-proxy" >> ~/.npmrc'
sh
'echo "_auth=amVua2luczpQaihzX0ZNNFU5ZC8=" >> ~/.npmrc'
sh
'npm install --no-optional'
if
(
env
.
BRANCH_NAME
==
'release'
)
{
sh
'npm run ci-prodBuild'
...
...
@@ -43,15 +35,9 @@ pipeline {
}
sh
'npm run ci-test'
if
(
env
.
BRANCH_NAME
==
'master'
)
{
withSonarQubeEnv
(
'sonarqube'
){
sh
'npm run ci-sonar'
}
}
}
}
//gi}
}
post
{
always
{
...
...
@@ -66,19 +52,9 @@ pipeline {
FAILED_STAGE
=
env
.
STAGE_NAME
}
container
(
"maven-11"
){
configFileProvider
([
configFile
(
fileId:
'
9aac2fac-7d8d-4128-846b-0a61951df703
'
,
variable:
'MAVEN_SETTINGS'
)])
{
configFileProvider
([
configFile
(
fileId:
'
maven-settings
'
,
variable:
'MAVEN_SETTINGS'
)])
{
sh
'mvn --version'
sh
'mvn -s $MAVEN_SETTINGS -pl -goofy-client clean install'
script
{
if
(
env
.
BRANCH_NAME
==
'master'
)
{
dir
(
'goofy-server'
){
withSonarQubeEnv
(
'sonarqube'
){
sh
'mvn sonar:sonar'
}
}
}
}
sh
'mvn -s $MAVEN_SETTINGS -pl -goofy-client clean install spring-boot:build-image -Dspring-boot.build-image.imageName=docker.ozg-sh.de/goofy:build-latest'
}
}
}
...
...
@@ -89,32 +65,23 @@ pipeline {
}
}
stage
(
'
Openshift build
'
)
{
stage
(
'
Push Docker image
'
)
{
steps
{
script
{
FAILED_STAGE
=
env
.
STAGE_NAME
def
pom
=
readMavenPom
file:
'pom.xml'
def
version
=
pom
.
version
openshift
.
withCluster
()
{
openshift
.
withProject
()
{
dir
(
'goofy-server'
)
{
openshift
.
startBuild
(
"goofy-builder"
,
"--from-dir=."
,
"--follow"
,
"--wait"
)
}
openshift
.
tag
(
"goofy-builder:build-latest"
,
"goofy-builder:${env.BRANCH_NAME}-${version}"
)
container
(
"docker"
)
{
withCredentials
([
usernamePassword
(
credentialsId:
'jenkins-docker-login'
,
usernameVariable:
'USER'
,
passwordVariable:
'PASSWORD'
)])
{
sh
'docker login docker.ozg-sh.de -u ${USER} -p ${PASSWORD}'
if
(
env
.
BRANCH_NAME
==
'release'
)
{
openshift
.
tag
(
"goofy-builder:${env.BRANCH_NAME}-${version}"
,
"goofy-builder:latest"
)
}
sh
"docker tag docker.ozg-sh.de/goofy:build-latest docker.ozg-sh.de/goofy:${env.BRANCH_NAME}-${version}"
sh
"docker push docker.ozg-sh.de/goofy:${env.BRANCH_NAME}-${version}"
if
(
env
.
BRANCH_NAME
==
'master'
)
{
def
dc
=
openshift
.
selector
(
'dc'
,
'goofy-e2e'
)
openshift
.
tag
(
"goofy-builder:${env.BRANCH_NAME}-${version}"
,
"goofy-builder:snapshot-latest"
)
openshift
.
tag
(
"goofy-builder:${env.BRANCH_NAME}-${version}"
,
"goofy-builder:e2e-latest"
)
dc
.
rollout
().
status
()
sh
'docker tag docker.ozg-sh.de/goofy:build-latest docker.ozg-sh.de/goofy:e2e-test'
sh
'docker push docker.ozg-sh.de/goofy:e2e-test'
}
}
}
...
...
@@ -122,7 +89,7 @@ pipeline {
}
}
stage
(
'E2E-Test'
)
{
stage
(
'E2E-Test
s
'
)
{
when
{
branch
'master'
}
...
...
@@ -130,10 +97,17 @@ pipeline {
script
{
FAILED_STAGE
=
env
.
STAGE_NAME
}
container
(
"kubectl"
)
{
sh
'kubectl rollout restart deployment/goofy -n sh-kiel-e2e'
sh
'kubectl rollout status deployment/goofy -n sh-kiel-e2e'
sh
'kubectl rollout restart deployment/pluto -n sh-kiel-e2e'
sh
'kubectl rollout status deployment/pluto -n sh-kiel-e2e'
}
container
(
"cypress"
)
{
sh
'npm --version'
dir
(
'goofy-client'
)
{
sh
'npm install'
sh
'npm run cypress:version'
sh
'npm run cypress:ci-run'
}
...
...
@@ -153,7 +127,7 @@ pipeline {
}
}
stage
(
'
nexus deploy
'
){
stage
(
'
Deploy Maven Artifacts to Nexus
'
)
{
when
{
anyOf
{
branch
'master'
...
...
@@ -165,55 +139,52 @@ pipeline {
FAILED_STAGE
=
env
.
STAGE_NAME
}
container
(
'maven-11'
)
{
configFileProvider
([
configFile
(
fileId:
'
9aac2fac-7d8d-4128-846b-0a61951df703
'
,
variable:
'MAVEN_SETTINGS'
)])
{
configFileProvider
([
configFile
(
fileId:
'
maven-settings
'
,
variable:
'MAVEN_SETTINGS'
)])
{
sh
'mvn -s $MAVEN_SETTINGS -pl -goofy-client -DskipTests deploy'
}
}
}
}
stage
(
'
Openshift deplo
y'
)
{
stage
(
'
Deploy Goof
y'
)
{
when
{
anyOf
{
branch
'master'
;
branch
'master'
branch
'release'
}
}
steps
{
container
(
"docker"
)
{
script
{
FAILED_STAGE
=
env
.
STAGE_NAME
def
pom
=
readMavenPom
file:
'pom.xml'
def
version
=
pom
.
version
openshift
.
withCluster
()
{
openshift
.
withProject
()
{
openshift
.
tag
(
"goofy-builder:${env.BRANCH_NAME}-${version}"
,
"sh-kiel-dev/goofy:${env.BRANCH_NAME}-${version}"
)
if
(
env
.
BRANCH_NAME
==
'master'
)
{
openshift
.
tag
(
"goofy-builder:snapshot-latest"
,
"sh-kiel-dev/goofy:snapshot-latest"
)
}
withCredentials
([
usernamePassword
(
credentialsId:
'jenkins-docker-login'
,
usernameVariable:
'USER'
,
passwordVariable:
'PASSWORD'
)])
{
sh
'docker login docker.ozg-sh.de -u ${USER} -p ${PASSWORD}'
if
(
env
.
BRANCH_NAME
==
'release'
)
{
openshift
.
tag
(
"
goofy
-
build
er:
latest
"
,
"sh-kiel-
de
v
/goofy:latest
"
)
}
sh
'docker tag docker.ozg-sh.de/
goofy
:
build
-
latest
docker.ozg-sh.
de/goofy:latest
'
sh
'docker push docker.ozg-sh.de/goofy:latest'
}
if
(
env
.
BRANCH_NAME
==
'master'
)
{
openshift
.
withProject
(
'sh-kiel-dev'
)
{
def
dc
=
openshift
.
selector
(
'deployments'
,
'goofy'
)
dc
.
rollout
().
status
()
if
(
env
.
BRANCH_NAME
==
'master'
)
{
sh
'docker tag docker.ozg-sh.de/goofy:build-latest docker.ozg-sh.de/goofy:snapshot-latest'
sh
'docker push docker.ozg-sh.de/goofy:snapshot-latest'
}
}
}
}
container
(
"kubectl"
){
script
{
if
(
env
.
BRANCH_NAME
==
'release'
)
{
sh
'kubectl rollout restart deployment/goofy -n sh-kiel-test'
sh
'kubectl rollout status deployment/goofy -n sh-kiel-test'
}
if
(
env
.
BRANCH_NAME
==
'master'
)
{
sh
'kubectl rollout restart deployment/goofy -n sh-kiel-dev'
sh
'kubectl rollout status deployment/goofy -n sh-kiel-dev'
}
}
post
{
failure
{
script
{
if
(
env
.
BRANCH_NAME
==
'master'
)
{
slackSend
(
color:
"danger"
,
message:
"Goofy: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <${BLUE_OCEAN_URL}|${env.BUILD_NUMBER}>"
)
}
}
}
...
...
This diff is collapsed.
Click to expand it.
goofy-client/apps/goofy-e2e/cypress-ci.json
+
2
−
2
View file @
430eaab4
{
"baseUrl"
:
"http://
goofy-e2e-dev-tools.apps.lab.okd.local/
"
,
"baseUrl"
:
"http
s
://
kiel.e2e.ozg-sh.de
"
,
"env"
:
{
"dbUrl"
:
"e2e-test:
sadf3tr%2Cmb4%25.
@1
7
2.
30.190.222:27017
"
,
"dbUrl"
:
"e2e-test:
JkejFfXD
@1
9
2.
168.101.11:30423
"
,
"database"
:
"sh-kiel-e2e-test"
,
"keycloakRealm"
:
"sh-kiel-dev"
,
"keycloakUrl"
:
"https://sso.ozg-sh.de/"
,
...
...
This diff is collapsed.
Click to expand it.
goofy-client/package.json
+
3
−
1
View file @
430eaab4
...
...
@@ -93,7 +93,6 @@
"@typescript-eslint/eslint-plugin"
:
"4.3.0"
,
"@typescript-eslint/parser"
:
"4.3.0"
,
"codelyzer"
:
"6.0.1"
,
"cypress"
:
"^6.6.0"
,
"cypress-mochawesome-reporter"
:
"^1.3.0"
,
"dotenv"
:
"6.2.0"
,
"eslint"
:
"7.10.0"
,
...
...
@@ -111,5 +110,8 @@
"ts-node"
:
"9.1.1"
,
"tslint"
:
"6.1.3"
,
"typescript"
:
"^4.0.7"
},
"optionalDependencies"
:
{
"cypress"
:
"^6.6.0"
}
}
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