Jobs and Steps
The most basic Automation unit is the step. A step is the smallest possible building block of the automation script, and it answers two questions: What to run (e.g., a shell script or Kotlin code) and where to run it? You cannot use steps on their own, but only as parts of larger Automation entities, such as jobs, for example.
A job is a defined task consisting of steps. The simplest automation script consists of a single job and, in turn, the simplest job consists of a single step.
Main features of jobs and steps
You can run steps in the following environments: Space cloud workers (virtual machines hosted in Space cloud), self-hosted workers (self-hosted machines), and Docker containers inside workers. Depending on the run environment, you should define steps using either the
host
orcontainer
blocks. To define a job, you should use thejob
block.For example:
job("Example") { // run the job in a default instance in cloud requirements { workerPool = WorkerPools.SPACE_CLOUD } host("Run echo") { shellScript { content = """ echo "Hello from worker!" """ } } container(displayName = "Say Hello", image = "ubuntu") { shellScript { content = """ echo Hello from container inside worker! """ } } }A job run is triggered by a project event. By default, it's 'git push'. You can also run jobs manually.
All jobs within a script run in parallel.
Steps within a job can be run in sequence and in parallel.
A job can have specific failure conditions.
A script can contain up to 100 jobs and each job can contain up to 50 steps.
The default and maximum allowed job timeout is 2 hours.