> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/open-source/use-harness-open-source/pipelines-1/stages.md).

# Stages

A stage contains one or more [steps](/open-source/use-harness-open-source/pipelines-1/steps.md).

## Single <a href="#single" id="single"></a>

This pipeline has one stage named `test`.

```yaml
kind: pipeline
spec:
  stages:
  - name: test
    type: ci
    spec:
      steps:
      - name: rake
        type: run
        spec:
          container: ruby
          script: |-
            bundle install --jobs=3 --retry=3
            rake
```

## Multiple <a href="#multiple" id="multiple"></a>

Pipelines can contain multiple stages. The overall build status is determined by the successful completion of all stages.

{% hint style="info" %}
Stages do not share state. It is not possible for two stages to access the same underlying file system or generated files.
{% endhint %}

This pipeline has two stages named `backend` and `frontend`.

```yaml
kind: pipeline
spec:
  stages:
  - name: backend
    type: ci
    spec:
      steps:
      - name: go
        type: run
        spec:
          container: golang
          script: |-
            go build
            go test

  - name: frontend
    type: ci
    spec:
      steps:
      - name: node
        type: run
        spec:
          container: node
          script: |-
            npm install
            npm test
```
