Feature(s) impacted
I have set up a local development environment and am able to edit layout in it. I now want to deploy it to production. There seem to be several ways of doing this, and I’m a little confused about which to use.
If I try running “forest deploy” from the command line I get the error "Source and destination environments must have the same schema. "
I have updated the version of forest on the command line, so the development environment has a different version than the production environment. I’m not sure how to do it in the production environment.
If I try “npm run forestadmin:build:package:publish”
I get the error:
× Failed to retrieve database schema from Forest Admin server: Request failed with status code 422
Your environment is not a cloud environment.
ERROR: “forestadmin:update-typings” exited with 1.
ERROR: “build” exited with 1.
The documentation indicates that there should be a “deploy to production” link at the top of the page online. However this is not present for me.
This is the contents of my env file:
FOREST_ENV_SECRET=[redacted]
TOKEN_PATH=C:\Users\janet
LOG_LEVEL=Info
APPLICATION_URL=http://localhost:3351
APPLICATION_PORT=3351
Should FOREST_ENV_SECRET be the production or development secret? I’ve tried both.
Here is the contents of my datasource.js
module.exports = () => ({
main: {
connectionOptions: {
uri:“mongodb://localhost:27018/mongo”,
},
},
})
Observed behavior
See above
Expected behavior
I’m just looking for any way to deploy to production.
- Project name: Cerebro 2
- Team name: Praxis Labs
- Environment name: Windoes
- Agent technology: (nodejs, php, rails, python): ?
- Agent (forest package) name & version: 1.61.0/1.60.0
- Database type: MongoDB
- Recent changes made on your end if any: successfully created development environment, no code changes.
Hello again @Janet_Gilbert,
If I try running “forest deploy” from the command line I get the error "Source and destination environments must have the same schema. "
The forest deploy command
is not related to the Cloud code customization publication, could you tell me what might have caused this confusion, did you find something that suggested that this is the command that should be used ?
If I try “npm run forestadmin:build:package:publish”
I get the error:
× Failed to retrieve database schema from Forest Admin server: Request failed with status code 422
That is indeed the proper command to publish your customization, the error tells me that you do not have the env_secret of your production environment, which is the env_secret that should be set.
You should have pretty much everything you need to understand and work with a Cloud project from this modal
The documentation indicates that there should be a “deploy to production” link at the top of the page online. However this is not present for me.
I think you are referencing a page that is about layout customization, if you are exploring the documentation, we have a page specific to Cloud environments which hopefully will be easier for you.
1 Like
OK using the production secret worked for the code customizations. I haven’t actually customized any code yet: planning to today.
How do I deploy the layout customization that I have created in the development environment to the production environment? Your link does not say how to do this.
There is no link to deploy
Sadly the feature to deploy layout customization from a development environment to production environment is not possible as of yet in a Cloud project.
OK then how do I achieve a workflow where I develop layout and code and test it on a test database? Does Forest Admin require you to develop and test layout on your live production database?
We are aware that this can be a pain, the plan is to tackle this at some point but I do not have an ETA to share.
What we suggest would be to ensure in your development environment that changes to your database/models and code customization works before deploying to production on which you would then be able to edit the layout according to the needs of your business.
However if you think this pain point is higher than the cost of hosting an agent yourself, you could chose to switch to a self-hosted project which has the DWO fully functioning.
Is there any documentation on this workflow? Can I synchronize UI changes from the Production environment to the development environment?
There is currently no documentation on this aspect for a Cloud project, as the development environment is fairly new in this kind of setup.
But for the UI changes from Production → Development, there should be no issue, any changes made in production will be reported to your development environment automatically. Your layout branch in development is based on your production, you simply are not able to deploy layout changes from Dev → Prod
OK so I can develop the layout in Production and the code in Development?
Exactly 
Note that if you delete a model or code customization in development environment, the layout defined in production won’t be applied on your development environment.
Is there a way of getting round that limitation?
What workflow do developers typically use with Forest Admin?
Note that if you delete a model or code customization in development environment, the layout defined in production won’t be applied on your development environment.
Sorry if it mislead you, the only part that isn’t applied is the one on a deleted component, everything else will work fine.
The addition of a development environment in a Cloud project is still somewhat recent, so we have not been prompted with such feedback before.