doctr icon indicating copy to clipboard operation
doctr copied to clipboard

Azure pipelines to deploy docs

Open wkerzendorf opened this issue 6 years ago • 4 comments

We are switching from TRAVIS to azure and so it would be nice to use the amazing doctr tool as well. I guess this is similar to #345 . it currently seems to crash with --force as it requires the environmental variables from TRAVIS (which we can set - but it would be nice if that was fixed).

wkerzendorf avatar May 22 '19 23:05 wkerzendorf

Agreed. It won't just work out of the box, because you have to somehow create a deploy key for your gh-pages repo and either put it on Azure or encrypt it for Azure. For Travis, each repo has an encryption key we use to encrypt it that can only be decrypted in the Travis build. For Azure, it would be something different.

It would actually be nice if Azure supported pushing to gh-pages natively. I'm guessing it has better direct support for managing SSH keys than Travis. That is, if we can just upload an SSH key directly and have it be present in the build, that would simplify what doctr does a lot.

asmeurer avatar May 23 '19 00:05 asmeurer

Seems like there's an undocumented API for uploading to a pipeline's "secure files" where we could just drop an SSH key: https://github.com/Microsoft/azure-pipelines-tasks/issues/9172#issuecomment-466024682

gforsyth avatar May 23 '19 00:05 gforsyth

This is our progress so far, after adding these variables:


export secure=@saved_key_notshown
export TRAVIS_BRANCH="master"
export TRAVIS_REPO_SLUG="Youssef15015/tardis"

But unfortuneately, it does not have permission to push Don't have permission to push. Not trying.

Youssef15015 avatar May 31 '19 18:05 Youssef15015

So it seems that Azure (as well as GitLab), in order to authenticate for the configure stuff, requires you to register as an oauth application, and the open a webpage, which then does a callback to your URL. So I think to make it work we would have to first register as an application, open the login webpage, then use a simple flask server to receive the callback from the login page. I played with this a bit and wasn't able to get it working properly with gitlab. Here is an example of the same sort of thing with the reddit API https://gist.github.com/kemitche/9749639.

Probably for a simpler first go, we should just point people to the UI page where they can paste the appropriate thing to create the secure environment variable. It kind of sucks if we need to save the private SSH key to a file and/or print it to the terminal, so we should try to get a real login flow working.

asmeurer avatar Jul 15 '19 00:07 asmeurer