ember-learn / ember-cli-addon-docs

Easy, beautiful docs for your OSS Ember addons
https://ember-learn.github.io/ember-cli-addon-docs
MIT License
176 stars 142 forks source link

Deployment documentation #197

Open ef4 opened 6 years ago

ef4 commented 6 years ago

We noticed a couple issues with the documented steps for automating deployment from Travis.

  1. By using after_success, a failed deployment counts as a successful build. There's no feedback that would cause anybody to notice if the deploy is failing. I would suggest using Travi's real deploy phase support with the script provider instead. It even has built-in support for saying "only tagged builds or master" without manually including a bash condition.

  2. The instructions make the user generate a new keypair, but travis already has a dedicated keypair for every repo, and this is necessarily safer than making your own because the private key never leaves Travis. To obtain the public key that goes with the repo, you just run travis pubkey.

We can PR documentation changes addressing these, but I wanted to check in first and make sure there isn't some reason I don't know about for sticking to the existing way.

dfreeman commented 6 years ago
  1. I have a vague memory of trying to use the script provider back when we were originally setting up automatic deployment here and running into difficulty, but TBH I don't remember the details. There's definitely no principled reason we're not using it today, if it works.

  2. I think I (probably incorrectly!) assumed that Travis's own key was read only. If that's not the case, then just using travis pubkey would be both safer and better from a DX perspective than having to manually generate a keypair.

ef4 commented 6 years ago

I think the travis key is read only by default, but that doesn't mean you can't use the existing instructions to paste it in as a deploy key and check the "write" checkbox. I'm verifying now with the ember-animated deploy, if that works I can PR what we did there.

dfreeman commented 6 years ago

Great, thank you! ❤️

ef4 commented 6 years ago

Update: the switch to script deploys worked great, and properly fails your build if the deploy fails.

The use of the built-in Travis key turns out not to be a good idea after all -- Travis's own docs stopped recommending people try to use that for deploys, and they tell you to generate your own keypair as the addon-docs docs already do.