Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mytime
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Narendar Vakiti
mytime
Commits
4d33593a
Commit
4d33593a
authored
Aug 29, 2019
by
Anil Pemmaraju
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new JenkinsFile
parent
f7e0f931
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
0 deletions
+74
-0
Jenkinsfile
Jenkinsfile
+74
-0
No files found.
Jenkinsfile
0 → 100644
View file @
4d33593a
pipeline
{
agent
any
stages
{
stage
(
'Build'
)
{
steps
{
sh
'./gradlew -b build.gradle clean build'
}
}
stage
(
'Parallel Stages'
)
{
parallel
{
stage
(
'Archival'
)
{
steps
{
archiveArtifacts
'build/libs/*.?ar'
}
}
stage
(
'SonarQube analysis'
)
{
steps
{
withSonarQubeEnv
(
'sonar'
)
{
sh
'./gradlew sonarqube'
}
}
}
stage
(
'Test Reports'
)
{
steps
{
junit
'build/test-results/test/*.xml'
}
}
}
}
stage
(
'Artifact Uploader'
)
{
steps
{
nexusArtifactUploader
artifacts:
[[
artifactId:
'myTeam'
,
file:
'build/libs/myTeam.war'
,
type:
'war'
]],
credentialsId:
'nexusAdminCreds'
,
groupId:
'com.nisum.mytime'
,
nexusUrl:
'10.3.45.130:8081/nexus'
,
nexusVersion:
'nexus2'
,
protocol:
'http'
,
repository:
'releases'
,
version:
'1.0.${BUILD_NUMBER}'
}
}
stage
(
'Deploy to PreProd'
)
{
steps
{
sh
'''
scp build/libs/myTeam.war tomcat@10.3.45.131:/opt/tomcat/webapps/myTeam.war;
ssh tomcat@10.3.45.131 /opt/tomcat/bin/shutdown.sh;
ssh tomcat@10.3.45.131 /opt/tomcat/bin/startup.sh
'''
//sshPublisher(publishers: [sshPublisherDesc(configName: 'preprod', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '/opt/tomcat/bin/shutdown.sh;sleep 5;/opt/tomcat/bin/startup.sh', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/opt/tomcat/webapps/', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'build/libs/*.war')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
}
}
}
post
{
always
{
notify
(
'started'
)
}
failure
{
notify
(
'err'
)
}
success
{
notify
(
'success'
)
}
}
}
def
notify
(
status
){
emailext
(
to:
"sneelam@nisum.com,rtirumalapuram@nisum.com"
,
subject:
"${status}: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'"
,
body:
"""<p>${status}: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
<p>Check console output at <a href='${env.BUILD_URL}'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a></p>"""
,
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment