Setting up a staging environment
At the moment I only have a production environment and I am looking at setting up a staging environment.
I have done an init and pulled the production data back successfully, but I would like to set up a new staging environment using the current production data.
What I did:
- I have run
readmeio-sync initto successfully pull down my productionproject - I have created a new readme.io project called
project-staging- no other changes made - I have run
readmeio-sync config -p project -s project-stagingto set upsyncConfig.json - I have copied the
projectdirectory toproject-staging - I have copied and pasted the 12 lines in
syncPaths.jsonforproducttoproduct-stagingand amended the names on the necessary lines - I have run
readmeio-sync uploadbut I get an error:
Uploading to: project-staging
Downloading: project-staging
Fetching versions...
✓ v1.0 -
Fetching documentation...
v1.0
✓ Documentation <documentation> (1 docs)
Fetching custom pages...
v1.0
Fetching custom content...
v1.0
✓ html_body
✓ stylesheet
TypeError: Cannot read property 'allDocCategories' of undefined
at indexer (/usr/local/lib/node_modules/readmeio-sync/lib/registry.js:133:64)
at Array.forEach (native)
at /usr/local/lib/node_modules/readmeio-sync/lib/registry.js:180:33
at Array.forEach (native)
at Registry.diff (/usr/local/lib/node_modules/readmeio-sync/lib/registry.js:178:55)
at /usr/local/lib/node_modules/readmeio-sync/lib/uploader.js:99:34
at /usr/local/lib/node_modules/readmeio-sync/lib/downloader.js:105:21
at /usr/local/lib/node_modules/readmeio-sync/lib/downloader.js:61:13
at /usr/local/lib/node_modules/readmeio-sync/lib/requestor.js:109:13
at /usr/local/lib/node_modules/readmeio-sync/node_modules/async/lib/async.js:726:13
so the v2.0 docs I have copied from project into project-staging directories have not been uploaded.
Thanks
Interesting. Thanks for the detailed steps @duncs . I'll see if I can replicate the issue and find the fix.
I just gave this a try and couldn't reproduce 😞 .
Do you have the exact same versions between projects, @duncs ?


It sounds like the issue might be that project-staging only has v1.0 specified...
The tool doesn't create new versions, so you need to manually create those through the interface 👍
But if that is the case, the tool should obviously not explode. Should be detecting this and printing an error...
Not pre-creating the version could well be the issue. I'll try it out and let you know
Thanks
Created an issue so it's better documented :)
https://github.com/haroldtreen/readmeio-sync/issues/21