How package plugin from CI?

I’m working on a C++ plugin and would like to include building and packaging of the plugin in our Continuous Integration pipeline. To do this I need to know how to build and export my plugin without user intervention and without creating an Unreal Editor window. I intend to run from within a Docker container, both Windows and Linux.

I have looked a the command line arguments listed at Command-Line Arguments | Unreal Engine Documentation but have not found a way to do what I need. Did I miss something?

I have found two alternative approaches that might work.

  1. AutomationTool:
    AutomationTool Overview | Unreal Engine Documentation

  2. Python scripting:
    Scripting the Editor using Python | Unreal Engine Documentation

Which of the two would you recommend? Is there a third, better way, that I have failed to find?

I have selected UE 4.22 in the product version drop-down but I am willing to upgrade it that would help.

I have a build script that calls the above line for each engine version specified. So my CI uses the AutomationTool. It works perfectly. You may have to use the “WhitelistPlatforms” property for your modules to prevent compilation for iOS / MacOS because that will throw an error if you are not using a Mac

"%Engine%_%Version%\Engine\Build\BatchFiles\RunUAT.bat" BuildPlugin -Plugin="%Plugin_Dir%\%PluginName%.uplugin" -Package="%PackageDir%\%Version%" -Rocket