forked from RestComm/media-server-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile-snapshot
55 lines (43 loc) · 2.55 KB
/
Jenkinsfile-snapshot
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
55
node("cxs-slave-master") {
configFileProvider(
[configFile(fileId: '37cb206e-6498-4d8a-9b3d-379cd0ccd99b', targetLocation: 'settings.xml')]) {
sh 'mkdir -p ~/.m2 && sed -i "s|@LOCAL_REPO_PATH@|$WORKSPACE/M2_REPO|g" $WORKSPACE/settings.xml && cp $WORKSPACE/settings.xml -f ~/.m2/settings.xml'
}
stage ('Checkout') {
checkout scm
// Get project version from POM
def pom = readMavenPom file: 'pom.xml'
env.MAJOR_VERSION_NUMBER = pom.version
}
stage ('Build') {
sh "mvn clean install -DskipTests=true "
}
stage ('Test') {
sh "mvn test"
}
stage('PublishResults') {
junit testResults: '**/target/surefire-reports/*.xml', testDataPublishers: [[$class: 'StabilityTestDataPublisher']]
// checkstyle canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '**/checkstyle-result.xml', unHealthy: ''
junit '**/target/surefire-reports/*.xml'
// step( [ $class: 'JacocoPublisher' ] )
// if ((env.BRANCH_NAME == 'master') && (currentBuild.currentResult != 'SUCCESS') ) {
// slackSend "Build unstable - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
// }
// if (env.BRANCH_NAME ==~ /^PR-\d+$/) {
// //step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: emailextrecipients([[$class: 'FailingTestSuspectsRecipientProvider']])])
// /*if (currentBuild.currentResult != 'SUCCESS' ) { // Other values: SUCCESS, UNSTABLE, FAILURE
// setGitHubPullRequestStatus (context:'CI', message:'IT unstable', state:'FAILURE')
// } else {
// setGitHubPullRequestStatus (context:'CI', message:'IT passed', state:'SUCCESS')
// }*/
// }
}
stage ('Deploy') {
sh "mvn clean install package deploy:deploy -Pattach-sources,generate-javadoc,maven-release -DskipTests=true -DskipNexusStagingDeployMojo=true -DaltDeploymentRepository=nexus::default::$CXS_NEXUS_SNAPSHOTS_URL"
}
stage ('Archive') {
zip archive: true, dir: "./assembly/target/media-server-standalone-${env.MAJOR_VERSION_NUMBER}", zipFile: "media-server-standalone-latest-${env.MAJOR_VERSION_NUMBER}.zip"
zip archive: true, dir: "./docs/sources-asciidoc/target/generated-docs/pdf", zipFile: "media-server-standalone-docs-pdf-latest-${env.MAJOR_VERSION_NUMBER}.zip"
zip archive: true, dir: "./docs/sources-asciidoc/target/generated-docs/html-book", zipFile: "media-server-standalone-docs-html-latest-${env.MAJOR_VERSION_NUMBER}.zip"
}
}