Closed simondotm closed 3 years ago
It might be a good idea to add a top level option to the app that is an array of allowed serve/deploy project aliases for this app.
In this way maybe we can do something intuitive like:
nx deploy app
will use the default/first project alias as a --project
deploy target
nx deploy:<alias> app
will use the given project alias as a --project
deploy target (as long as it is one of the aliases listed in the app options)
Something like this would be useful for CI/CD also, since we could use affected builds to deploy specific targets (since predeploy performs necessary builds) eg:
nx affected:build && nx affected:deploy:prod
Note: look into configurations
support in the executors, seems like a more Nx built-in way to override options
eg.
"deploy": {
"builder": "@nrwl/workspace:run-commands",
"options": {
"command": "firebase deploy --project fbproject-dev --config firebase.fbproject.json"
},
"configurations": {
"production": {
"command": "firebase deploy --project fbproject-prod --config firebase.fbproject.json"
}
}
},
Multi-project workspaces need extra care when using deploy without switching to the correct firebase project target first (
firebase use <target>
orfirebase deploy -P <target>
Worst case scenario is that the wrong things might be deployed to the wrong target.We can improve this by adding
-P
to thedeploy
target.Either document suggestion to add
-P
manually, or support some way to set the firebase target on an apps' deploy target