-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
30 lines (30 loc) · 1.59 KB
/
Jenkinsfile
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
#!groovy
node {
def projectName = 'glr_parser'
def gradleHome = tool name: 'gradle', type: 'gradle'
stage('Checkout') { // for display purposes
// Get some code from a GitHub repository
// parent directory
checkout changelog: true, poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout']], submoduleCfg: [], userRemoteConfigs: [[url: 'story_line2_build.github.com:fedor-malyshkin/story_line2_build.git']]]
// project itself
checkout changelog: true, poll: true, scm: [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: "${projectName}"]], submoduleCfg: [], userRemoteConfigs: [[url: "story_line2_${projectName}.github.com:fedor-malyshkin/story_line2_${projectName}.git"]]]
// deployment
// checkout changelog: true, poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'deployment']], submoduleCfg: [], userRemoteConfigs: [[url: 'story_line2_deployment.github.com:fedor-malyshkin/story_line2_deployment.git']]]
}
stage('Assemble') {
dir(projectName) {
// Run the maven build
sh "'${gradleHome}/bin/gradle' -Pstand_type=test assemble"
}
}
stage('Test') {
dir(projectName) {
try {
sh "'${gradleHome}/bin/gradle' -Pstand_type=test test"
}
finally {
junit "build/test-results/test/TEST-*.xml"
}
}
}
}