5

We use node.js code on Heroku and Salesforce.com together for our application. Over the course of the project, we need to deploy code to both these environments in tandem. That is, if we have a new requirement and it needs changes in both Heroku and Salesforce.com, then such a change should be deployed to both of them or to none (if any of them fails). While we can have a Continuous Integration tool (like Travis CI/Jenkins) for Heroku and Ant builds and deploy to Salesforce.com (through Force.com IDE), I'd like to know if there's a way to deploy them both together (considering both of these as an atomic process).

Salesforce.com code -> Salesforce.com instance Node.js code -> Heroku instance

We have dev, uat and stg for both SFDC and Heroku and would like to evaluate our options.

Suggestions welcome !

8
  • Are you deploying from source control? In other words are both your Heroku and Salesforce artifacts in source control? Or is your Salesforce code in your dev sandbox solely? Reason I ask, is although my answer relates either way to the Salesforce Migration Toolkit, i'd like to know where the source of your Salesforce project code is first. Aug 19, 2013 at 12:29
  • There is no really atomic process covering these, perhaps one day a Salesforce package will support Heroku components? But today its a matter of binding the two deployment API's together in a single script with appropriate versioning and error handling logic. Aug 19, 2013 at 12:30
  • Thanks for such a quick reply @Andrew ! We have an SVN repo and planning to write an Ant and deploy script to push our code to Salesforce. For Heroku, we have it on GitHub and use standard Git deploy to Heroku. We can get our Git repo onto SVN and ask Heroku to use it instead of the GitHub repo if it's going to help, but still checking out options.
    – markgarg
    Aug 19, 2013 at 12:35
  • Yeah no reason to move from Github, it won't help make the overall process any more atomic in a true sense anyway. And Git is much better fit for Heroku as you know already I suspect. Also just to confirm, it also seems your not using Packaging feature of the platform either right? Just move raw code from source control into a target org owned by your company? Aug 19, 2013 at 12:42
  • Yes Andrew, that's right. No packaging. Any particular tool that you suggest for putting both the API's together in a single script ?
    – markgarg
    Aug 19, 2013 at 12:45

1 Answer 1

3

Unfortunately there is no way to perform these two deployments in a truly atomic operation, since while they are from the same company Salesforce.com, the technology stacks and servers are not as yet aligned.

Single Script to Rule them All! Thus the best option in my view is to align through a single common scripting approach leveraging source control repositories (ideally different sub folders of same one, if they truly share the same release cycle) containing all the components to be deployed/pushed. Once you have your releases in repos create release tags (recommend you use the same format for clarity), invoke an Ant / Maven build script to take the tag name invoking the required Heroku 'push' and Salesforce 'deploy' operations in one operation, it can then easily be bootstrapped from your CI if needed.

Salesforce Ant Integration and who goes first? Salesforce provide the Migration Toolkit that provides an Ant task for the purpose of taking localling exported files (from source control) and pushing into a target org. Since both are atomic you don't have to worry about them individually, but you do have to consider if the second deployment fails, i personally would do the Heroku deployment first, since its easier to rollback or version deploys (ideally). Where as once the Salesforce deployment completes you would not easily be able to roll it back.

Which build script technology to use? Looking at the two, Ant is favoured for Salesforce, Maven is favoured for Heroku. If you go with the view that the Heroku build is driving the process, you can actually by the looks of it, call Ant tasks from a Maven script, see here for more information on this. Otherwise you can of course use Ant and its 'exec' task to call Maven.

Hope this helps give you some initial steer, of course the devil is in the detail with these things!

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .