Skip to content

Commit da5c98b

Browse files
committed
DO-1743: update CST endpoint format to use project key structure
Changed CST reporting to use correct endpoint format: - Added cst-project-key input and CST_PROJECT_KEY workspace variable - Constructs full URL as: {endpoint}/{project-key}/adobe-commerce - Hardcoded adobe-commerce path as requested - Updated documentation with new format and workspace variables section - Added example using generic project key structure
1 parent e01ebdf commit da5c98b

File tree

2 files changed

+38
-12
lines changed

2 files changed

+38
-12
lines changed

.github/workflows/magento-cloud-deploy.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ on:
4848

4949
# CST Reporting Configuration
5050
cst-endpoint:
51-
description: "CST endpoint URL (optional, overrides workspace variable)"
51+
description: "CST endpoint base URL (optional, overrides workspace variable)"
52+
type: string
53+
required: false
54+
default: ""
55+
cst-project-key:
56+
description: "CST project key (optional, overrides workspace variable)"
5257
type: string
5358
required: false
5459
default: ""
@@ -404,29 +409,38 @@ jobs:
404409
CST_ENDPOINT="${{ vars.CST_ENDPOINT }}"
405410
fi
406411
412+
# Determine CST project key - input overrides workspace variable
413+
CST_PROJECT_KEY="${{ inputs.cst-project-key }}"
414+
if [ -z "$CST_PROJECT_KEY" ]; then
415+
CST_PROJECT_KEY="${{ vars.CST_PROJECT_KEY }}"
416+
fi
417+
407418
# Determine CST reporting key - input overrides workspace secret
408419
CST_KEY="${{ inputs.cst-reporting-key }}"
409420
if [ -z "$CST_KEY" ]; then
410421
CST_KEY="${{ secrets.cst-reporting-token }}"
411422
fi
412423
413-
# Only run CST reporting if both endpoint and key are available
414-
if [ -n "$CST_ENDPOINT" ] && [ -n "$CST_KEY" ]; then
424+
# Only run CST reporting if endpoint, project key, and auth key are available
425+
if [ -n "$CST_ENDPOINT" ] && [ -n "$CST_PROJECT_KEY" ] && [ -n "$CST_KEY" ]; then
415426
echo "📡 Reporting deployment to CST (Confidentiality and Security Team)..."
416427
428+
# Construct full CST URL: endpoint/project_key/adobe-commerce
429+
CST_FULL_URL="${CST_ENDPOINT}/${CST_PROJECT_KEY}/adobe-commerce"
430+
417431
# Send composer.lock file contents to CST endpoint
418432
if [ -f "composer.lock" ]; then
419-
curl -X POST "${CST_ENDPOINT}/deployments" \
433+
curl -X POST "${CST_FULL_URL}" \
420434
-H "Authorization: Bearer ${CST_KEY}" \
421435
-H "Content-Type: application/octet-stream" \
422436
--data-binary @composer.lock
423437
424-
echo "✅ Deployment reported to CST systems"
438+
echo "✅ Deployment reported to CST systems at ${CST_FULL_URL}"
425439
else
426440
echo "⚠️ composer.lock not found, skipping CST reporting"
427441
fi
428442
else
429-
echo "ℹ️ CST reporting skipped (no endpoint or key configured)"
443+
echo "ℹ️ CST reporting skipped (missing endpoint, project key, or auth key)"
430444
fi
431445
432446
- name: Create NewRelic deployment marker (complete)

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ A comprehensive Magento Cloud deployment workflow supporting multi-environment d
6161
| **Monitoring and Reporting** |
6262
| newrelic-app-id | ❌ | string | | NewRelic application ID for deployment markers (optional) |
6363
| **CST Reporting Configuration** |
64-
| cst-endpoint | ❌ | string | | CST endpoint URL (optional, overrides workspace variable) |
64+
| cst-endpoint | ❌ | string | | CST endpoint base URL (optional, overrides workspace variable) |
65+
| cst-project-key | ❌ | string | | CST project key (optional, overrides workspace variable) |
6566
| cst-reporting-key | ❌ | string | | CST reporting key (optional, overrides workspace secret) |
6667
| **Advanced Configuration** |
6768
| debug | ❌ | boolean | false | Enable verbose logging and debug output |
@@ -73,6 +74,12 @@ A comprehensive Magento Cloud deployment workflow supporting multi-environment d
7374
| newrelic-api-key | ❌ | NewRelic API key for deployment markers (optional) |
7475
| cst-reporting-token | ❌ | CST reporting token (workspace-level secret, optional) |
7576
77+
#### **Workspace Variables (Optional)**
78+
| Name | Description |
79+
|------|-------------|
80+
| CST_ENDPOINT | CST endpoint base URL (e.g., `https://package.report.aligent.consulting`) |
81+
| CST_PROJECT_KEY | CST project identifier for your organization |
82+
7683
#### **Outputs**
7784
| Name | Description |
7885
|------|-------------|
@@ -149,8 +156,9 @@ jobs:
149156
with:
150157
magento-cloud-project-id: abc123def456
151158
environment: staging
152-
cst-endpoint: "https://cst.example.com" # Overrides workspace variable
153-
cst-reporting-key: "custom-key-123" # Overrides workspace secret
159+
cst-endpoint: "https://package.report.aligent.consulting" # Overrides workspace variable
160+
cst-project-key: "your-project-key" # Overrides workspace variable
161+
cst-reporting-key: "custom-key-123" # Overrides workspace secret
154162
secrets:
155163
magento-cloud-cli-token: ${{ secrets.MAGENTO_CLOUD_CLI_TOKEN }}
156164
```
@@ -160,16 +168,20 @@ jobs:
160168
The CST (Confidentiality and Security Team) reporting feature can be configured in two ways:
161169

162170
1. **Workspace-level configuration (recommended):**
163-
- Set `CST_ENDPOINT` as a repository/organization variable
171+
- Set `CST_ENDPOINT` as a repository/organization variable (base URL, e.g., `https://package.report.aligent.consulting`)
172+
- Set `CST_PROJECT_KEY` as a repository/organization variable (your project identifier)
164173
- Set `cst-reporting-token` as a repository/organization secret
165174
- The workflow will automatically use these when available
166175

167176
2. **Input overrides (optional):**
168-
- Use `cst-endpoint` input to override the workspace variable
177+
- Use `cst-endpoint` input to override the workspace variable (base URL)
178+
- Use `cst-project-key` input to override the workspace variable (project identifier)
169179
- Use `cst-reporting-key` input to override the workspace secret
170180
- Useful for testing or special deployments
171181

172-
CST reporting only runs when both endpoint and key are configured. If either is missing, the step is skipped with an informational message.
182+
The workflow constructs the full CST URL as: `{endpoint}/{project-key}/adobe-commerce`
183+
184+
CST reporting only runs when endpoint, project key, and auth key are all configured. If any are missing, the step is skipped with an informational message.
173185

174186
### Nx Serverless Deployment
175187

0 commit comments

Comments
 (0)