I want to use CI in our company with ANT Migration Tool. In our case TeamCity, but it doesn't matter. We have our Production organization and a few sandboxes. Developer sandbox, QA sandbox, UAT sandbox and then our Production. The question is, when I would like to push changes from DEV sandbox to QA sandbox should I use metadata stored on git or get changes directly from DEV? What is better pratice?
2 Answers
This should be your Example dev cycle
- Pull dev branch from git to get most recent changes
Checkout local feature branch
Push to developer sandbox
Make changes to sandbox (config or code)
Pull from developer sandbox
Commit changes
Repeat last 3 steps until feature is complete
Checkout dev branch
Pull dev branch
If there are changes:
Checkout local branch
Rebase local branch on dev
Handle merge conflicts
Push to developer sandbox (to verify push works)
Commit changes
Checkout dev branch
Merge local branch into dev branch (squash merge preferred to make backing out changes easier)
Push to dev branch
Delete local feature branch
I highly recommend to use git. For your case , i think the best structure would be, get a full copy sandbox for all your developers. Place metadata, classes, pages in git. Developers will work on their local and test their developments in their own sandbox, after they are done ,the will create pull request for all items that they develope, they wont have access to main org.
Once you reviewed , their codes or developments, merge their codes in to the base. Once you merge their developments, set up a jenkins server which is being triggered for every build and give it a task to execute all test classes. Based on test result , you can deploy the changes in production or whereever you want.