Pipelines First Steps
Last updated on
STACKIT Git Pipelines enable you to automate build, test, and deployment tasks directly within your Git repository. By defining workflows in configuration files, pipelines run automatically when specific events occur, such as pushing code or opening a pull request.
This guide introduces the core concepts of STACKIT Git Pipelines and shows how to create and run your first workflow.
Prerequisites
Section titled “Prerequisites”Before creating your first pipeline, make sure the following requirements are met:
- You have a STACKIT Git instance.
- You have created a repository.
- You can push commits to the repository.
If you have not created a repository yet, follow the guide: Create your first Git service
Core concepts
Section titled “Core concepts”To effectively use STACKIT Git Pipelines, it is important to understand the following components.
Workflow
Section titled “Workflow”A workflow is an automated process that runs one or more jobs. Workflows are defined in YAML files and stored in the repository.
Workflow files must be located in the following directory:
.forgejo/workflows/Each workflow defines:
- When it should run.
- Which jobs should execute.
- Which steps each job performs.
An event triggers a workflow run.
Typical events include:
push– triggered when code is pushed to a branch.pull_request– triggered when a pull request is opened or updated.workflow_dispatch– manually triggered workflow.
A job groups a set of steps that run on the same runner.
Key characteristics:
- Each job runs in its own execution environment.
- Jobs run in parallel by default.
- Jobs can depend on other jobs.
A step represents a single task executed within a job.
Steps can:
- Run shell commands.
- Execute reusable actions.
- Perform build or test tasks.
Runner
Section titled “Runner”A runner is the environment where jobs are executed.
STACKIT Git Pipelines can run on:
- STACKIT managed runners.
- Custom runners hosted by you.
Runners are selected using labels.
Your first pipeline
Section titled “Your first pipeline”In this section you will create a simple workflow that runs whenever code is pushed to the repository.
-
Open your local repository.
-
Create the workflow directory if it does not exist.
mkdir -p .forgejo/workflows -
Create a workflow file.
.forgejo/workflows/hello.yaml -
Add the following workflow configuration.
name: Hello Worldon: [push]jobs:my-first-job:runs-on: stackit-linuxsteps:- name: Say Hellorun: echo "Welcome to STACKIT Pipelines" -
Commit the new workflow file.
git add .forgejo/workflows/hello.yamlgit commit -m "Add first pipeline workflow" -
Push the changes to your repository.
git push
View the pipeline run
Section titled “View the pipeline run”After pushing the workflow file, the pipeline is automatically triggered.
To view the pipeline run:
- Open your STACKIT Git repository.
- Navigate to the Actions or Pipelines section.
- Select the latest workflow run.
- Inspect the job logs and execution steps.
You should see the message:
Welcome to STACKIT PipelinesNext steps
Section titled “Next steps”Now that your first pipeline is running, you can explore more advanced features:
- Configure multiple jobs and dependencies.
- Run pipelines on custom runners.
- Integrate with STACKIT services.