forked from chrishantha/sample-java-programs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsFile
More file actions
35 lines (33 loc) · 1.1 KB
/
JenkinsFile
File metadata and controls
35 lines (33 loc) · 1.1 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
pipeline {
environment {
JAVA_HOMEO = "/var/Jenkins_Home"
}
parameters {
choice choices: ['Saturday', 'Sunday', 'Monday'], description: 'Enter the Day', name: 'Day'
choice choices: ['master', 'development', 'feature'], description: 'Enter the branch name', name: 'Branch'
}
options {
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '5', numToKeepStr: '10')
timeout(time: 3, unit: 'MINUTES')
}
agent any
tools {
maven 'maven-tool'
}
stages {
stage('Hello') {
steps {
echo 'Hello World'
}
}
stage('sravani') {
steps {
git branch: "$params.Branch", url: 'https://github.com/Nishvika/sample-java-programs.git'
sh 'mvn install'
echo 'Hello sravani'
echo "The entered day is $params.Day"
echo "The environment variable value for JAVA_HOMEO is $JAVA_HOMEO "
}
}
}
}