[ https://issues.apache.org/jira/browse/JAMES-3225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17238043#comment-17238043 ]
ASF GitHub Bot commented on JAMES-3225: --------------------------------------- aduprat commented on a change in pull request #264: URL: https://github.com/apache/james-project/pull/264#discussion_r529440705 ########## File path: Jenkinsfile ########## @@ -0,0 +1,170 @@ +#!groovy + +/* + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +def AGENT_LABEL = env.AGENT_LABEL ?: 'ubuntu' +def JDK_NAME = env.JDK_NAME ?: 'JDK 11 (latest)' + +pipeline { + + agent { + node { + label AGENT_LABEL + } + } + + environment { + // ... setup any environment variables ... + MVN_LOCAL_REPO_OPT = '-Dmaven.repo.local=.repository' + MVN_TEST_FAIL_IGNORE = '-Dmaven.test.failure.ignore=true' + CI=true + } + + tools { + // ... tell Jenkins what java version, maven version or other tools are required ... + maven 'maven_3_latest' + jdk JDK_NAME + } + + options { + // Configure an overall timeout for the build of 4 hours. + timeout(time: 4, unit: 'HOURS') + // When we have test-fails e.g. we don't need to run the remaining steps + skipStagesAfterUnstable() + buildDiscarder( + logRotator(artifactNumToKeepStr: '5', numToKeepStr: '10') + ) + disableConcurrentBuilds() + } + + stages { + stage('Initialization') { + steps { + echo 'Building branch ' + env.BRANCH_NAME + echo 'Using PATH ' + env.PATH + } + } + + stage('Cleanup') { + steps { + echo 'Cleaning up the workspace' + deleteDir() + } + } + + stage('Checkout') { + steps { + echo 'Checking out branch ' + env.BRANCH_NAME + checkout scm + } + } + + stage('Build') { + steps { + echo 'Building' + sh 'mvn -U -B -e clean install -DskipTests' + } + } + + stage('Tests') { + steps { + echo 'Running tests' + // all tests is very very long (10 hours on Apache Jenkins) + sh 'mvn -B -e test' + } + post { + always { + junit(testResults: '**/surefire-reports/*.xml', allowEmptyResults: true) + junit(testResults: '**/failsafe-reports/*.xml', allowEmptyResults: true) + } + } + } + + stage('Deploy') { + when { Review comment: I never tried. According to the documentation, it's available only on `stage`, so it should not work on a `post` step. ``` The when directive allows the Pipeline to determine whether the stage should be executed depending on the given condition. ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Provide automated builds for Apache James - (restore builds.apache.org ?) > -------------------------------------------------------------------------- > > Key: JAMES-3225 > URL: https://issues.apache.org/jira/browse/JAMES-3225 > Project: James Server > Issue Type: Task > Reporter: Ioan Eugen Stan > Assignee: Ioan Eugen Stan > Priority: Major > Time Spent: 1h > Remaining Estimate: 0h > > For a long time we had builds that ran on the Apache Infrastructure > https://builds.apache.org/view/All/job/james-mailet/ . > The build infrastructure is not running for ~ 3 years now. > I believe it is important for us to have automated builds. > This ticket should gather the work needed to make this a reality. > There are lots of things to take into consideration. > My ( [~ieugen] ) opinions on how to handle this. > * builds should run automatically > * builds should run fast < 10 min > * there are several things they should do (not exhaustive) > ** verify the source code > ** compile the source code > ** run the unit tests > ** run the integration tests > ** publish SNAPSHOTS (only from master or develop ?!) > ** run code analytics > ** publish reports relating to build > ** provide build status for other services > For smaller projects this is a no-brainer. > For the current state of Apache James this is a challange, especially in the > context of > - multiple git branches and PR's > - the distributed integration tests which take a long time > Given the limited resources available for us on the Apache infrastructure we > will have to be selective of what we do. > Personally I don't see how we can run the current (40mni +) integration suite > on each push / build. I'm pretty sure we will get banned :) or throttled. > So a discussion should be in order on how to solve these issues but some > options regarding what we can do: > - make integration tests OPT-IN > - run (distributed) integration tests once a day or once every 6h / 12h > - have build profiles that build a common subset all the time and run > The nuclear option: prune some of the components we have in James and we > don't want to support or move them out of the common project. > This is something we should consider especially for buggy components or for > components that don't have a maintainer. > We have limited time and resources. > We can't maintain everything for everybody. > We should be mindful of this. > We can take inspiration from the OFBiz project > https://builds.apache.org/view/All/job/Apache%20OFBiz/ . -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org