https://github.com/sap-cx-actions/commerce-build
Trigger the build in CCv2
https://github.com/sap-cx-actions/commerce-build
Last synced: about 2 months ago
JSON representation
Trigger the build in CCv2
- Host: GitHub
- URL: https://github.com/sap-cx-actions/commerce-build
- Owner: sap-cx-actions
- License: mit
- Created: 2024-08-22T06:49:03.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-11-21T00:03:12.000Z (6 months ago)
- Last Synced: 2025-01-30T00:15:28.429Z (4 months ago)
- Language: TypeScript
- Size: 6.68 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SAP Commerce Cloud - Build
This GitHub Action provides the following functionalities to perform build operations on SAP Commerce Cloud in the
Public Cloud (CCv2) projects.## Project Status
### 🚀 Completed Items
- [x] **Trigger Build**: Trigger SAP Commerce Cloud build.
- [x] **Build Notification**: Sends a notification when a build is triggered in CCv2.
- [x] **Build Status Notification**: Frequently check the build status and send notifications when success or failure.
- [x] **Retry On Failure**: Retry the build creation if it fails for the maxRetries times.
- [x] **Notifications**: Notify the user via email or webhook when the build is triggered or completed.
- [x] Create Build: Triggered with build is created in CCv2.
- [x] Build Completed: Triggered when the build is completed in CCv2 whether it is success or failure.
- [x] Slack: Send notifications to Slack.
- [x] Microsoft Teams: Send notifications to Microsoft Teams.### 🔧 Planned Items
- [ ] **Testing**: Improve test coverage with end-to-end tests.
- [ ] **Notifications**: Notify the user via email or webhook when the build is triggered or completed.
- [ ] Email: Send notifications to email.
- [ ] SendGrid: Send notifications using SendGrid.
- [ ] AWS SES: Send notifications using AWS SES.
- [ ] Custom SMTP: Send notifications using custom SMTP.
- [ ] Similar SMTP services.## Getting Started
See [action.yml](action.yml)
### Prerequisites
- GitHub repository with SAP Commerce Cloud in the Public Cloud (CCv2) project.
- SAP Commerce Cloud in the Public Cloud (CCv2) project with the required configurations.
- Webhook URL (Slack or Microsoft Teams) or email address(es) to send notifications.
- GitHub Actions enabled in the repository.
- GitHub token with the required permissions.
- SAP Commerce Cloud in the Public Cloud (CCv2) API Token.
- SAP Commerce Cloud in the Public Cloud (CCv2) Subscription Code.### Example Workflow
Create a workflow YAML file (e.g., .github/workflows/build.yml) in your repository with the following content:
```yaml
name: Build SAP Commerce Cloudon:
push:
branches:
- 'release/*'jobs:
test-build-action:
name: GitHub Actions Test
runs-on: ubuntu-latestenv:
SAP_CCV2_API_TOKEN: ${{ secrets.SAP_CCV2_API_TOKEN }}
SAP_CCV2_SUB_CODE: ${{ secrets.SAP_CCV2_SUB_CODE }}
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4- name: Test Local Action
id: build-action
uses: sap-cx-actions/commerce-build@v1
with:
branch: release/v1.0.0
buildName: Release v1.0.0
checkStatusInterval: 60000
retryOnFailure: true
maxRetries: 3
notify: true
dryRun: true
timezone: America/New_York- name: Print Output
id: output
run: |
echo "Build Code: ${{ steps.build-action.outputs.buildCode }}, Build Status: ${{ steps.build-action.outputs.buildStatus }}"
```### Environment Variables
| Variable | Purpose | Required |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| SAP_CCV2_API_TOKEN | SAP Commerce Cloud in the Public Cloud (CCv2) [API Token](https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/65e64c9602534b8aaf25bb119670614f.html?locale=en-US). | True |
| SAP_CCV2_SUB_CODE | SAP Commerce Cloud in the Public Cloud (CCv2) Subscription Code | True |
| WEBHOOK_URL | The Webhook URL to send notifications. | False |### Inputs
| Attribute | Purpose | Required | Default | Example |
| ------------------- | ---------------------------------------------------------------------------------------------- | -------- | -------------------- | ---------------- |
| branch | The branch name or tag to trigger the build. | True | | `release/v1.0.0` |
| buildName | The name of the build. | False | | |
| checkStatusInterval | The interval in milliseconds to check the build status. | False | `300000` (5 minutes) | |
| retryOnFailure | Retry the build if failed. | False | `false` | |
| maxRetries | The maximum number of retries. | False | `3` | |
| notify | Send notifications on the build status. | False | `false` | |
| dryRun | Run the action in dry-run mode. If true, the action will not trigger the build in actual CCv2. | False | `false` | |
| timezone | The timezone to use for the timestamps. | False | `America/New_York` | |### Outputs
- `buildCode` - The build code of the triggered build.
- `buildStatus` - The status of the triggered build.