├── .eslintignore
├── .forceignore
├── .github
└── workflows
│ ├── pr-develop-branch.yml
│ ├── push-develop-branch.yml
│ └── push-master-branch.yml
├── .gitignore
├── .husky
└── pre-commit
├── .prettierignore
├── .prettierrc
├── .vscode
├── extensions.json
├── launch.json
└── settings.json
├── README.md
├── config
└── project-scratch-def.json
├── force-app
└── main
│ └── default
│ ├── aura
│ ├── .eslintrc.json
│ └── pageTemplate_2_7_3
│ │ ├── pageTemplate_2_7_3.cmp
│ │ ├── pageTemplate_2_7_3.cmp-meta.xml
│ │ ├── pageTemplate_2_7_3.css
│ │ ├── pageTemplate_2_7_3.design
│ │ └── pageTemplate_2_7_3.svg
│ ├── classes
│ ├── ChangePasswordController.cls
│ ├── ChangePasswordController.cls-meta.xml
│ ├── ChangePasswordControllerTest.cls
│ ├── ChangePasswordControllerTest.cls-meta.xml
│ ├── CommunitiesLandingController.cls
│ ├── CommunitiesLandingController.cls-meta.xml
│ ├── CommunitiesLandingControllerTest.cls
│ ├── CommunitiesLandingControllerTest.cls-meta.xml
│ ├── CommunitiesLoginController.cls
│ ├── CommunitiesLoginController.cls-meta.xml
│ ├── CommunitiesLoginControllerTest.cls
│ ├── CommunitiesLoginControllerTest.cls-meta.xml
│ ├── CommunitiesSelfRegConfirmController.cls
│ ├── CommunitiesSelfRegConfirmController.cls-meta.xml
│ ├── CommunitiesSelfRegConfirmControllerTest.cls
│ ├── CommunitiesSelfRegConfirmControllerTest.cls-meta.xml
│ ├── CommunitiesSelfRegController.cls
│ ├── CommunitiesSelfRegController.cls-meta.xml
│ ├── CommunitiesSelfRegControllerTest.cls
│ ├── CommunitiesSelfRegControllerTest.cls-meta.xml
│ ├── ForgotPasswordController.cls
│ ├── ForgotPasswordController.cls-meta.xml
│ ├── ForgotPasswordControllerTest.cls
│ ├── ForgotPasswordControllerTest.cls-meta.xml
│ ├── HeroDetailsPositionCustomPicklist.cls
│ ├── HeroDetailsPositionCustomPicklist.cls-meta.xml
│ ├── MyProfilePageController.cls
│ ├── MyProfilePageController.cls-meta.xml
│ ├── MyProfilePageControllerTest.cls
│ ├── MyProfilePageControllerTest.cls-meta.xml
│ ├── OrderController.cls
│ ├── OrderController.cls-meta.xml
│ ├── PagedResult.cls
│ ├── PagedResult.cls-meta.xml
│ ├── ProductController.cls
│ ├── ProductController.cls-meta.xml
│ ├── ProductRecordInfoController.cls
│ ├── ProductRecordInfoController.cls-meta.xml
│ ├── SiteLoginController.cls
│ ├── SiteLoginController.cls-meta.xml
│ ├── SiteLoginControllerTest.cls
│ ├── SiteLoginControllerTest.cls-meta.xml
│ ├── SiteRegisterController.cls
│ ├── SiteRegisterController.cls-meta.xml
│ ├── SiteRegisterControllerTest.cls
│ ├── SiteRegisterControllerTest.cls-meta.xml
│ ├── TestOrderController.cls
│ ├── TestOrderController.cls-meta.xml
│ ├── TestProductController.cls
│ ├── TestProductController.cls-meta.xml
│ ├── UltimateClass.cls
│ ├── UltimateClass.cls-meta.xml
│ ├── UltimateClassTests.cls
│ └── UltimateClassTests.cls-meta.xml
│ ├── components
│ ├── SiteFooter.component
│ ├── SiteFooter.component-meta.xml
│ ├── SiteHeader.component
│ ├── SiteHeader.component-meta.xml
│ ├── SiteLogin.component
│ ├── SiteLogin.component-meta.xml
│ ├── SitePoweredBy.component
│ └── SitePoweredBy.component-meta.xml
│ ├── lwc
│ ├── .eslintrc.json
│ ├── accountMap
│ │ ├── accountMap.html
│ │ ├── accountMap.js
│ │ └── accountMap.js-meta.xml
│ ├── createCase
│ │ ├── createCase.css
│ │ ├── createCase.html
│ │ ├── createCase.js
│ │ └── createCase.js-meta.xml
│ ├── errorPanel
│ │ ├── errorPanel.js
│ │ ├── errorPanel.js-meta.xml
│ │ └── templates
│ │ │ ├── inlineMessage.html
│ │ │ └── noDataIllustration.html
│ ├── hero
│ │ ├── hero.css
│ │ ├── hero.html
│ │ ├── hero.js
│ │ └── hero.js-meta.xml
│ ├── heroDetails
│ │ ├── heroDetails.css
│ │ ├── heroDetails.html
│ │ ├── heroDetails.js
│ │ └── heroDetails.js-meta.xml
│ ├── ldsUtils
│ │ ├── ldsUtils.js
│ │ └── ldsUtils.js-meta.xml
│ ├── orderBuilder
│ │ ├── orderBuilder.css
│ │ ├── orderBuilder.html
│ │ ├── orderBuilder.js
│ │ └── orderBuilder.js-meta.xml
│ ├── orderItemTile
│ │ ├── orderItemTile.css
│ │ ├── orderItemTile.html
│ │ ├── orderItemTile.js
│ │ └── orderItemTile.js-meta.xml
│ ├── paginator
│ │ ├── paginator.css
│ │ ├── paginator.html
│ │ ├── paginator.js
│ │ └── paginator.js-meta.xml
│ ├── placeholder
│ │ ├── placeholder.css
│ │ ├── placeholder.html
│ │ ├── placeholder.js
│ │ └── placeholder.js-meta.xml
│ ├── productCard
│ │ ├── productCard.css
│ │ ├── productCard.html
│ │ ├── productCard.js
│ │ └── productCard.js-meta.xml
│ ├── productFilter
│ │ ├── productFilter.css
│ │ ├── productFilter.html
│ │ ├── productFilter.js
│ │ └── productFilter.js-meta.xml
│ ├── productListItem
│ │ ├── productListItem.css
│ │ ├── productListItem.html
│ │ ├── productListItem.js
│ │ └── productListItem.js-meta.xml
│ ├── productTile
│ │ ├── productTile.css
│ │ ├── productTile.html
│ │ ├── productTile.js
│ │ └── productTile.js-meta.xml
│ ├── productTileList
│ │ ├── productTileList.css
│ │ ├── productTileList.html
│ │ ├── productTileList.js
│ │ └── productTileList.js-meta.xml
│ └── similarProducts
│ │ ├── similarProducts.css
│ │ ├── similarProducts.html
│ │ ├── similarProducts.js
│ │ └── similarProducts.js-meta.xml
│ ├── pages
│ ├── AnswersHome.page
│ ├── AnswersHome.page-meta.xml
│ ├── BandwidthExceeded.page
│ ├── BandwidthExceeded.page-meta.xml
│ ├── ChangePassword.page
│ ├── ChangePassword.page-meta.xml
│ ├── CommunitiesLanding.page
│ ├── CommunitiesLanding.page-meta.xml
│ ├── CommunitiesLogin.page
│ ├── CommunitiesLogin.page-meta.xml
│ ├── CommunitiesSelfReg.page
│ ├── CommunitiesSelfReg.page-meta.xml
│ ├── CommunitiesSelfRegConfirm.page
│ ├── CommunitiesSelfRegConfirm.page-meta.xml
│ ├── CommunitiesTemplate.page
│ ├── CommunitiesTemplate.page-meta.xml
│ ├── Exception.page
│ ├── Exception.page-meta.xml
│ ├── FileNotFound.page
│ ├── FileNotFound.page-meta.xml
│ ├── ForgotPassword.page
│ ├── ForgotPassword.page-meta.xml
│ ├── ForgotPasswordConfirm.page
│ ├── ForgotPasswordConfirm.page-meta.xml
│ ├── IdeasHome.page
│ ├── IdeasHome.page-meta.xml
│ ├── InMaintenance.page
│ ├── InMaintenance.page-meta.xml
│ ├── MyProfilePage.page
│ ├── MyProfilePage.page-meta.xml
│ ├── SiteLogin.page
│ ├── SiteLogin.page-meta.xml
│ ├── SiteRegister.page
│ ├── SiteRegister.page-meta.xml
│ ├── SiteRegisterConfirm.page
│ ├── SiteRegisterConfirm.page-meta.xml
│ ├── SiteTemplate.page
│ ├── SiteTemplate.page-meta.xml
│ ├── StdExceptionTemplate.page
│ ├── StdExceptionTemplate.page-meta.xml
│ ├── Unauthorized.page
│ ├── Unauthorized.page-meta.xml
│ ├── UnderConstruction.page
│ └── UnderConstruction.page-meta.xml
│ └── staticresources
│ ├── SiteSamples.resource-meta.xml
│ ├── SiteSamples
│ ├── SiteStyles.css
│ └── img
│ │ ├── clock.png
│ │ ├── construction.png
│ │ ├── force_logo.png
│ │ ├── maintenance.png
│ │ ├── poweredby.png
│ │ ├── tools.png
│ │ ├── unauthorized.png
│ │ └── warning.png
│ ├── bike_assets.resource-meta.xml
│ └── bike_assets
│ ├── CyclingGrass.jpg
│ ├── commuter.png
│ ├── enthusiast.png
│ ├── logo.svg
│ └── racer.png
├── jest.config.js
├── manifest
└── package.xml
├── package.json
├── parsePR.js
├── pull_request_template.md
├── scripts
├── apex
│ └── hello.apex
└── soql
│ └── account.soql
└── sfdx-project.json
/.eslintignore:
--------------------------------------------------------------------------------
1 | **/lwc/**/*.css
2 | **/lwc/**/*.html
3 | **/lwc/**/*.json
4 | **/lwc/**/*.svg
5 | **/lwc/**/*.xml
6 | **/aura/**/*.auradoc
7 | **/aura/**/*.cmp
8 | **/aura/**/*.css
9 | **/aura/**/*.design
10 | **/aura/**/*.evt
11 | **/aura/**/*.json
12 | **/aura/**/*.svg
13 | **/aura/**/*.tokens
14 | **/aura/**/*.xml
15 | **/aura/**/*.app
16 | .sfdx
17 |
--------------------------------------------------------------------------------
/.forceignore:
--------------------------------------------------------------------------------
1 | # List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status
2 | # More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm
3 | #
4 |
5 | package.xml
6 |
7 | # LWC configuration files
8 | **/jsconfig.json
9 | **/.eslintrc.json
10 |
11 | # LWC Jest
12 | **/__tests__/**
--------------------------------------------------------------------------------
/.github/workflows/pr-develop-branch.yml:
--------------------------------------------------------------------------------
1 | # Unique name for this workflow
2 | name: Validate PR on develop branch
3 |
4 | # Definition when the workflow should run
5 | on:
6 | # The workflow will run whenever an event happens on a pull request
7 | pull_request:
8 | # The events are that a PR is opened, or when a commit is pushed
9 | # to a branch that has an existing pull request
10 | types: [opened, synchronize]
11 | # The branches filter allows to specify that this workflow should only
12 | # run if the branch name is "develop". This way we prevent this workflow
13 | # from running when PRs are opened on other branches
14 | branches: [ develop ]
15 | # We only care about changes to the force-app directory, which is the
16 | # root directory of the sfdx project. This prevents the job from running
17 | # when changing non-salesforce files (like this yml file).
18 | paths:
19 | - 'force-app/**'
20 |
21 |
22 | # Jobs to be executed when the above conditions are met
23 | jobs:
24 | # This is the name of the job. You can give it whatever name you want
25 | validate-deployment-on-develop-org:
26 | # As mentioned in the blog post, this job runs inside a VM. Here we
27 | # can specify which OS this VM should run on.
28 | # In this case, we are going to run our commands on the latest version
29 | # of ubuntu
30 | runs-on: ubuntu-latest
31 | if: ${{ github.actor != 'dependabot[bot]' }}
32 | steps:
33 | # Now we install nodejs in the VM, and specify version 14
34 | - uses: actions/setup-node@v3
35 | with:
36 | node-version: '14'
37 |
38 | # The idea is that the VM can access your remote repository
39 | # because your repository is an sfdx project.
40 | # This is a default action that allows us to enter the root
41 | # directory of the repository
42 |
43 | # Make sure to specify fetch-depth:0. This allows us to
44 | # access previous commits that have been pushed to the repository.
45 |
46 | # We'll need this later when we try to figure out which metadata has
47 | # changed between commits, so that we can only deploy that metadata
48 | # to the destination org
49 |
50 | - name: 'Checkout source code'
51 | uses: actions/checkout@v3
52 | with:
53 | fetch-depth: 0
54 |
55 | # Now, we need a way to let the developer specify which tests to run, which
56 | # could be all tests or just the tests relevant to their deployment.
57 |
58 | # To do this, we can ask the developer to name their test classes in the
59 | # body of the PR, using the following syntax
60 |
61 | # Apex::[CommunitiesLoginControllerTest,MyProfilePageControllerTest]::Apex
62 | # or Apex::[all]::Apex to run all tests
63 |
64 | # This special delimeter can be added to the PR template so that your
65 | # team doesn't have to remember the syntax.
66 |
67 | # Once a developer has specified a list of classes to run, we need to be able
68 | # to extract this information from the PR, and pass it on the the VM.
69 |
70 | - name: 'Read PR Body'
71 | env:
72 | # The pull request body is available through the github context object
73 | # we put the body of the pull request in an env variable (only available to this step)
74 | PR_BODY: ${{github.event.pull_request.body}}
75 |
76 | # Here we print the content of the environment variable and
77 | # pipe to a a text file.
78 |
79 | # Then we call the local script parsePR.js, which will create
80 | # a new file called testsToRun.txt. This file will have the list
81 | # of tests to run separated by a comma
82 |
83 | # Finally, we add the list of tests to the $GITHUB_ENV variable
84 | # as this allows us to reference the list in a subsequent step. If you
85 | # were using a normal env variable, its value would not be available outside this step.
86 | run: |
87 | echo $PR_BODY > ./pr_body.txt
88 | node ./parsePR.js
89 | TESTS=$(cat testsToRun.txt)
90 | echo "APEX_TESTS=$TESTS" >> $GITHUB_ENV
91 |
92 | # Now Install Salesforce CLI
93 | - name: 'Install Salesforce CLI'
94 | run: |
95 | wget https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.xz
96 | mkdir ~/sfdx
97 | tar xJf sfdx-linux-x64.tar.xz -C ~/sfdx --strip-components 1
98 | echo "$HOME/sfdx/bin" >> $GITHUB_PATH
99 | ~/sfdx/bin/sfdx version
100 |
101 | # Then we install the SFDX-Git-Delta plugin - https://github.com/scolladon/sfdx-git-delta
102 | # This is an awesome plugin that allows us to extract a package.xml with the metadata
103 | # that has changed between commits. I highly recommend going over the github readme
104 | # for more information on how this works.
105 |
106 | - name: 'Installing sfdx git delta'
107 | run: |
108 | echo y | sfdx plugins:install sfdx-git-delta
109 | sfdx plugins
110 |
111 | # Install java as it is required for the next step
112 | - name: 'Installing java'
113 | run: |
114 | sudo apt-get update
115 | sudo apt install default-jdk
116 |
117 | # Install SFDX scanner
118 | - name: 'Installing SFDX scanner'
119 | run: sfdx plugins:install @salesforce/sfdx-scanner
120 |
121 | # Prior to setting up this workflow, you have to create a Github Secret
122 | # that contains the sfdx url of the integration/qa org.
123 |
124 | # The steps to generate the url are here
125 | # https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_auth_sfdxurl.htm
126 |
127 | # This URL can then be used with the sfdx auth:sfdxurl:store to authenticate
128 | # the sfdx project in the repositry, against the org from which the URL
129 | # was generated from. This works just like that, there's no need to create
130 | # connected apps or any else.
131 |
132 | # The URL is stored in the Github Secret named SFDX_INTEGRATION_URL
133 | # so here we store the URL into a text file
134 | - name: 'Populate auth file with SFDX_URL secret of integration org'
135 | shell: bash
136 | run: |
137 | echo ${{ secrets.SFDX_INTEGRATION_URL}} > ./SFDX_INTEGRATION_URL.txt
138 |
139 | # Authenticate to org using the URL stored in the text file
140 | - name: 'Authenticate to Integration Org'
141 | run: sfdx auth:sfdxurl:store -f ./SFDX_INTEGRATION_URL.txt -s -a integration
142 |
143 | # We use SFDX Git Delta to create a directory with only the metadata that has changed.
144 | # this allows us to deploy only those changes, as opposed to deploying the entire branch.
145 | # This helps reducing deployment times
146 | - name: 'Create delta packages for new, modified or deleted metadata'
147 | run: |
148 | mkdir changed-sources
149 | sfdx sgd:source:delta --to "HEAD" --from "HEAD^" --output changed-sources/ --generate-delta --source force-app/
150 |
151 | # Now we can use the sfdx scanner to scan the code in the delta directory
152 | # The output of the scan is stored in a file called apexScanResults.sarif
153 |
154 | # The .sarif file can later be uploaded to github, so that we can see the
155 | # results of the scan directly from the PR.
156 |
157 | - name: 'Scan code'
158 | run: |
159 | cd changed-sources
160 | sfdx scanner:run --format sarif --target './**/*.cls' --category "Design,Best Practices,Performance" --outfile 'apexScanResults.sarif'
161 | cd ..
162 |
163 | # Now we upload the .sarif file as explained in the previous step
164 | - name: Upload SARIF file
165 | uses: github/codeql-action/upload-sarif@v1
166 | with:
167 | sarif_file: changed-sources/apexScanResults.sarif
168 |
169 | # We do a check-only deploy and we only run the tests specified in the PR
170 | # If the env variable does not equal 'all', we know that there is a list of
171 | # tests that can be run
172 |
173 | - name: 'Check-only deploy delta changes - run specified tests'
174 | if: ${{ env.APEX_TESTS != 'all' }}
175 | run: |
176 | echo ${{env.APEX_TESTS}}
177 | sfdx force:source:deploy -p "changed-sources/force-app" --checkonly --testlevel RunSpecifiedTests --runtests ${{env.APEX_TESTS}} --json
178 |
179 | # If the env variable equals all, we run all tests
180 | - name: 'Check-only deploy delta changes - run all tests'
181 | if: ${{ env.APEX_TESTS == 'all' }}
182 | run: |
183 | sfdx force:source:deploy -p "changed-sources/force-app" --checkonly --testlevel RunLocalTests --json
184 |
185 | - name: 'Deploy destructive changes (if any)'
186 | run: sfdx force:mdapi:deploy -d "changed-sources/destructiveChanges" --checkonly --ignorewarnings
187 |
--------------------------------------------------------------------------------
/.github/workflows/push-develop-branch.yml:
--------------------------------------------------------------------------------
1 | # Unique name for this workflow
2 | name: Deploy integration branch to integration and staging/uat orgs
3 |
4 | # Definition when the workflow should run
5 | on:
6 | push:
7 | branches: [ integration ]
8 | paths:
9 | - 'force-app/**'
10 |
11 |
12 | # Jobs to be executed
13 | jobs:
14 | deploy-branch-to-int-and-staging-orgs:
15 | runs-on: ubuntu-latest
16 | if: ${{ github.actor != 'dependabot[bot]' }}
17 | steps:
18 | # Install Salesforce CLI
19 | - name: 'Install Salesforce CLI'
20 | run: |
21 | wget https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.xz
22 | mkdir ~/sfdx
23 | tar xJf sfdx-linux-x64.tar.xz -C ~/sfdx --strip-components 1
24 | echo "$HOME/sfdx/bin" >> $GITHUB_PATH
25 | ~/sfdx/bin/sfdx version
26 |
27 | # install SFDX-Git-Delta plugin - https://github.com/scolladon/sfdx-git-delta
28 | - name: 'Installing sfdx git delta'
29 | run: |
30 | echo y | sfdx plugins:install sfdx-git-delta
31 | sfdx plugins
32 |
33 | # Checkout the source code
34 | - name: 'Checkout source code'
35 | uses: actions/checkout@v3
36 | with:
37 | fetch-depth: 0
38 |
39 | # Store secret for both otgs
40 | - name: 'Populate auth file with SFDX_URL secret of the integration and staging orgs'
41 | shell: bash
42 | run: |
43 | echo ${{ secrets.SFDX_INTEGRATION_URL}} > ./SFDX_INTEGRATION_URL.txt
44 | echo ${{ secrets.SFDX_STAGING_URL}} > ./SFDX_STAGING_URL.txt
45 |
46 | - name: 'Create delta packages for new, modified or deleted metadata'
47 | run: |
48 | mkdir changed-sources
49 | sfdx sgd:source:delta --to "HEAD" --from "HEAD^" --output changed-sources/ --generate-delta --source force-app/
50 |
51 | # Authenticate to org
52 | - name: 'Authenticate to Integration Org'
53 | run: sfdx auth:sfdxurl:store -f ./SFDX_INTEGRATION_URL.txt -s -a integration
54 |
55 | - name: 'Deploy the entire branch to Integration org'
56 | run: sfdx force:source:deploy -p force-app --testlevel RunLocalTests --json
57 |
58 | - name: 'Deploy destructive changes (if any) to Integration org'
59 | run: sfdx force:mdapi:deploy -d "changed-sources/destructiveChanges" --checkonly --ignorewarnings
60 |
61 | # Authenticate to org
62 | - name: 'Authenticate to Staging Org to Staging org'
63 | run: sfdx auth:sfdxurl:store -f ./SFDX_STAGING_URL.txt -s -a staging
64 |
65 | - name: 'Deploy the entire branch'
66 | run: sfdx force:source:deploy -p force-app --testlevel RunLocalTests --json
67 |
68 | - name: 'Deploy destructive changes (if any) to Staging org'
69 | run: sfdx force:mdapi:deploy -d "changed-sources/destructiveChanges" --checkonly --ignorewarnings
70 |
--------------------------------------------------------------------------------
/.github/workflows/push-master-branch.yml:
--------------------------------------------------------------------------------
1 | # Unique name for this workflow
2 | name: Deploy master branch to production org
3 |
4 | # Definition when the workflow should run
5 | on:
6 | push:
7 | branches: [ master ]
8 | paths:
9 | - 'force-app/**'
10 |
11 |
12 | # Jobs to be executed
13 | jobs:
14 | deploy-branch-to-production-org:
15 | runs-on: ubuntu-latest
16 | if: ${{ github.actor != 'dependabot[bot]' }}
17 | steps:
18 | # Install Salesforce CLI
19 | - name: 'Install Salesforce CLI'
20 | run: |
21 | wget https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.xz
22 | mkdir ~/sfdx
23 | tar xJf sfdx-linux-x64.tar.xz -C ~/sfdx --strip-components 1
24 | echo "$HOME/sfdx/bin" >> $GITHUB_PATH
25 | ~/sfdx/bin/sfdx version
26 |
27 | # install SFDX-Git-Delta plugin - https://github.com/scolladon/sfdx-git-delta
28 | - name: 'Installing sfdx git delta'
29 | run: |
30 | echo y | sfdx plugins:install sfdx-git-delta
31 | sfdx plugins
32 |
33 | # Checkout the source code
34 | - name: 'Checkout source code'
35 | uses: actions/checkout@v3
36 | with:
37 | fetch-depth: 0
38 |
39 | # Store secret for production org
40 | - name: 'Populate auth file with SFDX_URL secret of the integration and staging orgs'
41 | shell: bash
42 | run: |
43 | echo ${{ secrets.SFDX_PRODUCTION_URL}} > ./SFDX_PRODUCTION_URL.txt
44 |
45 | - name: 'Create delta packages for new, modified or deleted metadata'
46 | run: |
47 | mkdir changed-sources
48 | sfdx sgd:source:delta --to "HEAD" --from "HEAD^" --output changed-sources/ --generate-delta --source force-app/
49 |
50 | # Authenticate to org
51 | - name: 'Authenticate to Production Org'
52 | run: sfdx auth:sfdxurl:store -f ./SFDX_PRODUCTION_URL.txt -s -a production
53 |
54 | - name: 'Deploy the entire branch to Production org'
55 | run: sfdx force:source:deploy -p force-app --testlevel RunLocalTests --json
56 |
57 | - name: 'Deploy destructive changes (if any) to Production org'
58 | run: sfdx force:mdapi:deploy -d "changed-sources/destructiveChanges" --checkonly --ignorewarnings
59 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # This file is used for Git repositories to specify intentionally untracked files that Git should ignore.
2 | # If you are not using git, you can delete this file. For more information see: https://git-scm.com/docs/gitignore
3 | # For useful gitignore templates see: https://github.com/github/gitignore
4 |
5 | # Salesforce cache
6 | .sf/
7 | .sfdx/
8 | .localdevserver/
9 | deploy-options.json
10 |
11 | # LWC VSCode autocomplete
12 | **/lwc/jsconfig.json
13 |
14 | # LWC Jest coverage reports
15 | coverage/
16 |
17 | # Logs
18 | logs
19 | *.log
20 | npm-debug.log*
21 | yarn-debug.log*
22 | yarn-error.log*
23 |
24 | # Dependency directories
25 | node_modules/
26 |
27 | # Eslint cache
28 | .eslintcache
29 |
30 | # MacOS system files
31 | .DS_Store
32 |
33 | # Windows system files
34 | Thumbs.db
35 | ehthumbs.db
36 | [Dd]esktop.ini
37 | $RECYCLE.BIN/
38 |
39 | # Local environment variables
40 | .env
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | npm run precommit
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | # List files or directories below to ignore them when running prettier
2 | # More information: https://prettier.io/docs/en/ignore.html
3 | #
4 |
5 | **/staticresources/**
6 | .localdevserver
7 | .sfdx
8 | .vscode
9 |
10 | coverage/
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "trailingComma": "none",
3 | "overrides": [
4 | {
5 | "files": "**/lwc/**/*.html",
6 | "options": { "parser": "lwc" }
7 | },
8 | {
9 | "files": "*.{cmp,page,component}",
10 | "options": { "parser": "html" }
11 | }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "salesforce.salesforcedx-vscode",
4 | "redhat.vscode-xml",
5 | "dbaeumer.vscode-eslint",
6 | "esbenp.prettier-vscode",
7 | "financialforce.lana"
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Launch Apex Replay Debugger",
9 | "type": "apex-replay",
10 | "request": "launch",
11 | "logFile": "${command:AskForLogFileName}",
12 | "stopOnEntry": true,
13 | "trace": true
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "search.exclude": {
3 | "**/node_modules": true,
4 | "**/bower_components": true,
5 | "**/.sfdx": true
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # CI/CD for Org Development Model
2 |
3 | This is a sample sfdx project that showcases how to use Github Actions for CI/CD in an org development model (no packages, no scratch orgs).
4 |
5 | Check out the `pr-develop-branch.yml` file under `.github/workflows` for a detailed explanation of the operations that are being automated.
6 |
7 | ## High level flow
8 |
9 | **1-** We have a master branch that represents the metadata we are tracking.
10 |
11 | **2-** At the beginning of a development sprint, we create a develop branch off of main, in the remote repository.
12 |
13 | **3-** Developers clone the repository (which is an sfdx project) to their local computer and authorize the project against their own sandbox (this is a one time step). This is an important and often overlooked feature of sfdx: you can authorize any sfdx project against any org, even if the project was created from a different org.
14 |
15 | **4-** Developers checkout the remote develop branch, and create a feature branch that corresponds to the bug or user story they are working on.
16 |
17 | **5-** Developers push their branch to the remote repository, and continue to push commits as they progress through the development process.
18 |
19 | **6-** Once ready, the developer opens a pull request from the feature branch against the develop branch.
20 |
21 | **7-** The pull request triggers a CI/CD job with Github Actions that will do the following:
22 |
23 | Do a check-only deployment of only the new metadata or the existing metadata that has changed. This deployment will be against the qa/integration org.
24 |
25 | If the deployment passes, run the tests specified by the developer (explained below).
26 |
27 | Scan the apex code for any vulnerabilities or code smells. Log any issues directly in github.
28 |
29 | **8-** If the CI/CD job completes successfully, then the feature branch can be merged into develop.
30 |
31 | **9-** The feature branch is merged into develop, and this triggers an actual deployment of the metadata into the qa/integration org, and again runs the tests specified by the developer.
32 |
33 | **10-** At the end of the sprint, the develop branch is merged into master, and this triggers a production deployment.
34 |
35 |
36 | ## Deploying delta changes
37 |
38 | We are `sfdx-git-delta` to only deploy the metadata that has been changed (or created) by the developer.
39 |
40 | If you want to deploy the entire branch, simply use the `deploy` command against the `force-app` directory.
41 |
42 | ## Specify which tests to run
43 |
44 | We allow the developer to specify which tests to run by using a special syntax in the pull request body
45 |
46 | `Apex::[Class1,Class2,Class3...]::Apex`
47 |
48 | Read `pr-develop-branch.yml` for a detailed description of how this works.
49 |
50 | ## Static code analysis
51 |
52 | We are using the `sfdx scanner` to scan the code in the delta directory.
53 |
54 | We decided not to fail the entire job just because there are warnings. Instead, the warnings are logged directly in the PR for your team to review. We think this is better than failing the job because it allows your team to review the code and have a conversation about it. If the same warning keeps showing up every now and then, then it might be worth to configure the job to fail.
55 |
56 |
--------------------------------------------------------------------------------
/config/project-scratch-def.json:
--------------------------------------------------------------------------------
1 | {
2 | "orgName": "pgonzalez company",
3 | "edition": "Developer",
4 | "features": ["EnableSetPasswordInApi"],
5 | "settings": {
6 | "lightningExperienceSettings": {
7 | "enableS1DesktopEnabled": true
8 | },
9 | "mobileSettings": {
10 | "enableS1EncryptedStoragePref2": false
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/force-app/main/default/aura/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": ["@salesforce/eslint-plugin-aura"],
3 | "extends": ["plugin:@salesforce/eslint-plugin-aura/recommended"],
4 | "rules": {
5 | "vars-on-top": "off",
6 | "no-unused-expressions": "off"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/force-app/main/default/aura/pageTemplate_2_7_3/pageTemplate_2_7_3.cmp:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |