Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Sync branch with Salesforce Sandbox

Hi,

Has someone tried implementing Continuous Integration for Salesforce using Bitbucket pipelines and SFDX? I cannot keep the repository, UI and my local in sync at the same time. When the pipeline runs, Bitbucket seems to always redownload the repository files thus SFDX thinks the files have changed and it pushes everything again. So even if the files are all the same between repo, Salesforce and my local, when pipeline runs it thinks otherwise and still pushes files instead for sfdx force:source:status to return no results (meaning no change detected).

Thanks in advance.

Romarr 

1 answer

Hi @Romarr Garcia 

Here are some tips to fix the issue you're facing with Bitbucket pipelines and SFDX:

Exclude unnecessary files: Double-check your Bitbucket pipeline settings and make sure you're excluding any files or folders that don't need to be sent to Salesforce. This way, you'll avoid pushing stuff that doesn't need to be pushed.

Leverage Git's file timestamp: Git keeps track of file timestamps, so you can take advantage of that. In your Bitbucket pipeline, compare the modification time of files between your repository and Salesforce. If the timestamps match, it means the files haven't changed, so you can skip the deployment step.

Use Git diffs: Git's diff feature allows you to compare the differences between your local repository and Salesforce. This way, you can pinpoint the specific files that have changed and only deploy those, instead of deploying the whole repository every single time.

Optimize your deployment strategy: Instead of pushing all files each time the pipeline runs, consider using SFDX's incremental deployments. This cool feature lets you deploy only the changes you've made to your Salesforce metadata, rather than everything. It saves time and makes the process more efficient.

By following these tips and tweaking your Bitbucket pipeline configuration and SFDX commands, you'll be able to sync your repository, Salesforce, and your local development environment more smoothly.

Here are some resources which may help -
From Salesforce website:
https://www.salesforce.com/video/3598965/
https://www.youtube.com/watch?v=rqhyU99aU0E

Sample Bitbucket Repo-
https://bitbucket.org/sfdc-cookbook/salesforce-bitbucket-pipelines/src/master/

From Medium articles:
https://medium.com/@maheshchouhan1995/setting-up-salesforce-environment-c4ac75bf1bec
https://medium.com/@maheshchouhan1995/ci-cd-using-bitbucket-pipeline-for-salesforce-part-2-8fe982823e02

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events