git scan

Updated:2023-07-03

maia git_scan : this command scans one or more Git repositories and posts commits to the MAIA web app.

Usage
  1. execute maia git_scan regularly to make sure that the MAIA web app is synchronized with the Git repositories.
    • The option repo-name or repo-file should be used.
    • The command creates a git clone before scanning. If the clone exists, it will be updated before scanning.
  2. execute maia git_scan in conjunction with other commands e.g. in preparation for the maia build command.
    • suitable when integrating MAIA Agent into an existing build pipeline.
    • the command must be executed from the directory of an already cloned repository.
    • no repository option (repo-name or repo-file) should be used.
Command printout
$ bundle exec maia git_scan --help
Usage: git_scan [--help] [--verbose] [--debug]  [--activity string] 
[--activity-uuid <uuid>] [--parent-activity-uuid <uuid>] [--save-log] 
[--no-owner] [--heartbeat-interval <int>] [--time-to-live <int>]
[--cyclic <int>:<int>] [--owner (group:<str> | repo:<str>)] 
(--repo-name <repo name> | --repo-file <filename>)

Options:
    -v, --verbose                    Verbose mode
    -d, --debug                      Debug mode
        --activity-uuid STRING       Activity uuid
        --parent-activity-uuid STRING
                                     Parent activity uuid
    -z, --activity STRING            Activity comment (default activity-uuid)
        --time-to-live INT           Timeout (default 7200s)
        --heartbeat-interval INT     Heartbeat (default 600s)
        --no-owner                   Disable owner for an activity.
    -g, --save-log                   Save logfile locally
        --cyclic STRING              Cyclic mode
        --owner STRING               Set owner
    -r, --repo-name STRING           Repo name to scan
    -i, --repo-file STRING           Repo names specified by a file
    -h, --help  


Command details
Run command Restrictions Examples
maia git_scan 1. use with --repo-name |--repo-file, or
2. use with no repo option
1. $bundle exec maia git_scan --repo-name blt -v --cyclic 300:14000
2. $bundle exec maia git_scan


Option flag Parameter Description
--cyclic int:int C Enables cyclic scanning where parameters are scan interval:terminate after, in seconds.
This option can only be used with option --repo-name or --repo-file below.
--owner team:string |repo:string The owner of the scan activity.
The owner can be the name of a team, or a repository.
This option cannot be used together with the option no-owner.
--repo-name, -r repo name string C The name of the repository that will be scanned.
The repo name is used to define a single repository.
This option cannot be used together with the option repo-file.
--repo-file, -i filename string C The name of the repositories that will be scanned.
The repo file is used to define multiple repositories.
This option cannot be used together with the option repo-name.



The following additional command options apply when also creating Activities in the MAIA web app.

Option flag Parameter Description
--activity, -z string C The activity comment that will be showed in MAIA web app. Default activity-uuid
--activity-uuid uuid string M The uuid of this activity.
--parent-activity-uuid uuid string The uuid of the parent activity that the build belongs to in MAIA.
--no-owner Disables the owner for an activity.
--heartbeat-interval int The number of seconds between heartbeats. Default 600 sec.
--time-to-live int The maximum timeout, in seconds, before the activity is terminated. Default 7200 sec.
--save-log, -g Saves the log file locally



The following additional command options apply to all MAIA Agent commands.

Option flag Description
--help, -h Shows all available options for the command.
--verbose, -v Enables verbose mode.
--debug, -d Enables debug mode.

Results