Space Automation
Space Automation helps you automate your development workflow. You can automatically run testing or deployment scripts when a specific event occurs or according to a schedule.
The automation script is written in a Kotlin-based DSL and is stored in the .space.kts
file in the project root directory. The script consists of a set of jobs. A job can run a shell script or Kotlin code. Using the Automation script, you can access various APIs, work with Space modules (such as chats and issues), run Gradle commands, and much more. Refer to Space documentation on Automation to get familiar with main Automation concepts and DSL syntax.
With the Kotlin plugin installed and enabled, IntelliJ IDEA recognizes the syntax of the Space Automation DSL, and you can take advantage of code completion, syntax highlighting, inspections, and many other IntelliJ IDEA features while working with the script.
Create an Automation script
In the Project tool window, right-click the root directory of your project and select .
In the New File window that opens, enter the file name
.space.kts
and press Enter.Enter your automation script with at least one job. For example, this job will run a Shell script outputting a string to the Job log:
job("Run shell script") { container(displayName = "Say Hello", image = "ubuntu") { shellScript { content = "echo Winter is coming!" } } }Commit and push this new file to your Space remote repository.
You can choose when to run jobs. For example, a job run can be triggered when you push changes in particular files or branches. If you don't specify run conditions, the job will run when you push any changes in your repository.
Preview job statuses
In IntelliJ IDEA, you can check whether an Automation job is still running, failed with an error, or finished successfully.
In the Log tab. If a Space Automation job was triggered for a commit, you'll see an icon representing the job status to the right of the commit.
tool window, open theClick the icon to get more details on the jobs that were triggered by the commit.
In the Space Automation window, you can click the job link to view its log in your browser.