←  back to blog
Gitpod Automations: bringing DevOps to your development environment

Gitpod Automations: bringing DevOps to your development environment

Automations are programmable tasks and services triggered on events unique to development environments. They enable you to create self-service actions across:

  • Setup: Seed a database, provision infra or authenticate with a cloud account

  • Operations: Turn your runbooks into one-click self-service actions

  • Editor interfaces: Start up a server such as Jupyter notebook

  • Policies: Run security or scanning tools

  • AI workflows: Configure AI agents or code assistants

Gitpod Flex Dashboard

Automating development environment workflows centralizes and standardizes what was once manual configuration scattered throughout your repositories in Makefiles and bash scripts. Lack of visibility into these scripts makes it difficult for new developers to onboard and creates variability headaches for security and platform teams.

During setup, you’ll be able to specify development environment basics like your base image and editor plugins through your Dev Container. From there, you’ll be able to define automations in your repository or via our API.


How do automations work?

Automations are defined in configuration YAML files that live alongside your source code, in another repo, or any location accessible from the development environment. You can iterate on automations using the gitpod CLI which is made available by default in every environment.

Gitpod supports two types of Automations:

  • services - for long-running processes like starting a server

  • tasks - for performing one-off actions like executing unit tests

These can be started, stopped and logs can be viewed either using the CLI both internal and external to the development environment or from the main dashboard.

Here’s an example Automations file with a task and service:

language icon yml
services:
    database:
        name: PostgreSQL
        commands:
            start: docker run postgres
tasks:
    run-unit-tests:
        name: Runs unit tests
        command: go test -v ./...

Reload the automations file using:

language icon bash
gitpod automations update [optional-path-to-automations.yaml]

Then start a task or service:

language icon bash
gitpod automations service start …
gitpod automations task start …

Tasks and services can also be launched through the UI so that automations can be provided as simple self-service actions for developers.

Importantly, as we believe that all software development must happen in secure environments that are API accessible, the CLI can interact with automations from outside an environment. For instance, you can stand up an environment and run a task before bringing it down again allowing you to fully automate your workflows.

language icon bash
gitpod environment create https://github.com/some/repo
gitpod automations task start build
gitpod environment stop

Through automations, you now have the building blocks to automate your software development lifecycle, starting with development environments. For more examples on how to use automations, see our docs.

Try automations for free today in Gitpod Flex!

Author
@loujaybee's avatar on GitHub Lou Bichard Product Manager at Gitpod

Last updated

Oct 2, 2024

Helpful resource Gitpod Flex launched on October 1
Standardize and automate your development environments today