To be able to trigger Bolt using the API, you will first need to generate API keys for your workspace. Got to account settings and generate your API keys, make sure to save in your password manager:
API key
API secret
API Endpoint
You will need this later when setting up the secrete in Azure pipelines.
# Define when the pipeline should trigger
trigger:
- main # Pipeline will run when changes are pushed to main branch
# Define pipeline-level variables
variables:
# Name of the Paradime schedule/job to run
- name: PARADIME_SCHEDULE_NAME
value: "continuous_deployment_run"
# Define the steps to be executed in this pipeline
steps:
# Step 1: Set up Python environment
- task: UsePythonVersion@0 # Azure DevOps task to configure Python
inputs:
versionSpec: "3.11" # Specify Python version
addToPath: true # Add Python to system PATH
displayName: Use Python 3.11 # Name shown in Azure DevOps UI
# Step 2: Install dependencies and run Paradime job
# Check for latest version of the Paradime Python SDK on https://github.com/paradime-io/paradime-python-sdk/releases
- script: |
# Install Paradime Python SDK
pip install paradime-io==4.7.1
# Export required environment variables for Paradime
# $(VARIABLE) syntax is used to reference Azure Pipeline variables
export PARADIME_API_ENDPOINT=$(PARADIME_API_ENDPOINT)
export PARADIME_API_KEY=$(PARADIME_API_KEY)
export PARADIME_API_SECRET=$(PARADIME_API_SECRET)
# Run the Paradime bolt schedule/job
# --wait flag makes the pipeline wait for completion
paradime bolt run "$(PARADIME_SCHEDULE_NAME)" --wait
displayName: "Run Paradime CD"