Skip to content

Build Pipeline

Vadim edited this page May 22, 2024 · 6 revisions

Palladio-Build-Actions Pipeline

We are using GitHub Actions to build and deploy our projects. The actions are made up of one parent action, the Palladio-Build-ActionsPipeline, which defines pipeline steps for the build.

For deployment, there exists an additional action, the Palladio-Build-ActionsPipeline-Deployment.

The ActionsPipeline calls the ActionsPipeline-Deployment action to deploy the created artifacts to our updatesite.

Pipeline Stages

  • Set up job: Sets some GitHub specific information
  • Build PalladioSimulator/Palladio-Build-ActionsPipeline-Deployment@...: Builds the action used for deployment. This is done using docker
  • Checkout Repository: Does what the name suggests
  • Set up JDK: Installs the specified version of java
  • Verify with Maven: Calls mvn clean verify
  • Check Deployment: Checks if the build was triggered by a push on the main branch (or nightly build). If not the following jobs are skipped.
    • Create folder name: Creates the folder name from the repository naming
    • Create project deployment path: Builds the first part of the path for deployment (path on server and repository name)
    • Create Deployment path: Builds the full path, where the build artifacts are going to be deployed (adds either nightly, release or branch folder structure)
    • Deploy to Updatesite: Calls Palladio-Build-ActionsPipeline-Deployment. This uses SCP and SFTP to deploy the files to the server.
    • Post and Cleanup Stages

Build pipeline

⚠️ Deprecated: Use GitHub actions instead

  • We are using Jenkins build pipeline support to automatically configure the build server
  • Jenkins management: use Multibranch Pipeline
  • Jenkins file (= script) must be added to each project root to automatically create build job on build server (presence of new files will be checked periodically)
  • Modulare Pipeline library (MPL)
    • shared library, to describe pipeline as skeleton for each stage and provide hooks to plugin your own modules (documentation ref. MPL
    • we use this library to write our own pipeline skeleton
  • Global dependencies of a build job are defined by a Jenkins template

Jenkins pipeline

Our Jenkins pipeline includes the following stages:

  1. Prepare
  2. Checkout: src checkout
  3. Build: usually runs mvn clean verify
  4. Archive: copies Java doc
  5. Quality Metrics: evaluates code coverage + checkstyle results
  6. Deploy: opens ssh connection and deploys artefacts to webserver
  7. Declarative: Post Actions

Jenkins file

Check out the documentation.

MDSDTools-MPL

The project is a fork of the MPL repository.

Palladio-Build-JenkinsPipeline

  • specialization of MDSDTools pipeline
  • folder \vars contains all Groovy scripts that will be directly called by stages of pipeline
  • script PalladioPipeline: entry point

Build-Jenkins Library

  • contains all Groovy scripts that are called from Palladio-Build-JenkinsPipeline.PalladioPipeline script
  • AbstractMDSDToolsPipeline:
    • defines the available stages of our pipeline
    • called from MDSD tools pipeline
  • AbstractMDSDToolsDSLPipeline
  • MDSDToolsDSL
    • methodMissing contains all logic
    • automatically called by Groovy if you call a non-existing method on an object
    • splits the incoming method names into tokens (argument: name, args: params of method)
    • builds a string:value map (e.g. cfg.mavenSettingsId: 'xyc')