### GET /api/v1/setup/preflight
Source: https://bluebricks.co/docs/api/reference/setup
Checks the preflight status of the setup process for the LLM TXT service. This endpoint is used to ensure that all necessary configurations and dependencies are in place before proceeding with further operations.
```APIDOC
## GET /api/v1/setup/preflight
### Description
Checks the preflight status of the setup process for the LLM TXT service. This endpoint is used to ensure that all necessary configurations and dependencies are in place before proceeding with further operations.
### Method
GET
### Endpoint
/api/v1/setup/preflight
### Parameters
#### Query Parameters
#### Request Body
### Request Example
### Response
#### Success Response (200)
- **status** (string) - Indicates the preflight status (e.g., "ready", "pending", "error").
- **message** (string) - A human-readable message providing details about the status.
#### Response Example
{
"status": "ready",
"message": "System is ready for operation."
}
```
--------------------------------
### Download and Prepare Orchestrator in a Box Installation Files
Source: https://bluebricks.co/docs/security/bluebricks-self-hosted-runner/orchestrator-in-a-box
This snippet downloads the necessary installation script and configuration file for Orchestrator in a Box using curl. It then makes the installation script executable. Ensure you have curl installed and internet connectivity.
```bash
curl -O https://brickscli.s3.eu-west-1.amazonaws.com/releases/latest/orchestrator-in-a-box/install.sh
curl -O https://brickscli.s3.eu-west-1.amazonaws.com/releases/latest/orchestrator-in-a-box/config.yaml
chmod +x install.sh
```
--------------------------------
### API Reference - Setup
Source: https://bluebricks.co/docs/llms.txt
Information and actions related to Bluebricks setup.
```APIDOC
## GET /api/reference/setup
### Description
Provides information and links related to the Bluebricks setup process.
### Method
GET
### Endpoint
/api/reference/setup
### Parameters
#### Query Parameters
None
#### Request Body
None
### Response
#### Success Response (200)
- **setup_guide_url** (string) - URL to the detailed setup guide.
- **initial_configuration_options** (array) - Options for initial setup.
#### Response Example
```json
{
"setup_guide_url": "https://docs.bluebricks.com/setup/guide",
"initial_configuration_options": ["cloud_provider_config", "authentication_setup"]
}
```
```
--------------------------------
### Install Orchestrator
Source: https://bluebricks.co/docs/security/bluebricks-self-hosted-runner/orchestrator-in-a-box
Instructions and script for installing the Bluebricks orchestrator using a generated static auth token.
```APIDOC
## Install Orchestrator
### Description
This section details how to install the Bluebricks orchestrator using the provided `install.sh` script. The script requires a static authentication token obtained from the Bluebricks API.
### Method
Shell Script Execution
### Endpoint
N/A (Local script execution)
### Parameters
#### Command Line Arguments
- **--orchestrator-token** (string) - Required - The static authentication token generated by the Bluebricks API.
- **--config-file** (string) - Optional - Path to a custom configuration file (`my-custom-config.yaml`).
- **--k3s-version** (string) - Optional - Specifies the K3s version to install.
- **--namespace** (string) - Optional - The Kubernetes namespace for the orchestrator installation.
- **--release-name** (string) - Optional - The Helm release name for the orchestrator.
- **--uninstall** - Optional - Flag to initiate the uninstallation process.
### Request Example
```bash
/install.sh --orchestrator-token "YourOrchestratorAuthToken"
```
### Response
Upon successful installation, the script will set up the orchestrator and configure `kubeconfig` for cluster interaction. The response is primarily through script output and the creation of Kubernetes resources.
```
--------------------------------
### Verifying Installation
Source: https://bluebricks.co/docs/security/bluebricks-self-hosted-runner/orchestrator-in-a-box
Commands to verify the Bluebricks orchestrator installation by checking Kubernetes pods and logs.
```APIDOC
## Verifying Installation
### Description
Verify that the Bluebricks orchestrator components are running correctly after installation by checking the status of Kubernetes pods and their logs.
### Method
Command Line Interface (kubectl)
### Endpoint
N/A (Local Kubernetes cluster interaction)
### Parameters
#### Environment Variables
- **KUBECONFIG** (string) - Required - Set to `$HOME/.kube/orchestrator-in-a-box-config` to point to the orchestrator's kubeconfig file.
### Commands
#### Check Pods
```bash
export KUBECONFIG="$HOME/.kube/orchestrator-in-a-box-config"
kubectl get pods -n bluebricks
```
#### Check Logs
```bash
export KUBECONFIG="$HOME/.kube/orchestrator-in-a-box-config"
kubectl logs -n bluebricks deployment/bluebricks-deployments-controller-bdc
```
#### Access Kubernetes Dashboard (if enabled)
```bash
export KUBECONFIG="$HOME/.kube/orchestrator-in-a-box-config"
kubectl proxy
```
Then access the dashboard at:
### Response
The output of `kubectl get pods` will list the running pods. `kubectl logs` will display the logs for the specified deployment. Accessing the dashboard will provide a graphical interface to monitor the cluster.
```
--------------------------------
### GET /api/v1/packages
Source: https://bluebricks.co/docs/api/reference/package
Retrieves a list of all available packages. This endpoint lists all packages that can be installed.
```APIDOC
## GET /api/v1/packages
### Description
Retrieves a list of all available packages. This endpoint lists all packages that can be installed.
### Method
GET
### Endpoint
/api/v1/packages
### Response
#### Success Response (200)
- **packages** (array) - A list of available package names.
#### Response Example
```json
{
"packages": [
"example-package",
"another-package",
"utility-library"
]
}
```
```
--------------------------------
### Execute Orchestrator in a Box Installation Script
Source: https://bluebricks.co/docs/security/bluebricks-self-hosted-runner/orchestrator-in-a-box
This command executes the downloaded installation script for Orchestrator in a Box. The script handles prerequisite checks, k3d installation, K3s cluster creation, Kubernetes component installation, Bluebricks Orchestrator deployment via Helm, environment configuration, and displays access information. Ensure the script has execute permissions.
```bash
./install.sh
```
--------------------------------
### Customize Bluebricks Installation with a Configuration File
Source: https://bluebricks.co/docs/security/bluebricks-self-hosted-runner/orchestrator-in-a-box
This command shows how to customize the K3s cluster and orchestrator deployment by providing a custom configuration file to the install.sh script. This allows for advanced configuration before installation.
```bash
./install.sh --config-file my-custom-config.yaml
```
--------------------------------
### Install MCP Server in VS Code
Source: https://bluebricks.co/docs/agentic-infrastructure/bricks-mcp
Provides instructions to manually install the MCP extension for VS Code. This involves searching for 'Model Context Protocol', installing it, and then configuring the 'bricks' MCP server via the command palette.
```plaintext
1. Open VS Code Extensions (`Ctrl+Shift+X` or `Cmd+Shift+X`)
2. Search for "Model Context Protocol"
3. Install the MCP extension
4. Open Command Palette (`Ctrl+Shift+P` or `Cmd+Shift+P`)
5. Run "MCP: Add Server"
6. Configure server:
* **Name**: `bricks`
* **Command**: `bricks`
* **Args**: `["mcp"]`
```
--------------------------------
### Test bricks CLI Installation and Authentication
Source: https://bluebricks.co/docs/bricks-cli/bricks-cli
Commands to verify the installation of the bricks CLI and authenticate with your Bluebricks account. 'bricks --help' shows available commands, and 'bricks login' followed by 'bricks whoami' confirms authentication.
```bash
bricks --help
bricks login
bricks whoami
```
--------------------------------
### Install Bluebricks Deployments Controller using Helm
Source: https://bluebricks.co/docs/security/bluebricks-self-hosted-runner
Installs the Bluebricks Deployments Controller (BDC) chart from the OCI registry using Helm. This command performs a basic installation without custom configurations.
```bash
helm install oci://europe-docker.pkg.dev/bbx-registry-prod/helm/bluebricks-deployments-controller
```
--------------------------------
### Install bricks CLI on Windows 11+
Source: https://bluebricks.co/docs/bricks-cli/bricks-cli
Installs the Bluebricks CLI on Windows 11 and later using PowerShell. This command downloads and executes the installation script.
```powershell
iwr -useb https://brickscli.s3.eu-west-1.amazonaws.com/releases/latest/install.ps1 | iex
```
--------------------------------
### Terraform/OpenTofu HTTP Backend Configuration Example
Source: https://bluebricks.co/docs/core-concepts/packages/artifacts-overview/terraform-open-tofu/develop-terraform-locally
An example of the `backend.tf` file generated by the `bricks bp state-config` command. This configuration specifies the HTTP backend for remote state storage and locking, including addresses, username, and password.
```hcl
terraform {
backend "http" {
address = "https://api.bluebricks.co/api/v1/environments/4cf06f98-.....-8cb88788888/my-sqs-prod/state"
lock_address = "https://api.bluebricks.co/api/v1/environments/4cf06f98-.....-8cb88788888/my-sqs-prod/lock"
password = "your-personal-jwt"
unlock_address = "https://api.bluebricks.co/api/v1/environments/4cf06f98-.....-8cb88788888/my-sqs-prod/lock"
username = "your-temp-access-token"
}
}
```
--------------------------------
### Temporary Terraform/OpenTofu Variables Example
Source: https://bluebricks.co/docs/core-concepts/packages/artifacts-overview/terraform-open-tofu/develop-terraform-locally
An example of a temporary Terraform/OpenTofu variables file (`bbx-terraform-temp.auto.tfvars`) generated by the `bricks bp state-config` command. This file contains properties from the last successful environment run.
```hcl
collection = "prod"
app_name = "my-sqs-topic"
region = "us-west-2"
```
--------------------------------
### Install bricks CLI on Linux and CI/CD Tools
Source: https://bluebricks.co/docs/bricks-cli/bricks-cli
Installs the Bluebricks CLI on Linux systems and for use in CI/CD environments. This script fetches the latest release.
```bash
/bin/bash -c "$(curl -fsSL https://brickscli.s3.eu-west-1.amazonaws.com/releases/latest/install.sh)"
```
--------------------------------
### GET /api/v1/environments
Source: https://bluebricks.co/docs/api/reference/environments
Retrieves a list of all available environments.
```APIDOC
## GET /api/v1/environments
### Description
Retrieves a list of all available environments.
### Method
GET
### Endpoint
/api/v1/environments
### Response
#### Success Response (200)
- **environments** (array) - A list of environment objects.
- **id** (string) - The unique identifier of the environment.
- **slug** (string) - The slug identifier of the environment.
- **name** (string) - The name of the environment.
#### Response Example
```json
{
"environments": [
{
"id": "env-123",
"slug": "production",
"name": "Production Environment"
}
]
}
```
```
--------------------------------
### Install Bluebricks Deployments Controller with Custom Values
Source: https://bluebricks.co/docs/security/bluebricks-self-hosted-runner
Installs the Bluebricks Deployments Controller (BDC) using Helm, applying customizations defined in a local `values.yaml` file. This allows for overriding default chart settings.
```bash
helm install bdc \
oci://europe-docker.pkg.dev/bbx-registry-prod/helm/bluebricks-deployments-controller:1.0.33 \
-f values.yaml
```
--------------------------------
### GET /api/v1/package/props
Source: https://bluebricks.co/docs/api/reference/package
Retrieves properties for all installed packages. This endpoint provides a summary of all packages currently managed by the system.
```APIDOC
## GET /api/v1/package/props
### Description
Retrieves properties for all installed packages. This endpoint provides a summary of all packages currently managed by the system.
### Method
GET
### Endpoint
/api/v1/package/props
### Response
#### Success Response (200)
- **packages** (object) - An object where keys are package names and values are objects containing package properties (e.g., version, installation date).
#### Response Example
```json
{
"packages": {
"example-package": {
"version": "1.2.3",
"installed_at": "2023-10-27T10:00:00Z"
},
"another-package": {
"version": "2.0.0",
"installed_at": "2023-10-26T15:30:00Z"
}
}
}
```
```
--------------------------------
### POST /api/v1/deployments/plans
Source: https://bluebricks.co/docs/api/reference/deployments
Creates a deployment plan.
```APIDOC
## POST /api/v1/deployments/plans
### Description
Creates a deployment plan.
### Method
POST
### Endpoint
/api/v1/deployments/plans
### Parameters
#### Request Body
- **planDetails** (object) - Required - Details of the deployment plan.
- **name** (string) - Required - The name of the plan.
- **resources** (array) - Required - A list of resources for the plan.
### Request Example
```json
{
"planDetails": {
"name": "My New Plan",
"resources": [
{
"type": "server",
"count": 2
}
]
}
}
```
### Response
#### Success Response (200)
- **planId** (string) - The ID of the created deployment plan.
- **message** (string) - A confirmation message.
#### Response Example
```json
{
"planId": "plan-abc",
"message": "Deployment plan created successfully."
}
```
```
--------------------------------
### POST /api/v1/package/install
Source: https://bluebricks.co/docs/api/reference/package
Installs a specified package. This endpoint is used to add new packages to the system.
```APIDOC
## POST /api/v1/package/install
### Description
Installs a specified package. This endpoint is used to add new packages to the system.
### Method
POST
### Endpoint
/api/v1/package/install
### Parameters
#### Request Body
- **packageName** (string) - Required - The name of the package to install.
- **version** (string) - Optional - The specific version of the package to install. If not provided, the latest version will be installed.
### Request Example
```json
{
"packageName": "example-package",
"version": "1.2.3"
}
```
### Response
#### Success Response (200)
- **message** (string) - A confirmation message indicating successful installation.
#### Response Example
```json
{
"message": "Package 'example-package' version '1.2.3' installed successfully."
}
```
```
--------------------------------
### Register Self-Hosted Runner Script
Source: https://bluebricks.co/docs/security/bluebricks-self-hosted-runner/registration-and-authentication
This bash script facilitates the registration of a self-hosted runner with the Bluebricks platform. It verifies the Kubernetes context, guides the user through a wizard to collect necessary details, and establishes the connection to the Bluebricks platform. Ensure you have curl installed to download and execute the script.
```bash
/bin/bash -c "$(curl -fsSL https://brickscli.s3.eu-west-1.amazonaws.com/releases/latest/self-hosted-register.sh)"
```
--------------------------------
### GitHub Actions Workflow for Bricks Action
Source: https://bluebricks.co/docs/workflows/bluebricks-git-repository-guide/getting-started-with-bricks-action
This GitHub Actions workflow automates the updating of artifacts and blueprints using Bricks Action. It checks out the code, runs the 'updateci' command with specified folders and bump types, and uses environment variables for authentication. The workflow is triggered by pull request events and requires specific permissions.
```yaml
name: 'Update Artifacts and Blueprints'
on:
pull_request:
types: [opened, synchronize, reopened]
pull_request_review:
types: [submitted]
permissions:
id-token: write
contents: write
pull-requests: write
jobs:
updateci:
runs-on: ubuntu-latest
if: |
(github.event_name == 'pull_request') ||
(github.event_name == 'pull_request_review' && github.event.review.state == 'approved')
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.event.pull_request.head.ref }} # This is the PR branch
- name: Run updateci Command
uses: bluebricks-co/bricks-action@main
with:
command: 'updateci'
artifacts-folder: 'bluebricks/packages'
blueprints-folder: 'bluebricks/blueprints'
artifact-bump: 'patch'
blueprint-bump: 'patch'
base: 'origin/master'
api-key: ${{ secrets.BRICKS_API_KEY }}
config-file: ${{ github.workspace }}/config-dev.yaml
flags: ${{ github.event_name == 'pull_request' && '--dry' || '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
--------------------------------
### Example Bluebricks Blueprint (YAML)
Source: https://bluebricks.co/docs/core-concepts/packages/blueprints-overview/creating-blueprints
This comprehensive YAML example defines a complete Bluebricks blueprint named 'my_app_stack'. It includes metadata, a required 'region' input, and definitions for three packages (VPC, database, app server) that provision infrastructure. It demonstrates passing values between components using inputs, secrets, and data references, and exposes the app server's public IP as an output.
```yaml
name: my_app_stack
version: 1.0.0
description: Deploys a VPC, database, and app server
tags: [app, vpc, database, server]
inputs:
region:
type: string
allowed_values:
- us-east-1
- us-west-2
packages:
- name: vpc
version: 1.0.0
props:
region: inputs.region
cidr_block: 10.0.0.0/16
- name: database
version: 1.0.0
props:
region: inputs.region
db_user: admin
db_password: secrets.db_password
vpc_id: data.vpc.vpc_id
- name: app_server
version: 1.0.0
props:
db_host: data.database.endpoint
db_user: admin
db_password: secrets.db_password
outputs:
app_server_ip:
description: Public IP of the app server
value: data.app_server.public_ip
```
--------------------------------
### Install bricks CLI on macOS
Source: https://bluebricks.co/docs/bricks-cli/bricks-cli
Installs the Bluebricks CLI on macOS using Homebrew. Ensure Homebrew is installed before running this command.
```bash
brew install bluebricks-co/bricks/bricks
```
--------------------------------
### Complete Blueprint Example: bricks.yaml
Source: https://bluebricks.co/docs/core-concepts/packages/blueprints-overview
This example demonstrates a complete Bluebricks blueprint definition in YAML format. It specifies the blueprint's name, version, description, inputs, packages (VPC, database, app server), and outputs. It showcases how to reference global inputs, hardcoded values, secrets, and outputs from other packages using data references.
```yaml
name: my_app_stack # (Required) Unique blueprint name
version: 1.0.0 # (Required) Semantic version (MAJOR.MINOR.PATCH)
description: Deploys a VPC, database, and app server with secure secret handling # (Optional)
tag: [app, vpc, database, server] # (Optional)
inputs:
region:
type: string
allowed_values:
- us-east-1
- us-west-2
packages:
- name: vpc # Reference to an artifact or blueprint
version: 1.0.0
props:
region: inputs.region # Reference to a global input
cidr_block: 10.0.0.0/16 # Hardcoded value
- name: database
version: 1.0.0
props:
region: inputs.region # Reference to a global input
db_user: admin # Hardcoded value
db_password: secrets.db_password # Secret reference
vpc_id: data.vpc.vpc_id # Data reference to an output of another package
- name: app_server
version: 1.0.0
props:
db_host: data.database.endpoint # Data reference to an output of another package
db_user: admin # Hardcoded value
db_password: secrets.db_password # Secret reference
outputs:
app_server_ip:
description: Public IP address of the app server
value: data.app_server.public_ip # Data reference to an output of a package
```
--------------------------------
### Deploy Infrastructure with Install Command (YAML)
Source: https://bluebricks.co/docs/integrations/githubactions
This GitHub Actions workflow uses the 'install' command to generate deployment plans and apply them. It supports different behaviors for pull requests (plan-only) and manual triggers (full apply). Requires a Bricks API key.
```yaml
name: Deploy Infrastructure
on:
pull_request:
paths:
- 'deployments/**'
workflow_dispatch:
inputs:
collection:
description: 'Target collection'
required: true
default: 'staging'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy with Bricks
uses: bluebricks-co/bricks-action@v1.2.0
with:
command: 'install'
file: './deployments/main.yaml'
env: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.collection || 'staging' }}
plan-only: ${{ github.event_name == 'pull_request' }}
api-key: ${{ secrets.BRICKS_API_KEY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
--------------------------------
### POST /api/v1/environment
Source: https://bluebricks.co/docs/api/reference/environments
Creates a new environment.
```APIDOC
## POST /api/v1/environment
### Description
Creates a new environment.
### Method
POST
### Endpoint
/api/v1/environment
#### Request Body
- **name** (string) - Required - The name of the new environment.
- **slug** (string) - Required - The unique slug for the new environment.
- **description** (string) - Optional - A description for the new environment.
### Request Example
```json
{
"name": "Staging Environment",
"slug": "staging",
"description": "Environment for staging deployments."
}
```
### Response
#### Success Response (201)
- **environment** (object) - Details of the newly created environment.
- **id** (string) - The unique identifier of the environment.
- **slug** (string) - The slug of the environment.
- **name** (string) - The name of the environment.
- **description** (string) - A description of the environment.
- **created_at** (string) - The timestamp when the environment was created.
- **updated_at** (string) - The timestamp when the environment was last updated.
#### Response Example
```json
{
"environment": {
"id": "env_456",
"slug": "staging",
"name": "Staging Environment",
"description": "Environment for staging deployments.",
"created_at": "2023-10-27T11:00:00Z",
"updated_at": "2023-10-27T11:00:00Z"
}
}
```
```
--------------------------------
### Access llms.txt and llms-full.txt for AI Documentation Mapping
Source: https://bluebricks.co/docs/llms.txt
Access the Bluebricks llms.txt and llms-full.txt files. These files provide AI agents with a structured map of the documentation, enabling them to understand and interact with the system more effectively.
```bash
cat llms.txt
cat llms-full.txt
```
--------------------------------
### GET /api/v1/package
Source: https://bluebricks.co/docs/api/reference/package
Retrieves a list of all packages. This endpoint is used to get an overview of available packages.
```APIDOC
## GET /api/v1/package
### Description
Retrieves a list of all packages.
### Method
GET
### Endpoint
/api/v1/package
### Parameters
#### Query Parameters
- **limit** (integer) - Optional - The maximum number of packages to return.
- **offset** (integer) - Optional - The number of packages to skip before starting to collect the result set.
### Request Example
```json
{
"example": "GET /api/v1/package?limit=10&offset=0"
}
```
### Response
#### Success Response (200)
- **packages** (array) - A list of package objects.
- **id** (string) - The unique identifier for the package.
- **name** (string) - The name of the package.
- **version** (string) - The current version of the package.
- **description** (string) - A brief description of the package.
- **enabled** (boolean) - Indicates if the package is currently enabled.
#### Response Example
```json
{
"packages": [
{
"id": "pkg_abc123",
"name": "ExamplePackage",
"version": "1.0.0",
"description": "This is an example package.",
"enabled": true
}
]
}
```
```
--------------------------------
### POST /api/v1/deployment/plan
Source: https://bluebricks.co/docs/api/reference/deployments
Generates an execution plan for a deployment based on provided configuration.
```APIDOC
## POST /api/v1/deployment/plan
### Description
Generates an execution plan for a deployment based on provided configuration.
### Method
POST
### Endpoint
/api/v1/deployment/plan
### Parameters
#### Request Body
- **deploymentId** (string) - Required - The ID of the deployment for which to generate a plan.
- **configuration** (object) - Optional - The configuration details to consider for the plan.
### Response
#### Success Response (200)
- **plan** (string) - A string representation of the generated execution plan.
#### Response Example
```json
{
"plan": "Generated plan details..."
}
```
```
--------------------------------
### Use Custom Flags with Bluebricks Install Command
Source: https://bluebricks.co/docs/integrations/gitlab
Illustrates how to pass custom flags, such as '--dry' and '--debug', to the Bluebricks 'install' command. This allows for more granular control over the installation process.
```yaml
inputs:
command: install
file: deployment/infrastructure.yaml
flags: --dry --debug
```
--------------------------------
### Readiness Probe Configuration
Source: https://bluebricks.co/docs/security/bluebricks-self-hosted-runner/bdc-helm-chart
Configure the readiness probe settings to determine when the application is ready to serve traffic.
```APIDOC
## GET /config/probes/readiness
### Description
Retrieves the current configuration for the readiness probe.
### Method
GET
### Endpoint
/config/probes/readiness
### Parameters
None
### Request Example
None
### Response
#### Success Response (200)
- **probes.readiness.enabled** (bool) - Indicates if the readiness probe is enabled.
- **probes.readiness.failureThreshold** (int) - The number of failures before the probe is considered failed.
#### Response Example
```json
{
"probes.readiness.enabled": true,
"probes.readiness.failureThreshold": 3
}
```
## PUT /config/probes/readiness
### Description
Updates the configuration for the readiness probe.
### Method
PUT
### Endpoint
/config/probes/readiness
### Parameters
#### Request Body
- **probes.readiness.enabled** (bool) - Optional - Indicates if the readiness probe is enabled.
- **probes.readiness.failureThreshold** (int) - Optional - The number of failures before the probe is considered failed.
### Request Example
```json
{
"probes.readiness.enabled": false
}
```
### Response
#### Success Response (200)
- **message** (string) - Confirmation message of the update.
#### Response Example
```json
{
"message": "Readiness probe configuration updated successfully."
}
```
```
--------------------------------
### Install and Run BlueBricks CLI for Deployment
Source: https://bluebricks.co/docs/integrations/azure-devops
This script installs the BlueBricks CLI using a curl command and then executes the 'bricks install' command for planning or deploying environments. It requires the BRICKS_API_KEY environment variable for authentication.
```yaml
pr:
branches:
include:
- main
paths:
include:
- environments/**
variables:
- group: bluebricks-credentials
- name: BRICKS_NON_INTERACTIVE
value: true
stages:
- stage: Plan
displayName: 'Plan deployments'
jobs:
- job: PlanAll
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: |
/bin/bash -c "$(curl -fsSL https://brickscli.s3.eu-west-1.amazonaws.com/releases/latest/install.sh)"
displayName: 'Install bricks CLI'
- ${{ each env in parameters.environments }}:
- script: |
bricks install \
--file ${{ env.file }} \
--plan-only
displayName: 'Plan ${{ env.name }}'
env:
BRICKS_API_KEY: $(BRICKS_API_KEY)
- ${{ each env in parameters.environments }}:
- stage: Deploy_${{ env.name }}
displayName: 'Deploy to ${{ env.name }}'
dependsOn: ${{ env.dependsOn }}
condition: ${{ env.condition }}
jobs:
- deployment: Deploy_${{ env.name }}
pool:
vmImage: 'ubuntu-latest'
environment: bluebricks-${{ env.name }}
strategy:
runOnce:
deploy:
steps:
- checkout: self
- script: |
/bin/bash -c "$(curl -fsSL https://brickscli.s3.eu-west-1.amazonaws.com/releases/latest/install.sh)"
displayName: 'Install bricks CLI'
- script: |
bricks install \
--file ${{ env.file }} \
--yes
displayName: 'Deploy ${{ env.name }}'
env:
BRICKS_API_KEY: $(BRICKS_API_KEY)
```
--------------------------------
### POST /api/v1/env/create
Source: https://bluebricks.co/docs/api/reference/envs
Creates a new environment. This endpoint is used to provision a new environment with specified configurations.
```APIDOC
## POST /api/v1/env/create
### Description
Creates a new environment. This endpoint is used to provision a new environment with specified configurations.
### Method
POST
### Endpoint
/api/v1/env/create
### Parameters
#### Request Body
- **name** (string) - Required - The name of the environment.
- **region** (string) - Required - The region where the environment will be created.
- **framework** (string) - Optional - The framework to be used for the environment.
### Request Example
```json
{
"name": "my-new-env",
"region": "us-east-1",
"framework": "react"
}
```
### Response
#### Success Response (201)
- **id** (string) - The unique identifier of the created environment.
- **name** (string) - The name of the environment.
- **region** (string) - The region of the environment.
#### Response Example
```json
{
"id": "env_abc123",
"name": "my-new-env",
"region": "us-east-1"
}
```
```
--------------------------------
### Run Bricks CLI Commands
Source: https://bluebricks.co/docs/llms.txt
Execute various commands using the Bricks CLI for managing infrastructure. This includes setup, uninstallation, updates, version checks, and user authentication.
```bash
bricks run
bricks setup
bricks uninstall
bricks updateci
bricks version
bricks whoami
```
--------------------------------
### Bricks CLI: Get Blueprint Configuration
Source: https://bluebricks.co/docs/bricks-cli/cli-reference/bricks_blueprint/bricks_blueprint_get
This snippet shows the basic usage of the 'bricks blueprint get' command. It lists the configuration of a provided blueprint and its first level of children. No specific inputs are required beyond the command itself, and the output is the configuration details.
```bash
bricks blueprint get [flags]
```
--------------------------------
### Install Blueprint
Source: https://bluebricks.co/docs/core-concepts/packages/artifacts-overview/terraform-open-tofu/migrate-terraform-state-to-bluebricks
Installs the created blueprint into a deployment within Bluebricks, associating the blueprint with a specific deployment configuration.
```APIDOC
## Install the blueprint
### Description
Installs the blueprint into a deployment in Bluebricks, linking the blueprint to a specific deployment configuration.
### Method
CLI Command
### Endpoint
N/A
### Parameters
#### Path Parameters
N/A
#### Query Parameters
- **collection** (string) - Required - The collection name for the deployment.
- **slug** (string) - Required - The slug for the deployment.
#### Request Body
N/A
### Request Example
```bash
bricks install @ \
--collection devops-pocs \
--slug
```
### Response
#### Success Response (200)
Blueprint installed successfully.
#### Response Example
N/A
```
--------------------------------
### Generate Long-Lived Token Example
Source: https://bluebricks.co/docs/bricks-cli/authentication/authenticate-using-long-lived-tokens
Example of a long-lived token generated by the system. This token is used for authentication purposes.
```json
{
"api_key": "bbx_2b52642255....4ffd"
}
```
--------------------------------
### Bricks CLI Blueprint Get Command
Source: https://bluebricks.co/docs/bricks-cli/cli-reference/bricks_blueprint/bricks_blueprint_get
Lists the configuration (outs or props) of a provided blueprint and its first level of children.
```APIDOC
## Bricks CLI Blueprint Get Command
### Description
Lists the configuration (outs or props) of a provided blueprint and its first level of children.
### Method
CLI Command
### Endpoint
N/A (CLI Command)
### Parameters
#### Global Options (Inherited)
- **--api-key** (string) - Optional - API key for authentication (overrides JWT).
- **--config** (string) - Optional - Config file path (default is $HOME/.bricks/config.yaml).
- **-h, --help** (boolean) - Optional - Print Help message for Bricks CLI.
- **--non-interactive** (boolean) - Optional - Suppresses interactive UI elements for non-interactive environments.
- **-v, --version** (boolean) - Optional - Print bricks CLI version.
### Command Usage
```bash
bricks blueprint get [flags]
```
### Related Commands
- `bricks blueprint get outs`: List outs of the provided blueprint.
- `bricks blueprint get props`: List props of the provided blueprint.
```
--------------------------------
### Access Kubernetes Dashboard
Source: https://bluebricks.co/docs/security/bluebricks-self-hosted-runner/orchestrator-in-a-box
This command sets up a proxy to access the Kubernetes dashboard if it was enabled during installation. It requires the KUBECONFIG environment variable to be set.
```bash
export KUBECONFIG="$HOME/.kube/orchestrator-in-a-box-config"
kubectl proxy
```
--------------------------------
### Bluebricks Plan and Apply Workflow in GitLab CI/CD
Source: https://bluebricks.co/docs/integrations/gitlab
This example demonstrates a two-stage GitLab CI/CD pipeline for Bluebricks deployments. The first stage generates a plan using `plan_only: true`, and the second stage applies the changes when `plan_only: false`. It requires specifying the component version, deployment file, and authentication details.
```yaml
include:
- component: $CI_SERVER_FQDN/bluebricks-dev/workflow/bluebricks@1.0.0
inputs:
stage: plan
command: install
plan_only: true
file: deployment/aws-resources/bricks.yaml
api_key: $BLUEBRICKS_API_KEY
config_file: $BLUEBRICKS_CONFIG
- component: $CI_SERVER_FQDN/bluebricks-dev/workflow/bluebricks@1.0.0
inputs:
stage: apply
command: install
plan_only: false
file: deployment/aws-resources/bricks.yaml
api_key: $BLUEBRICKS_API_KEY
config_file: $BLUEBRICKS_CONFIG
stages:
- plan
- apply
```
--------------------------------
### Bricks CLI Global Options
Source: https://bluebricks.co/docs/bricks-cli/cli-reference/bricks_clouds/bricks_clouds_ls
Demonstrates common global options inherited by Bricks CLI commands, such as specifying an API key for authentication, setting a configuration file path, displaying help messages, running in non-interactive mode, and showing the CLI version.
```bash
# Specify API key for authentication
bricks clouds ls --api-key "your_api_key"
# Specify a custom config file location
bricks clouds ls --config "/path/to/.bricks/config.yaml"
# Display help message for the command
bricks clouds ls --help
# Run in non-interactive mode
bricks clouds ls --non-interactive
# Display the Bricks CLI version
bricks clouds ls --version
```
--------------------------------
### Environment Updated Event Payload Example
Source: https://bluebricks.co/docs/workflows/webhooks
This JSON payload represents an example of the data received when the `environment:updated` event is triggered. It includes details about the webhook, blueprint, environment, collection, and organization involved in the change.
```json
{
"type": "environment:updated",
"webhook": {
"id": "80df0bf0-4b05-4c96-9216-ec5057a71da2",
"scope": "organization",
"scope_id": "org_e5Oh1aexw4OUDZmd"
},
"blueprint": {
"qualified_name": "@bluebricks/eks_core",
"version": "1.12.0"
},
"environment": {
"id": "2a151a4b-874b-46d8-8f34-a803c80a69fe",
"slug": "bluebricks-eks-api-core-us-west-1",
"created_at": "2025-03-02T11:39:36.585Z",
"initiated_by": {
"name": "George Clinton",
"email": "gc@bluebricks.co"
},
"reviewed_by": null,
"changes": {
"stage": "planned",
"archived": null
},
"plan_url": "https://app.bluebricks.co/plan/2a151a4b-874b-46d8-8f34-a803c80a69fe"
},
"collection": {
"id": "4145de0d-bfc4-4df9-a067-c6f06d8f4fb0",
"slug": "staging-us",
"name": "Staging Env / US",
"created_at": "2025-02-04T14:36:57.960Z"
},
"organization": {
"id": "org_e5Oh1aexw4OUDZmd",
"slug": "Bluebricks",
"name": "bluebricks"
}
}
```
--------------------------------
### Public Git Repository URL Formats (Text)
Source: https://bluebricks.co/docs/core-concepts/packages/blueprints-overview/creating-blueprints
Illustrates the supported formats for referencing public Git repositories. These include basic HTTPS URLs and URLs with subdirectories and specific branch/tag references.
```text
git::https://github.com/org/repo.git
git::https://github.com/org/repo.git//subdir?ref=branch
```
--------------------------------
### State API (Write Support)
Source: https://bluebricks.co/docs/changelog/november-2025
Supports creating and updating deployment states via the State API, with compatibility for legacy and base64 identifiers.
```APIDOC
## State API (Write Support)
### Description
Allows for the creation and updating of deployment states. Supports both legacy and base64 encoded identifiers.
### Method
POST /api/v1/state
PUT /api/v1/state/{state_id}
### Endpoint
/api/v1/state
/api/v1/state/{state_id}
### Parameters
#### Path Parameters
- **state_id** (string) - Required - The unique identifier for the state to update.
#### Request Body (POST /api/v1/state)
- **deployment_id** (string) - Required - The identifier of the deployment.
- **state_data** (object) - Required - The state data to be stored.
- **key** (string) - Required - The key for the state data.
- **value** (string) - Required - The value of the state data (can be base64 encoded).
#### Request Body (PUT /api/v1/state/{state_id})
- **state_data** (object) - Required - The updated state data.
- **key** (string) - Required - The key for the state data.
- **value** (string) - Required - The value of the state data (can be base64 encoded).
### Request Example (POST)
```json
{
"deployment_id": "deploy-xyz",
"state_data": {
"key": "terraform_state",
"value": "ewogICAgImZlcnNpb24iOiA..."
}
}
```
### Response
#### Success Response (200 or 201)
- **message** (string) - Confirmation message of the operation.
#### Response Example
```json
{
"message": "Deployment state created successfully."
}
```
```
--------------------------------
### GET /api/v1/deployments/outputs
Source: https://bluebricks.co/docs/api/reference/deployments
Retrieves outputs for all deployments.
```APIDOC
## GET /api/v1/deployments/outputs
### Description
Retrieves outputs for all deployments.
### Method
GET
### Endpoint
/api/v1/deployments/outputs
### Response
#### Success Response (200)
- **outputs** (array) - A list of outputs for all deployments.
#### Response Example
```json
{
"outputs": [
{
"deploymentId": "deployment-123",
"outputName": "output1",
"value": "some_value"
}
]
}
```
```
--------------------------------
### GET /api/v1/collections
Source: https://bluebricks.co/docs/api/reference/collections
Retrieves a list of all collections.
```APIDOC
## GET /api/v1/collections
### Description
Retrieves a list of all collections.
### Method
GET
### Endpoint
/api/v1/collections
### Parameters
(No path or query parameters are specified in the provided text.)
### Request Example
(No request body is expected for a GET request.)
### Response
#### Success Response (200)
(The structure of the success response is not detailed in the provided text.)
#### Response Example
```json
{
"example": "response body"
}
```
```