1

I've got a bitbucket pipeline which creates a new scratch org with the following config and then immediately deploys the source into the scratch org.

{
  "orgName": "MyOrg",
  "edition": "Developer",
  "features": [
    "Communities",
    "Sites",
    "PersonAccounts",
    "SiteDotCom",
    "ContactsToMultipleAccounts",
    "ProcessBuilder",
    "ServiceCloud",
    "Knowledge",
    "Entitlements",
    "LightningServiceConsole"
  ],
  "settings": {
    "orgPreferenceSettings": {
      "s1DesktopEnabled": true,
      "networksEnabled": true
    },
    "knowledgeSettings": {
      "enableKnowledge": true
    },
    "entitlementSettings": {
      "enableEntitlements": true
    }
  }
}

As part of the project there is also the site guest user profile with the adequate permissions etc. What I noticed was even though the initial deployment/push is successful (and lists all metadata including the site guest user profile), when I login to the scratch org the CRUD settings are missing on this profile (everything else is there, FLS for example). If I then checkout the branch on my local machine and just do another deploy/push, it updates the profile with the correct CRUD settings.

Initially, upon completion of the pipeline:

enter image description here

Followed by another (second) deploy/push from my local machine:

enter image description here

I tried using both push and deploy:

- sfdx force:source:push -u ${username} -f

- sfdx force:source:deploy -u ${username} -p force-app/main/default/

but getting the same results. Any ideas why could this be happening?

Update:

It turns out there's some sort of delay upon the initial deployment and not all profile settings are saved correctly. I assume this could be due to the site and domain being created and propagated. As a workaround I'm doing 2 separate deployments, one without the profile (initially), and then a subsequent one including the profile:

- mv force-app/main/default/profiles/guest\ Profile.profile-meta.xml .
- sfdx force:source:push -u ${username} -f
- mv guest\ Profile.profile-meta.xml force-app/main/default/profiles/
- sfdx force:source:push -u ${username} -f

Keen to get some insight into why can't everything be deployed at the same time.

0

It turns out that upon the initial deployment of a site/community, there's probably some post-deployment logic executed on the platform which leads to an issue with resolving some dependencies in the deployment package. It's not just the profile CRUD, but I also noticed the same with content assets. I have to initially deploy the site/community without the profiles and content assets, then subsequently deploy those components. This is a workaround and not an answer as to why this is happening. I would still love to see an explanation on what's going on under the hood.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.