> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pragmatiks.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployment

> Deploy your provider to the Pragmatiks platform

Once your provider passes local tests, deploy it to make your resource types available to users.

## Prerequisites

Before deploying, ensure:

* Your provider has been tested locally with `ProviderHarness`
* You are authenticated: `pragma auth login`
* You are in your provider project directory (contains `pyproject.toml`)

## Build and Deploy

Build and deploy your provider in a single command:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma providers push --deploy
```

This:

1. Uploads your provider code
2. Builds the provider
3. Extracts and registers resource type schemas
4. Deploys the provider

Example output:

```
Pushing provider: mycompany
Source directory: /path/to/mycompany-provider

Created tarball: 12.3 KB
Build started: build-mycompany-abc123
Build successful!

Deployment started: provider-mycompany
Version: 20250115.120000
Status: progressing
```

### Stream Build Logs

To see build output in real-time:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma providers push --logs --deploy
```

### Build Without Deploying

Build only (to verify the build succeeds before deploying):

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma providers push
```

Then deploy when ready:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma providers deploy
```

## Deploy a Specific Version

Deploy a specific version (useful for rollbacks):

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma providers deploy mycompany 20250114.120000
```

List available versions:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma providers builds mycompany
```

## Check Deployment Status

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma providers status mycompany
```

Example output:

```
Provider: mycompany
Deployment: provider-mycompany
Status: available
Replicas: 1/1 ready
Version: 20250115.120000
```

## Verify Deployment

After deployment, verify your resources are available:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
# List your provider's resource types
pragma resources list --provider mycompany
```

Create a test resource to confirm everything works:

```yaml theme={"theme":{"light":"min-light","dark":"min-dark"}}
# test-resource.yaml
provider: mycompany
resource: database
name: test-db
config:
  name: test
  size_gb: 10
```

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma resources apply test-resource.yaml
pragma resources get mycompany/database test-db
```

## Troubleshooting

### "Could not detect provider package"

Run commands from your provider directory, or specify the package explicitly:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma providers push --package mycompany_provider
```

### "Authentication required"

Log in to the platform:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma auth login
```

### Build failed

Check build logs for details:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma providers push --logs
```

Common causes:

* Missing dependencies in `pyproject.toml`
* Syntax errors in provider code
* Invalid resource schemas

### Resource type not found

Ensure your resources are properly decorated:

```python theme={"theme":{"light":"min-light","dark":"min-dark"}}
@provider.resource("database")
class Database(Resource[DatabaseConfig, DatabaseOutputs]):
    ...
```

Resources must be exported from the package's `__init__.py` for discovery.

### Deployment not handling events

Verify the provider is running:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
pragma providers status mycompany
```

If resources remain in PENDING state, check:

* Provider deployed successfully
* Resource configuration is valid
* Dependencies are in READY state

## Complete Deployment Workflow

Here is the typical workflow for deploying provider changes:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
# 1. Run local tests
uv run pytest tests/

# 2. Build and deploy
pragma providers push --deploy

# 3. Verify deployment
pragma providers status mycompany
pragma resources list --provider mycompany
```

For iterative development:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
# Build only (to verify the build succeeds)
pragma providers push

# When ready, deploy
pragma providers deploy
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Lifecycle Methods" icon="rotate" href="/building-providers/lifecycle">
    Implement create, update, and delete operations.
  </Card>

  <Card title="CLI Reference" icon="terminal" href="/cli/providers">
    Full command reference for provider management.
  </Card>
</CardGroup>
