Sub topic 4
Enabling DevOps Center and creating a project
This chapter assumes you are a Salesforce admin or developer who knows sandboxes and metadata, understands Git branches and pull requests, and has a GitHub account. By the end, you will have enabled DevOps Center in your org and created a project that points at a repository.
Where DevOps Center runs
DevOps Center is a Salesforce application. It runs in your production org, which acts as the control org. It does not run in a sandbox or on your laptop. The control org stores your projects, pipelines, and work items. It also holds the connections to your environments and to Git.
The setup sequence
1. Enable the feature
Log in to production as an administrator. In Setup, search for DevOps Center and turn the feature on. Salesforce then makes the DevOps Center app available. Check that the app appears in the App Launcher before you continue.
2. Assign permission sets
Enabling the feature does not give anyone access. Assign the DevOps Center permission sets to your users. Release managers need broader rights than developers, so assign them by role. Chapter "Roles, permissions and governance" covers this in detail. For now, give yourself the manager-level set so you can create the project.
3. Prepare the repository
Create an empty repository in GitHub, or pick an existing one that holds Salesforce source. The repository must use the source format that the Salesforce CLI uses. The root file sfdx-project.json tells tools which directory holds your metadata:
{
"packageDirectories": [
{ "path": "force-app", "default": true }
],
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "62.0"
}Add a .forceignore file to keep local tooling files out of deployments:
# .forceignore
**/jsconfig.json
**/.eslintrc.json
**/__tests__/**
.sfdx
.sf4. Create the project
Open the DevOps Center app and choose to create a project. Give it a name, then authorize DevOps Center to reach your GitHub account and select the repository. A project is the container for one release stream. It links one repository to one pipeline, and its work items belong to it.
Common errors
- The app is missing. The feature was not enabled, or you are in a sandbox instead of production.
- The repository does not appear. The GitHub authorization did not cover that repository or organization. Re-authorize and grant access.
- Deployments carry unwanted files. Your
.forceignoreis missing or incomplete. - Users see a blank app. They lack a DevOps Center permission set.
Exercise
A new admin enabled DevOps Center in a full-copy sandbox and cannot find the project setup they expect. What is the likely cause, and what should they do?
Show answer
DevOps Center must be enabled in the production org, which serves as the control org. They should enable it in production, assign the permission sets, and create the project there.