Skip to content

Commit

Permalink
Doc
Browse files Browse the repository at this point in the history
  • Loading branch information
nvuillam committed Sep 11, 2023
1 parent 0f69838 commit fe6c044
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 7 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2660,7 +2660,8 @@ DESCRIPTION

If you do not want to use QuickDeploy, define variable `SFDX_HARDIS_QUICK_DEPLOY=false`

- [Gitlab merge requests notes config](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integration-gitlab/)
- [GitHub Pull Requests comments config](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integration-github/)
- [Gitlab Merge Requests notes config](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integration-gitlab/)
- [Azure PR comments config](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integration-azure/)

### Dynamic deployment items / Overwrite management
Expand Down
Binary file added docs/assets/images/screenshot-gha-success.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions docs/salesforce-ci-cd-setup-integration-github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Configure Integrations between sfdx-hardis and GitHub
description: Post Deployment Status Comments on GitHub Pull Request from CI jobs
---
<!-- markdownlint-disable MD013 -->

## GitHub Pull Requests comments

In order to avoid to have to open job logs to see deployment errors, sfdx-hardis can post them as Comment on the Pull Request UI

To use this capability, all you need is to have **permissions on your workflows** and send your **GITHUB_TOKEN** (see [full example](https://github.com/hardisgroupcom/sfdx-hardis/blob/main/defaults/ci/.github/workflows/process-deploy.yml))

```yaml
permissions:
pull-requests: write

...
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FORCE_COLOR: "1"
```
Everytime you will make a Pull Request, the CI job will post its result as comment !
- Example with deployment success
![](assets/images/screenshot-gha-success.jpg)
- Example with deployment errors
![](assets/images/screenshot-gha-error.jpg)
Notes:
- This integration works with sfdx-hardis pipeline, but also on home-made pipelines, just call [sfdx hardis:source:deploy](https://sfdx-hardis.cloudity.com/hardis/source/deploy/) instead of `sfdx force:source:deploy` !

- This integration use the following variables:

- GITHUB_TOKEN (provided by GitHub but has to be send as option to the deployment jobs)
7 changes: 4 additions & 3 deletions docs/salesforce-ci-cd-setup-integrations-home.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ In order to enhance the user experience, integrations with external tools must b

Depending of your git provider, configure one of the following integrations.

- [GitHub](salesforce-ci-cd-setup-integration-github.md)
- Deployment status in Merge Request notes
- Quick Deploy to enhance performances

- [Gitlab](salesforce-ci-cd-setup-integration-gitlab.md)
- Deployment status in Merge Request notes
- Quick Deploy to enhance performances
Expand All @@ -20,9 +24,6 @@ Depending of your git provider, configure one of the following integrations.
- Deployment status in Pull Request threads
- Quick Deploy to enhance performances

- Github
- Coming soon !

- BitBucket
- Coming soon !

Expand Down
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,10 @@ nav:
- Init from Existing Org: salesforce-ci-cd-setup-existing-org.md
- Integrations:
- Integrations Home: salesforce-ci-cd-setup-integrations-home.md
- Microsoft Teams: salesforce-ci-cd-setup-integration-ms-teams.md
- GitHub: salesforce-ci-cd-setup-integration-github.md
- Gitlab: salesforce-ci-cd-setup-integration-gitlab.md
- Azure DevOps: salesforce-ci-cd-setup-integration-azure.md
- Microsoft Teams: salesforce-ci-cd-setup-integration-ms-teams.md
- First merge request: salesforce-ci-cd-setup-merge-request.md
- Configuration reference: sfdx-hardis-config-file.md
- Deployment errors tips: deployTips.md
Expand Down
5 changes: 3 additions & 2 deletions src/commands/hardis/project/deploy/sources/dx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ In case Pull Request comments are configured on the project, Quick Deploy will t
If you do not want to use QuickDeploy, define variable \`SFDX_HARDIS_QUICK_DEPLOY=false\`
- [Gitlab merge requests notes config](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integration-gitlab/)
- [Azure PR comments config](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integration-azure/)
- [GitHub Pull Requests comments config](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integration-github/)
- [Gitlab Merge requests notes config](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integration-gitlab/)
- [Azure Pull Requests comments config](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integration-azure/)
### Dynamic deployment items / Overwrite management
Expand Down
1 change: 1 addition & 0 deletions src/commands/hardis/source/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Additional to the base command wrapper: If using **--checkonly**, add options **
You can also have deployment results as pull request comments, on:
- GitHub (see [GitHub Pull Requests comments config](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integration-github/))
- Gitlab (see [Gitlab integration configuration](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integration-gitlab/))
- Azure DevOps (see [Azure integration configuration](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integration-azure/))
Expand Down

0 comments on commit fe6c044

Please sign in to comment.