7

I have been using MavensMate with Sublime Text by myself with one salesforce sandbox org. I store my code in Bitbucket.

Now I will be working in two different orgs and will add multiple developers. Eventually we will be merging into one org but for now they are separate organizations.

A few questions:

  1. Do any of the sublime configuration files get shared among developers, should they be in source control or should each developer have their own project configuration files? If shared, which specific files?

  2. How do I create a MavensMate project for the second org? I have loaded it onto my file system with ant migration tool. I copied the folder into MavensMate and selected new project but the window that opens has the name of my other repository, not the new one and I do not see how to change it.

There does not seem to be a way to close one project and open another so I am confused on how to work on two separate projects in two separate repositories.

Additional Info: I have gotten the answer I need for question 1, thank you for all the replies.

For my directory structure what I have is :

my bitbucketfolder
    non SF Project1
    non SF Project2
    SF org repo
            project folder A
                    src
                    config
                    debug
                    project A.sublime-project
            prod metadata
                    appmenus
                    approvalprocesses
                    ...
            full sandbox metadata
                    appmenus
                    approvalprocesses
                    ...
    New org repo
            project folder B
                    src
                    debug
                    config  

My mm workspace is "SF org repo" When I created the MavensMate project for project B, it was moved into this workspace and deleted from "New org repo".

What I think I need is to have 2 different mm workspaces but I do not see a way in the "create mavensmate project" to select a different one.

I have tried moving the workspace config into the project settings for project instead of the user settings and it did not work (error: "Please ensure mm_workspace is set to existing location(s) on your local drive"). I have tried putting 2 workspace paths in the user settings and I get parse errors when I try to save the settings on the line following the mm_workspace.

1
  1. You should only share the package.xml, the src/ folder, and any project specific files. It is a good idea to .gitignore all of deploy/ apex-scripts/ config/.
  2. You can open the folder in Sublime, and in the tree nav, right click the top level folder that contains src/ and create a project. Your top level folder should already be in your workspace folder, and it should not have the name of another existing project.

Leveraging a tool like CumulusCI may significantly help your development process.

  • I guess my confusion comes from my recent work in .Net where the project and solution files must be in the repository to share as they are integral for building. So it seems the sublime config files are only for my local use.. Other devs could use a different IDE then. The package.xml is the only file needed by SF. – Maggie Oct 27 '15 at 14:08
  • I do want to get to the point of using CI, having used TeamCity and Cruise Control for other projects, it seemed that Cumulus was geared to managed package development. – Maggie Oct 27 '15 at 14:15
  • If you don't need the heaviness of CumulusCI, you can certainly just use the Force.com Migration Tool ant plugin and a CI server of your choice. And indeed, the config files are only for local use (they mostly contain a cache of metadata). – Christian Carter Oct 28 '15 at 3:19
  • Thanks. We will definitely set up a CI server when we get onto one org after the merge of our two. – Maggie Oct 28 '15 at 13:42
3

This is great question.

Here is how we can set them

  1. Every developer has their own org and provide a unique branch to each of them on git or bit bucket
  2. Keep a master branch where each individual dev will submit pull request and on each pull request you will merge them into master branch.
  3. Set up an automated process on the master branch to compile the code and do an automated build to confirm that merge is valid and code broke nothing.

If you have tools like CumulusCI or CircleCI life is easy to set up automation.

You can create multiple projects in mavensmate and should not be any difficulty. It will open in separate windows.

Answering precisely:

  1. Its not best practice to share sublime text configurations. Maybe you can share the project default settings but since every user can again personalize its not best to share those or version those

  2. Currently way Mavensmate works is you have to create your project. In eclipse we had option to add force.com project behavior. But in mavens seems to be no way.

  • Thanks, I understand these concepts but they do not answer my question. I know how to do branching and manage multiple users to a repository. – Maggie Oct 26 '15 at 19:31
  • Edited answer to make it precise – Mohith Shrivastava Oct 26 '15 at 19:41
2

Creating a new project and having multiple git repos is a pretty straight forward task in terms of MavensMate, SublimeText, SourceTree (assuming you use a git ui for commits), etc. It doesn't sound like you are doing continuous integration or any actual building on the repo side, so this should be pretty easy for you and anyone else to adapt to, especially given you have experience using the tools already.

I like to start with a standard folder that will hold all my Source-Controlled projects. For now, we will call it SalesforceSource. Within SalesforceSource, I will keep git clones of any projects i am currently working on in any of my git repos. So inside of SalesforceSource, we may see Dev1 and Dev2, where each holds different metadata for two different orgs, and are synced up to two different git repos. This allows for one root folder to hold all my different git projects and keep things "clean" on the folder structure side.

At this point i would assume you already know how to take a full retrieve of an org and move it into a repo in source control (using the ant migration tool as noted). From here, i actually like to switch over to SourceTree to manage my git stuff before i create my project in MavensMate. So as noted earlier with Dev1 and Dev2, I would actually create those two folders under SalesforceSource using SourceTree and let it handle bringing down all the git stuff with it. What i end up with after pulling down Dev1 and Dev2 from different repos are two different folders of Salesforce Metadata that i can actually convert into different MavensMate projects and connect them directly to their respective orgs using the MavensMate UI. You can do this super easily by simply opening those cloned folders from SourceTree into SublimeText, and then create a MavensMate project by right clicking on the root of that folder structure and creating a new MavensMate project from them.

In Sublime, go to File>New Window

enter image description here

In the new window, go to File>Open Folder

enter image description here

Open whatever folder is the clone of your repo. Mine here is MonkeyBox. (note I'm only showing SourceTree here so you can see how that clone should be setup. You don't actually have to go to SourceTree in this step)

enter image description here

Right click on the folder root and select MavensMate>Create MavensMate Project

enter image description here

As far as your questions are concerned, keep sublime settings out of source control. There is no need to store people's personal configurations server side, especially when sharing code with other devs. Leave those local, and i would add them to the gitignore to make sure they dont come across accidentally or you may end up pointing someones project to the wrong default workspace or something of the sort.

When working with other developers, you typically DONT commit against master all the time. A lot of devs i know are used to just committing to master but i think this is bad practice for multidev environments. If you are using git for a fancy backup solution, its fine, but working with multiple devs you can step on each other's toes super fast always overwriting master. A typical CI development cycle would have developers check out master, create a branch for the ticket or change they are doing, do the change and submit a pull request for it to be merged with master, merge into master upon approval, and then repeat the cycle. So in simple terms, create branches for every change you are going to make as a dev AFTER you pull anything else other people have done from master.

Feel free to ask if you have any specific questions. I think i have a general dev cycle with git flow i may be able to find on my other pc, and i have a training video i give to my devs that literally covers this entire process step by step, with example changes being made in a dev org and pushed into a single sourced controlled org.

  • Thanks, yes I have a folder for all of my repos and do branch for feature and bugs. I use both SourceTree and command-line git as needed. "You can do this super easily by simply opening those cloned folders from SourceTree into SublimeText," I would like to do this but do not know where in SourceTree (which tool window or menu) I can use to select a folder to open. The way I use it I only see the files that have changed and not folders. – Maggie Oct 27 '15 at 14:25
  • @Maggie I added some screenshots that should hopefully help with the SublimeText and MavensMate project piece. I think this is what you were asking how to do? If not, feel free to clarify and I can update accordingly. – cricketlang Oct 27 '15 at 16:43
  • No, I was wanting to know how to launch a project in sublime text from SourceTree. That is what I thought you meant by your statement. I have been able to create the mavensmate project for the new org but it moved all of my files into the folder of my other project. I think I need multiple workspaces and am trying to figure this out now. – Maggie Oct 27 '15 at 17:03
  • I'm not really understanding what you mean by "it moved all my files into the folder of my other project". Can you maybe post some screenshots or something of what you have setup and maybe what you are seeing? You don't "launch" a project from SourceTree, you open the root git project folder in a new SublimeText window and convert it into a MM project there. – cricketlang Oct 27 '15 at 17:16
  • I will update the question with the folder structure as the editor for comments is minimal. – Maggie Oct 27 '15 at 17:29

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.