Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Confluence: Adding new project to CICD pipelines

...

Downstream deployments (Back Sync)

Expand
titleDownstream deployment process
  1. This process is done after PROD deployments to sync sit and uat branches with master, and uses a “no-commit” branch that is based from master. Use the branch: ALL-noCommitFromMaster.

  2. Make sure to rebase the no-commit branch by running a Git pull command:

Code Block
git pull origin master
  1. Push the commits.

  2. Create a pull request for merging ALL-noCommitFromMaster to sit, and another pull request to merge the same branch to uat.

Recording:

...

Rebase Process (For after sandbox refresh)

Recording: https://unisyd-my.sharepoint.com/:v:/g/personal/bob_alicante_sydney_edu_au/EcZOj_7j9-BMk09Xg2u_D8IBoeJGiE_xYeLxvaKcNbdrLQ?e=V6bscc

...

Expand
titleDeleting branches locally and remotely

Using VS Code

  1. Navigate to Git Graph. Make sure to run fetch from remote(s).

  2. Right-click on a branch and select Delete Branch….

  1. If the branch needs to be deleted on the remote, tick both checkboxes. Otherwise, just click on Yes, delete.

Using the Terminal

  1. To delete a branch locally, run the following command:

Code Block
git branch -d <branch_name>
git branch -D <branch_name>
  • -d is a shortcut for --delete, and -D is a shortcut for --delete --force

  1. To delete a branch remotely, run the following command:

Code Block
git push <remote_branch> -d <branch_name>

...

Destructive changes

Expand
titleDeleting components in the repository
  1. In VS Code, navigate to Explorer. Right-click on the file and select Delete.

Image Added
  1. From the Source Control tab, deleting the file will show up as a file deletion under Changes. Follow the same steps as you would for deploying changes: stage the changes, commit and then push to remote.

Image Added
  1. In Bitbucket, create a pull request to merge the source branch (where the file was deleted locally) to the target branch. Do note that upon merging, the file will be deleted in the target branch, but not on the target environment. Please see the following section: Deleting components in org.

Expand
titleDeleting components in org
  1. As a prerequisite, the target org must be authorized in your VS Code. Please see /wiki/spaces/SNGL/pages/2715779242 for guidance.

Image Added
  1. In VS Code, create a temporary directory in the project source.

Image Added
  1. The destructive changes process requires two files: destructiveChanges.xml and package.xml. The destructiveChanges.xml will contain the components for deletion, and the package.xml must be an empty package file.

Image AddedImage Added
  1. From the Terminal, run the following command:

Code Block
// RECOMMENDED: validate the destructive change first
sfdx force:mdapi:deploy -c -d <folder_name> -l RunLocalTests -w -1
sfdx force:mdapi:deploy -c -d destructiveChangesTAPSS1349 -l RunLocalTests -w -1

// the actual destructive change
sfdx force:mdapi:deploy -d <folder_name> -l RunLocalTests -w -1
sfdx force:mdapi:deploy -d destructiveChangesTAPSS1349 -l RunLocalTests -w -1
  1. This process will initiate a deployment, and thus can be monitored in Setup > Deployment Status.

  2. IMPORTANT: The directory should not be staged as changes and pushed to the branch.

...

Useful SFDX commands

Code Block
// validate multiple files using package.xml
sfdx force:source:deploy -c -x manifest/package.xml -l NoTestRun

// validate a single file
sfdx force:source:deploy -c -p 'force-app\main\default\classes\SampleClass.cls' -l NoTestRun

// retrieve multiple files using package.xml
sfdx force:source:retrieve -x manifest/package.xml

// retrieve a single file
sfdx force:source:retrieve -p 'force-app\main\default\classes\SampleClass.cls'

...