Skip to content

B&R Jenkins Helper Scripts

Groovy Scripts

Groovy scripts can be called directly from your jenkins pipeline

General Purpose

  • ExportASLibrary - Exports a library from an Automation Studio project in binary format
  • FrameworkExport - Creates a zip file for importing using the mapp Framework Import tool
  • SendNotifications - Sends notifications to a MS Teams channel
  • GetResources - Helper script which returns the path the resources used by this library
  • UploadToGitHub - Uploads a file to a GitHub project

Project/Version Information

  • Version - Returns the version number in the V<Major>.<Minor>.<Bugfix>.<Number> format. Version information is based on the latest repository tag and the branch name
  • MajorVersionNumber - Returns just the Major version number
  • MinorVersionNumber - Returns just the Minor version number
  • BugFixVersionNumber - Returns just the BugFix version number
  • IsReleaseCandidate - Returns true if the branch is a release candidate branch (release/*)
  • IsReleaseBranch - Returns true if this is the main branch, false otherwise
  • IsHotFix - Returns true if this is a hotfix branch, false otherwise
  • BranchName - Returns the branch name from the repository
  • Tag - returns the latest tag from the repository

Build Scripts

Test Scripts

Python Scripts

Python scripts can not be called directly from your Jenkins pipeline, most of these are used internally in the Groovy

For others you can call them from a Jenkins pipeline using the following syntax

powershell(script: "python '${GetResources()}/scripts/Export.py' --arg1 'argument'");)

Automation Studio Helpers

  • ASProject - Loads an Automation Studio project into a python class
  • AsProjectCompile - Builds an Automation Studio project
  • CreateArSimInstallation - Creates the ArSim install folder
  • Export - Exports a zip file for importing with the mapp Framework Import tool
  • InstalledAS - Returns a list of all Automation Studio installations on the computer
  • LibraryExport - Exports a binary version of a library
  • ModuleOK - Verifies that all module's ModuleOK input is being monitored
  • ProcessCodeCoverage - Generates a html and xml file with the code coverage data
  • RunUnitTests - Runs the unit tests in ArSim
  • StartArSim - Starts an ArSim instance and wait for it to be in run mode before returning
  • StopArSim - Stops an ArSim instance

General

  • DirUtils - Directory helper utility functions used by other scripts
  • UploadToGitHub - Uploads a file to GitHub
  • Zip - Creates a Zip archive of a directory