Uploaded image for project: 'Nuxeo ECM Build/Test Environment'
  1. Nuxeo ECM Build/Test Environment
  2. NXBT-3447

"Generify" n'Apps addons pipeline scripts (aka "shared library")

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Continuous Integration
    • Tags:
    • Sprint:
      nxApps 2021 Cycle 2, nxApps 2021 Cycle 3

      Description

      We've identified that there are a lot of nplicated effort on each of the addons n'Apps team is owning.
      The big picture is more or less the same: a project that contributes to Nuxeo Platform (backend) and to Nuxeo Web UI (frontend).

      Currently we maintain the same code on each repository which will soon become a nightmare for maintainability and scalability.
      Given that, we did some brain storming to identify which are the common steps, some improvements that can be done and how to tackle them. 

      Draft Structure

       

      The pipeline draft image explains in a little bit of detail what we would like to achieve. Generically:

      1. Load / Setting up stuff needed for the pipeline run (e.g. load common library scripts, define environment variables)
      2. Validate code by compiling, linting and running unit tests
      3. Package the addon 
      4. Preview environment and functional validations (can be automated with functional tests or manual by developers, PO, QA)
      5. Publish (i.e. git commits, tags, connect, etc.)

      Detailed Steps

      We've also identified some points that can be polished for consistency and performance purposes. Some examples:

      • Compile: can literally run mvn compile since it is the step purpose and will already include the UI contribution dependencies installation
      • Linting: could be done as part of the Compile step but, for having more control and since it is specific to the UI contribution, it can leave outside
      • Test: unit tests, both backend and frontend. (i.e. mvn test && npm run test)
        Ideally on the backend we would tests against different databases (in memory, SQL, NoSQL). On the frontend we intent to use Playwright (already in place) to tests against Chromium, Firefox and Webkit.
      • Packaging: literally mvn package, there is no need for cleaning or use other maven lifecycle for achieving the goal
      • Publish: we need this to be configurable so we can have the possibility to publish to different instances (e.g. connect pre prod and/or connect prod)

      How to do It

      we can create a new file https://github.com/nuxeo/jx-napps-env/tree/master/ci/Jenkinsfiles/common-lib.groovy ( it will host all the shared code)

      the content of https://github.com/nuxeo/nuxeo-retention/blob/master/ci/jenkinsfiles/common-lib.groovy for example will be:

      #!groovy
      /*
         Instead of duplicating a lot of build related code in each repo include the common one from this file using the command below:
         Don't forget to put configure GITHUB_TOKEN inside Jenkins as it is a very bad idea to include it inside your code.
      */
      
      apply from: 'https://raw.githubusercontent.com/nuxeo/jx-napps-env/master/ci/Jenkinsfiles/common-lib.groovy?token=${env.GITHUB_TOKEN}'
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day
                  1d