SAP Commerce Cloud - Deploy
Ce contenu n’est pas encore disponible dans votre langue.
This GitHub Action provides the following functionalities to perform deployment operations on SAP Commerce Cloud in the Public Cloud (CCv2) projects.
Project Status
Section titled “Project Status”🚀 Completed Items
Section titled “🚀 Completed Items”- Trigger Deployment: Trigger SAP Commerce Cloud deployment.
- Deployment Notification: Sends a notification when a deployment is triggered in CCv2.
- Deployment Status Notification: Frequently check the deployment status and send notifications when success or failure.
- Notifications: Notify the user via email or webhook when the build is triggered or completed.
- Trigger Deployment: Triggered with deployment is created in CCv2.
- Deployment Completed: Triggered when the deployment is completed in CCv2 whether it is success or failure.
- Slack: Send notifications to Slack.
- Microsoft Teams: Send notifications to Microsoft Teams.
🔧 Planned Items
Section titled “🔧 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.
- Deployment Progress: Check the deployment status and send notifications. (Is it required?)
- 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
Section titled “Getting Started”Check this GitHub Action on the GitHub Marketplace
Example Workflow
Section titled “Example Workflow”Create a workflow YAML file (e.g., .github/workflows/deploy.yml) in your repository with the following content:
name: Deploy SAP Commerce Cloud
on: push: branches: - main - 'release/*' pull_request: branches: - main
jobs: deploy: runs-on: ubuntu-latest
env: 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 repository uses: actions/checkout@v2
- name: SAP Commerce Deployment id: deploy-action uses: sap-cx-actions/commerce-deploy@v1 with: buildCode: '20240910.1' environmentCode: 'd1' databaseUpdateMode: 'UPDATE' deploymentMode: 'ROLLING_UPDATE' notify: true dryRun: false timezone: America/New_York
- name: Print Output id: output run: | echo "Deployment Code: ${{ steps.deploy-action.outputs.deploymentCode }}, Deployment Status: ${{ steps.deploy-action.outputs.deploymentStatus }}"Environment Variables
Section titled “Environment Variables”| Variable | Purpose | Required |
|---|---|---|
| SAP_CCV2_API_TOKEN | SAP Commerce Cloud in the Public Cloud (CCv2) API Token. | 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
Section titled “Inputs”| Attribute | Purpose | Required | Default | Example |
|---|---|---|---|---|
| buildCode | The build code to deploy, output from the @sap-cx-actions/commerce-build. | True | ||
| environmentCode | The environment code to deploy. | True | d1, s1, p1 | |
| databaseUpdateMode | The database update mode. | True | NONE, UPDATE, INITIALIZE | |
| deploymentMode | The deployment strategy. | True | ROLLING_UPDATE, RECREATE, GREEN | |
| notify | Send notifications to the provided destination. | False | false | true, false |
| dryRun | Run the action in dry-run mode. If true, the action will not trigger the deployment in actual CCv2. | False | false | false |
| timezone | The timezone to use for the timestamps. | False | America/New_York |
Outputs
Section titled “Outputs”deploymentCode- The deployment code of the current deployment.deploymentStatus- The status of the triggered deployment.