CLion 2023.3 Help

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. For more information about main Automation concepts and DSL syntax, refer to Space documentation on Automation.

With the Kotlin plugin installed and enabled, CLion recognizes the syntax of the Space Automation DSL, and you can take advantage of code completion, syntax highlighting, inspections, and many other CLion features while working with the script.

Create an Automation script

  1. In the Project tool window, right-click the root directory of your project and select File | New.

  2. In the New File window that opens, enter the file name .space.kts and press Enter.

  3. 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!" } } }
  4. 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 CLion, you can check whether an Automation job is still running, failed with an error, or finished successfully.

  1. In the View | Tool Windows | Git tool window, open 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.

    Preview Space Job status
  2. Click the icon to get more details on the jobs that were triggered by the commit.

    Link to Space Job

In the Space Automation window, you can click the job link to view its log in your browser.

Last modified: 10 January 2024