2

I'm deploying code to multiple orgs in parallel using a separately named project-scratch-def.json for each one. But I've come across a case where I can only deploy some triggers to one of those orgs because the triggers depend on a feature enabled in just one of the project-scratch-def.json files.

Ideally, for that one case, I'd like to be able to point to a separate sfdx-project.json in the sfdx force:source:push command where that file includes a second packageDirectories entry pointing to the triggers. Is that possible?

(An ugly way to achieve this is to use a sfdx force:mdapi:deploy -z zipFile command to layer MDAPI format content on top.)

Or could the triggers and their own sfdx-project.json just be located in separate folder in the project that the automation changes directory into and then does the sfdx force:source:push? Not much luck trying that so far...

2
  • force:source:deploy can replace the need for force:mdapi:deploy; it's still DX format and doesn't require any zipping. Would that help?
    – sfdcfox
    Dec 18, 2018 at 20:05
  • @sfdcfox Didn't notice that command - think it will. Will try now. Thanks!
    – Keith C
    Dec 18, 2018 at 20:06

1 Answer 1

2

Thanks sfdcfox!

This command allows extra files to be deployed on top of a sfdx force:source:push with the files located in an arbitrary folder:

sfdx force:source:deploy --sourcepath config-components/config2 --json --targetusername ${org.username}

So I've added a config-components directory to the project to hold configuration specific components:

config
    project-scratch-def.config1.json
    project-scratch-def.config2.json
    project-scratch-def.config3.json
config-components
    config2
        force-app
            main
                ...
force-app
    main
        ...
sfdx-project.json

and the automation I'm using does the sfdx force:source:deploy only for the appropriate configuration. Note that only deployable components can be in the --sourcepath folder tree.

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.