Bitbucket Pipelines¶
You can easily publish Live Updates to Capawesome Cloud using Bitbucket Pipelines. 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.
Preparation¶
Before you start, make sure you have a Capawesome Cloud account and an app set up. Next, you need to create a Capawesome Token and add it to your Bitbucket repository as a secure variable.
Create a Capawesome Token¶
Create a new Capawesome token via the Capawesome Cloud Console. 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 Token to your Bitbucket repository as an encrypted secret with the name CAPAWESOME_TOKEN
as described in Variables and secrets.
Pipeline¶
Create the Pipeline¶
Create a new Bitbucket Pipeline file in your repository under bitbucket-pipelines.yml
with the following content:
image: node:20
pipelines:
custom:
deploy-live-update:
- variables:
- name: Channel
- step:
name: Build web assets
caches:
- node
script:
- npm ci
- npm run build
- npx capawesome login --token $CAPAWESOME_TOKEN
- npx capawesome apps:channels:create --appId 00000000-0000-0000-0000-000000000000 --name $Channel || true
- npx capawesome apps:bundles:create --appId 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. Of course, you can also trigger the pipeline automatically by specifying specific Pipeline start conditions.