Skip to content

Latest commit

 

History

History
136 lines (92 loc) · 4.51 KB

additional_commands.rst

File metadata and controls

136 lines (92 loc) · 4.51 KB

Universum modes

Along with default mode Universum provides the following useful additional commands:

  • init <additional_commands#init>
  • run <additional_commands#run>
  • poll <additional_commands#poll>
  • submit <additional_commands#submit>
  • github-handler <additional_commands#github-handler>

Initialize Universum

If you have Universum installed via {pip} install -U universum or downloaded it from GitHub and changed working directory to project root, run {python} -m universum init to create an example configuration file, that can be updated according to your project needs <configuring> later.

Running this command will not only create a configuration file, but will also provide you with a command line to execute it with Universum.

Run Universum locally (Non-CI mode)

The {python} -m universum run subcommand uses provided Universum config <configuring> to execute the set up scenario locally. This allows to easily perform all required checks before submitting a change to VCS. This mode can generally be used as a wrapper for a complex build system.

Universum in non-CI mode has the following differences from default mode:

  • It does not require most of build parameters <args> - especially the VCS-related ones.
  • It does not report build results <code_report> to any code review system.
  • It works with sources 'in place', without copying.
  • It automatically cleans the artifact folder before the build.
--filter -f : @replace

Poll chosen VCS for updates

This mode was created for CI systems that do not have polling feature at all or that are not able to check each change individually.

When launched in poller mode, Universum uses a simple database to remember latest checked commit for every passed VCS source, such as Git or P4 branch. On next launches it consults that database and calculates a list of updates (commits, submits) in that VCS source since last change saved in DB. After that, using an URL defined in parameters, it triggers a build in CI system for each of those changes (instead of testing only the current VCS state).

This mode allows to locate a source of behaviour changes more precisely.

Note

Even being a poller, Universum in this mode does not launch automatically. Please use some outer means (such as cron or any other time-based auto-launcher) for periodical checks.

Here are the parameters for poller mode:

Detect changes and submit them automatically

Unlike default mode, Universum in submit mode requires an already prepared local repository. For example:

  • In case of Git:

    • the repo should be already cloned
    • the required branch should be already checked out
  • In case of P4:

    • the client should be already created
    • the directory should be already synced
    • all the required shelves should be applied

After doing that, any additional changes done to source code (made manually or by script execution) will be detected by Universum submitter and added to VCS with specified description on behalf of specified user.

Here are the parameters for submitter mode:

GitHub Handler

GitHub Handler <github_handler> is a Universum mode that serves as GitHub Application, helping to perform and report checks on new commits to a repository. It can create new check runs on GitHub and trigger an already set up automation server to perform these checks. GitHub Handler parses all required params and passes them to the triggered builds.

For GitHub Handler to work, these parameters are mandatory:

  • --payload
  • --event
  • --trigger-url
  • --github-app-id
  • --github-private-key

These and other parameters are described below.