-
Notifications
You must be signed in to change notification settings - Fork 430
Expand file tree
/
Copy pathJenkinsfile
More file actions
54 lines (49 loc) · 1.51 KB
/
Jenkinsfile
File metadata and controls
54 lines (49 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
pipeline {
agent any
tools {
maven 'Maven'
}
environment {
fname = "Ranjit"
lname = "Swain"
version = "1.2"
system = "Dev"
}
stages{
stage('Build'){
steps {
sh 'mvn clean package'
}
post {
success {
echo 'Archiving the artifacts'
archiveArtifacts artifacts: '**/target/*.war'
}
failure{
emailext attachLog: true, body: 'Email sent out from Jenkins', subject: '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!', to: 'rs.ranjitswain@gmail.com'
}
}
}
stage ('Deployments'){
parallel{
stage ('Deploy to Staging'){
steps {
echo "This is made by ${env.fname} ${env.lname}"
echo "it's running on ${env.system} and the version is ${env.version}"
echo "Deploying to Staging Environment!"
echo "Triggered by github-hook"
}
}
stage ("Deploy to Staging2"){
steps {
echo 'This is just a demo on Production server.'
/*script{
props = readProperties file: 'build.cnf'
}
echo "Current Version ${props['deploy.version']}"*/
}
}
}
}
}
}