You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2022/01/19 02:28:04 UTC

[couchdb] 04/04: Decompose scripts into specific steps

This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a commit to branch improve-pr-jenkinsfile
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit dd070c10b263026a36061bf329289958f4862f7e
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Tue Jan 18 21:26:11 2022 -0500

    Decompose scripts into specific steps
    
    Improves developer UX and debugging when builds go awry.
---
 build-aux/Jenkinsfile.pr | 46 ++++++++++++++++++++++++----------------------
 1 file changed, 24 insertions(+), 22 deletions(-)

diff --git a/build-aux/Jenkinsfile.pr b/build-aux/Jenkinsfile.pr
index 34955f6..4bfdb18 100644
--- a/build-aux/Jenkinsfile.pr
+++ b/build-aux/Jenkinsfile.pr
@@ -12,17 +12,6 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-build_and_test = '''
-mkdir -p ${COUCHDB_IO_LOG_DIR} ${ERLANG_VERSION}
-cd ${ERLANG_VERSION}
-rm -rf build
-mkdir build
-cd build
-tar -xf ${WORKSPACE}/apache-couchdb-*.tar.gz
-cd apache-couchdb-*
-./configure
-make check || (make build-report && false)
-'''
 
 pipeline {
 
@@ -74,19 +63,16 @@ pipeline {
       }
       steps {
         timeout(time: 15, unit: "MINUTES") {
-          sh '''
-            set
-            rm -rf apache-couchdb-*
-            ./configure
-            make erlfmt-check
-            make dist
-            chmod -R a+w * .
-          '''
+          sh( script: 'rm -rf apache-couchdb-*', label: 'Clean out workspace' )
+          sh( script: './configure', label: 'Configure CouchDB build system' )
+          sh( script: 'make erlfmt-check', label: 'Verify Erlang coding style' )
+          sh( script: 'make elixir-check-formatted', label: 'Verify Elixir coding style' )
+          sh( script: 'make dist', label: 'Build self-contained release' )
         }
       }
       post {
         success {
-          stash includes: 'apache-couchdb-*.tar.gz', name: 'tarball'
+          stash includes: 'apache-couchdb-*.tar.gz', name: 'release-tarball'
         }
         cleanup {
           // UGH see https://issues.jenkins-ci.org/browse/JENKINS-41894
@@ -123,14 +109,30 @@ pipeline {
             }
             steps {
               timeout(time: 90, unit: "MINUTES") {
-                unstash 'tarball'
-                sh( script: build_and_test )
+                sh( script: "rm -rf ${ERLANG_VERSION} apache-couchdb-*", label: 'Clean out workspace' )
+                unstash 'release-tarball'
+                sh( script: "mkdir -p ${COUCHDB_IO_LOG_DIR} ${ERLANG_VERSION}"
+                sh( script: "tar -xf apache-couchdb-*.tar.gz -C ${ERLANG_VERSION} --strip-components=1", label: 'Unpack release' )
+                dir( "${ERLANG_VERSION}" ) {
+                  sh( script: './configure --skip-deps', label: 'Configure CouchDB build system' )
+                  sh( script: 'make', label: 'Build CouchDB' )
+                  sh( script: 'make eunit', label: 'EUnit test suite' )
+                  sh( script: 'make elixir-suite', label: 'ExUnit unit test suite' )
+                  sh( script: 'make exunit', label: 'ExUnit integration test suite' )
+                  sh( script: 'make mango-test', label: 'Python-based Mango query test suite' )
+                }
               }
             }
             post {
               always {
                 junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml, **/src/mango/nosetests.xml, **/test/javascript/junit.xml'
               }
+              failure {
+                dir( "${ERLANG_VERSION}" ) {
+                  sh 'ls -l'
+                  sh 'make build-report'
+                }
+              }
               cleanup {
                 sh 'rm -rf ${WORKSPACE}/* ${COUCHDB_IO_LOG_DIR}'
               }