Azure DevOps¶
You can easily publish Live Updates to Capawesome Cloud using Azure Pipelines. In this guide, we will show you how to create a Azure 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 Azure Pipeline 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 Azure Pipeline Variable¶
Add the Capawesome Token to your Azure Pipeline as a secure variable with the name CAPAWESOME_TOKEN
as described in Set secret variables.
Pipeline¶
Create the Pipeline¶
Create a new Azure Pipeline file in your repository under azure-pipelines.yml
with the following content:
trigger: none
parameters:
- name: channel
displayName: Channel
type: string
pool:
vmImage: ubuntu-latest
jobs:
- job: Deploy
displayName: Build web assets
steps:
- checkout: self
displayName: Checkout
- task: UseNode@1
inputs:
version: 20.x
displayName: Install Node.js
- script: npm ci
displayName: Install Dependencies
- script: npm run build
displayName: Build web assets
- script: npx capawesome login --token $env:CAPAWESOME_TOKEN
displayName: Login to Capawesome Cloud
env:
CAPAWESOME_TOKEN: $(CAPAWESOME_TOKEN)
- script: npx capawesome apps:channels:create --appId 00000000-0000-0000-0000-000000000000 --name $env:CHANNEL || true
displayName: Create a channel on Capawesome Cloud
env:
CHANNEL: ${{ parameters.channel }}
- script: npx capawesome apps:bundles:create --appId 00000000-0000-0000-0000-000000000000 --channel $env:CHANNEL --path dist
displayName: Create a bundle on Capawesome Cloud
env:
CHANNEL: ${{ parameters.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 by running it in the Azure Pipelines UI or by using the Azure Pipelines API. You will be prompted to enter the channel name. Of course, you can also trigger the pipeline automatically by specifying a different trigger.