readmeio-sync icon indicating copy to clipboard operation
readmeio-sync copied to clipboard

Setting up a staging environment

Open duncs opened this issue 8 years ago • 4 comments

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 init to successfully pull down my production project
  • 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-staging to set up syncConfig.json
  • I have copied the project directory to project-staging
  • I have copied and pasted the 12 lines in syncPaths.json for product to product-staging and amended the names on the necessary lines
  • I have run readmeio-sync upload but 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

duncs avatar Feb 08 '17 11:02 duncs

Interesting. Thanks for the detailed steps @duncs . I'll see if I can replicate the issue and find the fix.

haroldtreen avatar Feb 09 '17 00:02 haroldtreen

I just gave this a try and couldn't reproduce 😞 .

Do you have the exact same versions between projects, @duncs ?

image

image

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...

haroldtreen avatar Feb 25 '17 23:02 haroldtreen

Not pre-creating the version could well be the issue. I'll try it out and let you know

Thanks

duncs avatar Mar 03 '17 18:03 duncs

Created an issue so it's better documented :)

https://github.com/haroldtreen/readmeio-sync/issues/21

haroldtreen avatar Mar 03 '17 19:03 haroldtreen