3

We are considering migration of our managed package development process to Salesforce DX. But we are definitely not ready yet to transform our code base and use full potential of SFDX, but still looking for a way to adopt it partially.

Couple questions regarding how much we could utilize power of DX but still not to change significantly our dev flow for now:

  1. Is it possible just to use hub and DX cli to quickly spin up new scratch org with required configuration, create new user with password and then use it to deploy code in an old-fashioned way using package.xml and ant migration tool? Any restriction here or could we treat scratch org as normal sandbox after creation?

  2. Main interest is about registering namespace in hub org and start spinning up packaging scratch orgs - so that we could have many of them but still using the same namespace prefix. Would it be possible to use old package xml here as well and deploy code to package as we did before with ant?

  3. Is it possible to spin up at the same time from one hub namespaced and non-namespaced scratch orgs? Cause currently we are developing code in ordinary sandboxes and then pushing it into packaging org - curious if it's possible to do the same withing scratch orgs scope or should they all be strictly with namespace and do we need another hub to register to produce non-namespaced orgs?

6

Is it possible just to use hub and DX cli to quickly spin up new scratch org with required configuration, create new user with password and then use it to deploy code in an old-fashioned way using package.xml and ant migration tool? Any restriction here or could we treat scratch org as normal sandbox after creation?

You can make a package.xml-based deployment with force:mdapi:deploy. There's no need to keep your Ant scripts strictly for purposes of deployment. If want to, you can continue using your old scripts, but I really don't think it's necessary unless you're doing additional script processing, such as sanitizing list views and other stuff. Even then, I'd probably write up a shell script to handle the deployment stuff, and then call your Ant script for clean-up tasks, or you can even call sfdx from Ant scripts to handle the deployment tasks.

Main interest is about registering namespace in hub org and start spinning up packaging scratch orgs - so that we could have many of them but still using the same namespace prefix. Would it be possible to use old package xml here as well and deploy code to package as we did before with ant?

You can specify the namespace per scratch org per creation. Simply make multiple configuration files and choose which namespace you want. You can even have multiple registered namespaces, but you can obviously only use at most one per scratch org. force:mdapi:deploy handles this as well, or you can use your old Ant scripts.

Is it possible to spin up at the same time from one hub namespaced and non-namespaced scratch orgs? Cause currently we are developing code in ordinary sandboxes and then pushing it into packaging org - curious if it's possible to do the same withing scratch orgs scope or should they all be strictly with namespace and do we need another hub to register to produce non-namespaced orgs?

Yes (as above). There's no reason why you should need multiple dev hub orgs for scratch org creation purposes, though you'll probably want/need different dev hubs if you have discrete teams that need to stay separated. Even then, I suspect that this probably overkill for most development teams.

  • Yep, that's the thing. We are doing exremly heavy processing inside those ant scripts - e.g. static resource generation, injection of some dynamic values in pages, classes, custom metadata records, dealing with namespace prefixing (since our code in repo is namespace-not-aware), even code generation. No one wants to touch that stuff for now, so looks like just replacing classic deploy command from ant migration tool with force:mdapi:deploy (plus some adjustments) may work for us - worth trying at least. Thanks for help. – wesaw Dec 5 '17 at 20:19
  • 1
    @wesaw Yeah, I kind of suspected that may be the case. I'd use the mdapi commands so you can skip resetting passwords and all that. Just use your old Ant scripts for processing, as before, and put DX in place of the previous sf:deploy commands. – sfdcfox Dec 5 '17 at 20:21

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.