Skip to main content

Workflow Schema Reference

Schema of Kraken Workflow Schema#

This is a schema that defines format of Kraken Workflow Schema.

Properties#

  • parent (string): A name of the parent stage. 'root' if there is no parent. This allows chaining stages.
  • triggers (object): One or more triggers that cause starting a new run of this stage.
    • parent (boolean): A parent stage to current one or 'root'. It allows defining a chain of stages.
    • interval (string)
    • date (string)
    • cron (string): A parent stage to current one or 'root'. It allows defining a chain of stages.
    • repo (object)
      • url (string)
      • branch (string)
      • repos (object)
        • url (string)
        • branch (string)
      • interval
        • OR (integer): Minimum: 1.
        • OR (string)
    • manual (boolean)
  • parameters (array)
    • Items (object)
      • name (string)
      • type (string)
      • default (string)
      • description (string)
  • configs (array)
    • Items (object)
  • flow_label (string): A custom label format for flows.
  • run_label (string): A custom label format for runs.
  • jobs (array): A list of jobs that are executed in the run. Jobs are executed in parallel.
    • Items (object)
      • name (string): A name of the job.
      • timeout (integer): An initial timeout of the job. If there are more than 10 historical succeded jobs then timeout is estimated automatically. Minimum: 30.
      • steps (array): An array of steps that are executed by an agent. Each step has indicated tool that is executing it. Steps are executed in given order.
        • Items (object)
          • OR
            • tool: Equals 'shell'. A tool that executes provided command in a shell. The field is required.
            • cmd (string): A command to execute. The field is required.
            • cwd (string): A current working directory where the step is executed. Default: '.'.
            • user (string): A user that is used to execute a command. Default: 'kraken'.
            • env (object): A dictionary with environment variables and their values.
            • timeout (integer): A timeout in seconds that limits time of step execution. It is guareded by an agent. If it is exceeded then the step is arbitrarly terminated. Minimum: 30.
            • attempts (integer): A number of times the step is retried if if it returns error. Default: 1.
            • sleep_time_after_attempt (integer): A sleep time between subsequent execution attempts. Default: 0.
          • OR
            • tool: Equals 'git'. A tool for cloning Git repository. The field is required.
            • checkout (string): An URL to the repository. The field is required.
            • branch (string): A branch to checkout. Default: 'master'.
            • destination (string): A destination folder for the repository. Default is empty ie. the name of the repository.
            • ssh-key (string): A name of a secret that holds SSH username and key.
            • access-token (string): An access token for GitLab use case.
            • timeout (integer): A timeout in seconds that limits time of step execution. It is guareded by an agent. If it is exceeded then the step is arbitrarly terminated. Minimum: 30.
            • attempts (integer): A number of times the step is retried if if it returns error. Default: 1.
            • sleep_time_after_attempt (integer): A sleep time between subsequent execution attempts. Default: 0.
          • OR
            • tool: Equals 'artifacts'. A tool for storing and retrieving artifacts in Kraken global storage. The field is required.
            • action (string): An action that artifacts tool should execute. Default is upload. Must be one of: 'download', 'upload'.
            • source: A path or list of paths that should be archived or retreived. A path can indicate a folder or a file. A path, in case of upload action, can contain globbing signs * or **. A path can be relative or absolute. The field is required.
              • OR (string): A single path.
              • OR (array): A list of paths.
                • Items (string)
            • destination (string): A path were the artifact(s) should be stored. In case of download action, if the destination folder does not exist then it is created. Default: '.'.
            • cwd (string): A current working directory where the step is executed. Default: '.'.
            • public (boolean): Determines if artifacts should be public and available to users in web UI (True) or if they should be only accessible internally to other stages but only in the same flow (False). Default: False.
            • attempts (integer): A number of times the step is retried if if it returns error. Default: 1.
            • sleep_time_after_attempt (integer): A sleep time between subsequent execution attempts. Default: 0.
          • OR
            • tool: Equals 'cache'. A tool for storing and restoring files from cache. The field is required.
            • action (string): An action that the tool should perform. Must be one of: 'save', 'restore'. The field is required.
            • key (string): A key under which files are stored in or restored from cache.
            • keys (array): A list of key under which files are restored from cache.
              • Items (string)
            • paths (array): Source paths used in store action.
              • Items (string)
            • expiry (string): Not implemented yet.
            • attempts (integer): A number of times the step is retried if if it returns error. Default: 1.
            • sleep_time_after_attempt (integer): A sleep time between subsequent execution attempts. Default: 0.
          • OR
            • tool: Equals 'pylint'. A tool that allows for static analysis of Python source code. The field is required.
            • pylint_exe (string): An alternative path or command to pylint. Default: 'pylint'.
            • rcfile (string): A path to pylint rcfile. The field is required.
            • modules_or_packages (string): A path or paths to Python modules or packages that should be checked. The field is required.
            • cwd (string): A current working directory where the step is executed. Default: '.'.
            • attempts (integer): A number of times the step is retried if if it returns error. Default: 1.
            • sleep_time_after_attempt (integer): A sleep time between subsequent execution attempts. Default: 0.
          • OR
            • tool: Equals 'pytest'. A tool that allows for running Python tests.
            • pytest_exe (string): An alternative path or command to pytest. Default: 'pytest-3'.
            • params (string): Parameters passed directly to pytest executable.
            • pythonpath (string): Extra paths that are used by Python to look for modules/packages that it wants to load.
            • cwd (string): A current working directory where the step is executed. Default: '.'.
            • attempts (integer): A number of times the step is retried if if it returns error. Default: 1.
            • sleep_time_after_attempt (integer): A sleep time between subsequent execution attempts. Default: 0.
          • OR
            • tool: Equals 'junit_collect'. A tool that allows for collecting test results stored in JUnit files. The field is required.
            • file_glob (string): A glob pattern for searching test result files. The field is required.
            • cwd (string): A current working directory where the step is executed. Default: '.'.
          • OR
            • tool: Equals 'gotest'. A tool that allows for running Go language tests.
            • go_exe (string): An alternative path or command to go.
            • params (string): Parameters passed directly to go test.
            • cwd (string): A current working directory where the step is executed. Default: '.'.
            • timeout (integer): A timeout in seconds that limits time of step execution. It is guareded by an agent. If it is exceeded then the step is arbitrarly terminated. Minimum: 30.
            • attempts (integer): A number of times the step is retried if if it returns error. Default: 1.
            • sleep_time_after_attempt (integer): A sleep time between subsequent execution attempts. Default: 0.
          • OR
            • tool: Equals 'nglint'. A tool that allows for running Angular ng lint, that is performing static analysis of TypeScript in Angular projects.
            • cwd (string): A current working directory where the step is executed. Default: '.'.
            • attempts (integer): A number of times the step is retried if if it returns error. Default: 1.
            • sleep_time_after_attempt (integer): A sleep time between subsequent execution attempts. Default: 0.
          • OR
            • tool: Equals 'cloc'. A tool that allows for running counting lines of code.
            • not-match-f (string): Filter out files that match to provided regex.
            • exclude-dir (string): Excluded provided list of directories.
            • cwd (string): A current working directory where the step is executed. Default: '.'.
            • attempts (integer): A number of times the step is retried if if it returns error. Default: 1.
            • sleep_time_after_attempt (integer): A sleep time between subsequent execution attempts. Default: 0.
          • OR
            • tool: Equals 'rndtest'. A tool that allows for generating random test case results.
            • count: A number of expected test cases.
              • OR (integer): Minimum: 1.
              • OR (string)
            • attempts (integer): A number of times the step is retried if if it returns error. Default: 1.
            • sleep_time_after_attempt (integer): A sleep time between subsequent execution attempts. Default: 0.
      • environments (array): It defines the surroundings of a job execution.
        • Items (object)
          • agents_group (string): A name of agents group. An agent from this group will be used to execute the job. There is a special built-in group, 'all' that gathers all agents. The field is required.
          • executor (string): An executor that agent is using to execute a job. Must be one of: 'local', 'docker', 'lxd'. Default: 'local'.
          • system: An operating system name or list of such names that should be used for job execution. If this is a list then the number of job instances is multiplied by numer of systems - each instance has its system. There is a special system name, 'any', that ignores system selection by jobs scheduler. The field is required.
            • OR (string)
            • OR (array)
              • Items (string)
          • config (string): Not implemented yet.
  • notification (object): Notification allows for configuring a notification means that are used to pass an information about stage's run result. There are several communication methods supported.
    • email (string): It sends run results to indicated email address.
    • slack (object): It sends run results to indicated Slack channel.
      • channel (string): Selected Slack channel.
    • github (object): It sends run results to associated pull request page on GitHub.
      • credentials (string): Credentials (user:password) that allows access to the project on GitHub.