docs: add PowerShell commands alongside Bash for Windows Terminal users
- Added PowerShell equivalents for all CLI commands - Updated directory navigation for Windows paths - Added note explaining shell differences - Covers: deploy, test, authorization, troubleshooting - Uses env:USERPROFILE for Windows home directory - Shows both backtick continuation and semicolon alternatives for PowerShell
This commit is contained in:
parent
2f7dcf3520
commit
1ff6bb7d76
|
|
@ -2,16 +2,28 @@
|
|||
|
||||
Quick reference for deploying the Salesforce Composite Envelope Builder to your org and running tests.
|
||||
|
||||
> **Shell Note:** Commands below show both **Bash/WSL** and **PowerShell** variants for Windows Terminal. Choose the one that matches your environment. The `sf` CLI commands are identical across both shells.
|
||||
|
||||
---
|
||||
|
||||
## Quick Start (Recommended)
|
||||
|
||||
### Deploy + Test in One Script
|
||||
|
||||
**Bash/WSL:**
|
||||
```bash
|
||||
cd /home/paulh/.openclaw/workspace/projects/salesforce-composite-envelope-builder/composite-envelope-builder
|
||||
bash deploy-to-dev-org.sh
|
||||
```
|
||||
|
||||
**PowerShell (Windows Terminal):**
|
||||
```powershell
|
||||
cd "$env:USERPROFILE\.openclaw\workspace\projects\salesforce-composite-envelope-builder\composite-envelope-builder"
|
||||
bash deploy-to-dev-org.sh
|
||||
# Or if you prefer native PowerShell (not WSL):
|
||||
# .\deploy-to-dev-org.sh (requires WSL bash available)
|
||||
```
|
||||
|
||||
This script handles:
|
||||
- ✅ Org authorization (opens browser login)
|
||||
- ✅ Code deployment
|
||||
|
|
@ -23,6 +35,8 @@ This script handles:
|
|||
## Manual Commands
|
||||
|
||||
### 1. Authorize Your Org (First Time Only)
|
||||
|
||||
**Bash/WSL:**
|
||||
```bash
|
||||
# For Developer Edition
|
||||
sf org login web --alias dev-org --instance-url https://login.salesforce.com
|
||||
|
|
@ -31,18 +45,33 @@ sf org login web --alias dev-org --instance-url https://login.salesforce.com
|
|||
sf org login web --alias sandbox-org --instance-url https://test.salesforce.com
|
||||
```
|
||||
|
||||
**PowerShell (Windows Terminal):**
|
||||
```powershell
|
||||
# For Developer Edition
|
||||
sf org login web --alias dev-org --instance-url https://login.salesforce.com
|
||||
|
||||
# For Sandbox
|
||||
sf org login web --alias sandbox-org --instance-url https://test.salesforce.com
|
||||
```
|
||||
|
||||
You'll be redirected to Salesforce login. Once authorized, the org alias is saved for future deploys.
|
||||
|
||||
---
|
||||
|
||||
### 2. Deploy Code
|
||||
|
||||
**Deploy all code to your org:**
|
||||
**Bash/WSL:**
|
||||
```bash
|
||||
cd /home/paulh/.openclaw/workspace/projects/salesforce-composite-envelope-builder/composite-envelope-builder
|
||||
sf project deploy start --target-org dev-org
|
||||
```
|
||||
|
||||
**PowerShell (Windows Terminal):**
|
||||
```powershell
|
||||
cd "$env:USERPROFILE\.openclaw\workspace\projects\salesforce-composite-envelope-builder\composite-envelope-builder"
|
||||
sf project deploy start --target-org dev-org
|
||||
```
|
||||
|
||||
**Options:**
|
||||
- `--target-org dev-org` — Use the authorized org alias (replace with your alias if different)
|
||||
- `--wait 10` — Wait up to 10 minutes for deployment to complete
|
||||
|
|
@ -52,35 +81,82 @@ sf project deploy start --target-org dev-org
|
|||
### 3. Run Tests
|
||||
|
||||
**Run ALL unit tests with code coverage:**
|
||||
|
||||
Bash/WSL:
|
||||
```bash
|
||||
sf apex run test --wait 10 --result-format human --code-coverage --target-org dev-org
|
||||
```
|
||||
|
||||
PowerShell:
|
||||
```powershell
|
||||
sf apex run test --wait 10 --result-format human --code-coverage --target-org dev-org
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Run ONLY the new handler tests:**
|
||||
|
||||
Bash/WSL:
|
||||
```bash
|
||||
sf apex run test --class-names DocusignEnvelopeRequestHandlerTest --wait 10 --result-format human --target-org dev-org
|
||||
```
|
||||
|
||||
PowerShell:
|
||||
```powershell
|
||||
sf apex run test --class-names DocusignEnvelopeRequestHandlerTest --wait 10 --result-format human --target-org dev-org
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Run specific test methods:**
|
||||
|
||||
Bash/WSL:
|
||||
```bash
|
||||
sf apex run test --class-names DocusignEnvelopeRequestHandlerTest --method-names testValidateRequest_Success --wait 10 --result-format human --target-org dev-org
|
||||
```
|
||||
|
||||
PowerShell:
|
||||
```powershell
|
||||
sf apex run test --class-names DocusignEnvelopeRequestHandlerTest --method-names testValidateRequest_Success --wait 10 --result-format human --target-org dev-org
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Run ALL tests with JSON output (for parsing):**
|
||||
|
||||
Bash/WSL:
|
||||
```bash
|
||||
sf apex run test --wait 10 --result-format json --code-coverage --target-org dev-org > test-results.json
|
||||
```
|
||||
|
||||
PowerShell:
|
||||
```powershell
|
||||
sf apex run test --wait 10 --result-format json --code-coverage --target-org dev-org | Out-File -FilePath test-results.json
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Complete Deploy + Test in One Command
|
||||
|
||||
**Bash/WSL:**
|
||||
```bash
|
||||
cd /home/paulh/.openclaw/workspace/projects/salesforce-composite-envelope-builder/composite-envelope-builder && \
|
||||
sf project deploy start --target-org dev-org && \
|
||||
sf apex run test --wait 10 --result-format human --code-coverage --target-org dev-org
|
||||
```
|
||||
|
||||
**PowerShell (Windows Terminal):**
|
||||
```powershell
|
||||
cd "$env:USERPROFILE\.openclaw\workspace\projects\salesforce-composite-envelope-builder\composite-envelope-builder"; `
|
||||
sf project deploy start --target-org dev-org; `
|
||||
sf apex run test --wait 10 --result-format human --code-coverage --target-org dev-org
|
||||
```
|
||||
|
||||
**Alternative PowerShell (using semicolons):**
|
||||
```powershell
|
||||
cd "$env:USERPROFILE\.openclaw\workspace\projects\salesforce-composite-envelope-builder\composite-envelope-builder"; sf project deploy start --target-org dev-org; sf apex run test --wait 10 --result-format human --code-coverage --target-org dev-org
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Understanding Test Results
|
||||
|
|
@ -158,6 +234,8 @@ After successful deployment, configure your Salesforce org:
|
|||
## Troubleshooting
|
||||
|
||||
### Authorization Issues
|
||||
|
||||
**Bash/WSL:**
|
||||
```bash
|
||||
# If auth fails, try manual URL method:
|
||||
sf org login web --alias dev-org --instance-url https://login.salesforce.com --json
|
||||
|
|
@ -165,7 +243,19 @@ sf org login web --alias dev-org --instance-url https://login.salesforce.com --j
|
|||
# Copy the 'url' value and paste into your browser
|
||||
```
|
||||
|
||||
**PowerShell:**
|
||||
```powershell
|
||||
# If auth fails, try manual URL method:
|
||||
sf org login web --alias dev-org --instance-url https://login.salesforce.com --json
|
||||
|
||||
# Copy the 'url' value from the output and paste into your browser
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Deployment Errors
|
||||
|
||||
**Bash/WSL:**
|
||||
```bash
|
||||
# Check what's in your org
|
||||
sf project list metadata --target-org dev-org
|
||||
|
|
@ -174,12 +264,31 @@ sf project list metadata --target-org dev-org
|
|||
sf project validate deploy --target-org dev-org
|
||||
```
|
||||
|
||||
**PowerShell:**
|
||||
```powershell
|
||||
# Check what's in your org
|
||||
sf project list metadata --target-org dev-org
|
||||
|
||||
# Validate without deploying
|
||||
sf project validate deploy --target-org dev-org
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Test Failures
|
||||
|
||||
**Bash/WSL:**
|
||||
```bash
|
||||
# Run tests with verbose output
|
||||
sf apex run test --target-org dev-org --result-format human --code-coverage -v
|
||||
```
|
||||
|
||||
**PowerShell:**
|
||||
```powershell
|
||||
# Run tests with verbose output
|
||||
sf apex run test --target-org dev-org --result-format human --code-coverage -v
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Reference: Classes Deployed
|
||||
|
|
|
|||
Loading…
Reference in New Issue