---
title: Publish Live Updates with Bitbucket Pipelines
description: Publish Capacitor and Cordova Live Updates from Bitbucket Pipelines — build your web assets and create a bundle on Capawesome Cloud via the CLI.
---

# Bitbucket Pipelines

You can easily publish Live Updates to Capawesome Cloud using [Bitbucket Pipelines](https://www.atlassian.com/de/software/bitbucket/features/pipelines){:target="_blank"}.
In this guide, we will show you how to create a Bitbucket pipeline that builds your web assets and creates a bundle on Capawesome Cloud using the [Capawesome CLI](../../cli/index.md).

## Preparation

Before you start, make sure you have a Capawesome Cloud account and an app set up. Next, you need to create a Capawesome Cloud token and add it to your Bitbucket repository as a secure variable.

### Create a Capawesome Cloud token

Create a new Capawesome Cloud token via the [Capawesome Cloud Console](https://console.cloud.capawesome.io/settings/tokens){:target="_blank"}. Just navigate to the `Tokens` page in the settings and click on the `Create token` button. Choose a name for the token and click on the `Create` button. The token is now copied to your clipboard.

### Create a Bitbucket Repository Variable

Add the Capawesome Cloud token to your Bitbucket repository as an encrypted secret with the name `CAPAWESOME_CLOUD_TOKEN` as described in [Variables and secrets](https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/){:target="_blank"}.

## Pipeline

### Create the Pipeline

Create a new Bitbucket Pipeline file in your repository under `bitbucket-pipelines.yml` with the following content:

```yaml
image: node:20

pipelines:
  custom:
    deploy-live-update:
      - variables:
          - name: Channel
      - step:
          name: Build web assets
          caches:
            - node
          script:
            - npm ci
            - npm run build
            - npm install -g @capawesome/cli@latest
            - npx @capawesome/cli apps:channels:create --app-id 00000000-0000-0000-0000-000000000000 --name $Channel --ignore-errors
            - npx @capawesome/cli apps:liveupdates:upload --app-id 00000000-0000-0000-0000-000000000000 --path dist --channel $Channel
```

This pipeline will build your web assets, log in to Capawesome Cloud, create a channel (if it does not exist yet), and create a bundle for the specified channel.

### Trigger the Pipeline

You can then trigger the pipeline manually via the Bitbucket Pipelines UI as described in [Scheduled and manually triggered pipelines](https://support.atlassian.com/bitbucket-cloud/docs/pipeline-triggers/){:target="_blank"}. Of course, you can also trigger the pipeline automatically by specifying specific [Pipeline start conditions](https://support.atlassian.com/bitbucket-cloud/docs/pipeline-start-conditions/){:target="_blank"}.
