You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2020/02/16 18:05:32 UTC
[struts-annotations] branch master updated: Defines build pipeline
This is an automated email from the ASF dual-hosted git repository.
lukaszlenart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/struts-annotations.git
The following commit(s) were added to refs/heads/master by this push:
new 31b6db3 Defines build pipeline
31b6db3 is described below
commit 31b6db305d7881b0beb8d3e25dd8acbf2275ce87
Author: Lukasz Lenart <lu...@apache.org>
AuthorDate: Sun Feb 16 19:05:27 2020 +0100
Defines build pipeline
---
Jenkinsfile | 123 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 123 insertions(+)
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..a64d81b
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,123 @@
+#!groovy
+
+pipeline {
+ agent {
+ label 'ubuntu'
+ }
+ tools {
+ jdk 'JDK 1.8 (latest)'
+ maven 'Maven (latest)'
+ }
+ environment {
+ MAVEN_OPTS = "-Xmx1024m"
+ }
+ options {
+ buildDiscarder logRotator(daysToKeepStr: '14', numToKeepStr: '10')
+ timeout(80)
+ disableConcurrentBuilds()
+ skipStagesAfterUnstable()
+ quietPeriod(30)
+ }
+ triggers {
+ pollSCM 'H/15 * * * *'
+ }
+ stages {
+ stage('Clean up') {
+ steps {
+ cleanWs deleteDirs: true, patterns: [[pattern: '**/target/**', type: 'INCLUDE']]
+ }
+ }
+ stage('Build') {
+ steps {
+ sh 'mvn -B clean package -DskipTests'
+ }
+ }
+ stage('Test') {
+ steps {
+ sh 'mvn -B test'
+ // step([$class: 'JiraIssueUpdater', issueSelector: [$class: 'DefaultIssueSelector'], scm: scm])
+ }
+ post {
+ always {
+ junit(testResults: '**/surefire-reports/*.xml', allowEmptyResults: true)
+ junit(testResults: '**/failsafe-reports/*.xml', allowEmptyResults: true)
+ }
+ }
+ }
+ stage('Build Source & JavaDoc') {
+ when {
+ branch 'master'
+ }
+ steps {
+ dir("local-snapshots-dir/") {
+ deleteDir()
+ }
+ sh 'mvn -B source:jar javadoc:jar -DskipAssembbly'
+ }
+ }
+ stage('Deploy Snapshot') {
+ when {
+ branch 'master'
+ }
+ steps {
+ withCredentials([file(credentialsId: 'struts-custom-settings_xml', variable: 'CUSTOM_SETTINGS')]) {
+ sh 'mvn -s \${CUSTOM_SETTINGS} deploy -skipAssembly'
+ }
+ }
+ }
+ }
+ post {
+ always {
+ cleanWs deleteDirs: true, patterns: [[pattern: '**/target/**', type: 'INCLUDE']]
+ }
+ }
+ post {
+ // If this build failed, send an email to the list.
+ failure {
+ script {
+ emailext(
+ subject: "[BUILD-FAILURE]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
+ body: """
+ BUILD-FAILURE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]':
+
+ Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]</a>"
+ """.stripMargin(),
+ to: "dev@struts.apache.org",
+ recipientProviders: [[$class: 'DevelopersRecipientProvider']]
+ )
+ }
+ }
+
+ // If this build didn't fail, but there were failing tests, send an email to the list.
+ unstable {
+ script {
+ emailext(
+ subject: "[BUILD-UNSTABLE]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
+ body: """
+ BUILD-UNSTABLE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]':
+
+ Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]</a>"
+ """.stripMargin(),
+ to: "dev@struts.apache.org",
+ recipientProviders: [[$class: 'DevelopersRecipientProvider']]
+ )
+ }
+ }
+
+ // Send an email, if the last build was not successful and this one is.
+ fixed {
+ script {
+ emailext(
+ subject: "[BUILD-STABLE]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
+ body: """
+ BUILD-STABLE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]':
+
+ Is back to normal.
+ """.stripMargin(),
+ to: "dev@struts.apache.org",
+ recipientProviders: [[$class: 'DevelopersRecipientProvider']]
+ )
+ }
+ }
+ }
+}