When working on moving our builds to use the build config imports (see also Experience report: Sharing complex build configuration) I noticed that our deploy
sections didn’t merge nicely.
In the shared config I had
deploy:
provider: script
script: "travis-deploy ${DOCKER_NAME} ${TAGS}"
on:
all_branches: true
In the importing config I had:
import:
- source: shared-config.yml
mode: deep_merge_prepend
deploy:
- provider: npm
...
I somehow expected either both deploy
s to be present in the merged configuration, or a warning/error that these are not mergeable (note one of them is an array, one is an object!).
What happened instead was that just the npm deployment got used, and the script deployment from the shared configuration was dropped silently.
Fix/Workaround after spotting the difference in types: Convert the shared configuration deploy
to use an array as well.