I’m not sure if there’s a way to ask travis if we can use their service. I know it’s very popular.
Bruh, do you know if we can set it up to do a test step on the PRs and a deploy step on master? I noticed mkdocs has a way to force build warnings to be errors and that catches some errors like bad (internal) links.
[scode]
version: 2.1
jobs:
build:
docker:
- image: circleci/python:3.6-jessie-browsers
steps:
- add_ssh_keys:
fingerprints:
- “b8:7b:4b:cd:5c:c0:29:9e:fe:dd:9a:55:c9:03:45:d3”
- checkout
- run:
name: Pip install
# This is using sudo, because this is a test environment. Don’t do that on your computer.
command: sudo pip install -r requirements.txt
- run:
name: mkdocs build
command: mkdocs build --clean --strict
- deploy:
name: mkdocs deploy
command: |
if [ “${CIRCLE_BRANCH}” == “master” ]; then
mkdocs gh-deploy
fi
[/scode]
That is really neat! This will run the build steps on any commits, and I hope PRs will have a neat little banner with the results (TBD). If it’s a commit on the master branch, it will also deploy, using the ssh key I put in circleci, which has this unharmful fingerprint. So neat!
The bad news is, I had to generate the ssh-key. Put the public key in github and the private key in circleci. Ryan has to do that for this to deploy. Maybe there’s a good way for us to muddle through this together Ryan?
Ryan nailed it, and he fixed it so it wouldn’t build the gh-pages branch. Awesome!
So now, it will hopefully build all the pull requests to make sure they aren’t warning about broken links or missing requirements.txt and then auto deploy when we push to master. The future is now! Thanks for the push Bruh.
Glad you all were able to get things working. It never seems like a big deal at the time to have a one liner for a person to run to see things out but it becomes a time-suck down the road. Added benefit of automation is that it’s self documenting. You’ll never have to explain to someone else how to get their local machine set up correctly to build/deploy. You and Ryan are both CI/CD experts now
HA, you both give me to much credit. I am just persistent to a fault. I am having a hard time moving docs over I want to update all of it and the structure! But getting it moved is a good first step.
Or use the docs themselves as a TODO with stubs so that you don’t have to move back and forth. Minimizing the need for people to keep data in sync across systems is generally a good rule to follow.
The navigation (nav: in mkdocs.yml) is not working well when I put two pages in different places in the nav tree. I was trying to sort of follow Ryan’s website, where things like how to flash the rambo is at the end of the MPCNC instructions as well as a standalone page. It’s a bit of a conflict between being a start to finish set of instructions along with a reference.
I don’t know if we should just leave it alone for now, or if organizing them now would make the other work easier.
I saw that the other theme highlighted things oddly as well, this one is worse. It needs to be rearranged but maybe just get the pages in first? Although moving it around is pretty easy, so either way really? I am not sure if I can do any pages this evening or not. We’ll see, helping a friend move.
So I was testing the CircleCI stuff with some PRs from me, and it was building it. But for some reason, it’s not building yours which makes me wonder if it was really the test setup on my PR instead of the main one…