In which I ramble a bit about setting up CI for this very blog.
I have a Jenkins server running on my OsX computer. (… or … I’m setting one up anyway) I also have (am establishing?) a blog built by Hexo … because that seems the right way to do this sort of thing. My constraints of “MarkDown“ and “no really - let me use MarkDown because I’m going to have a lot of code fragments” seem alien to most blogging software - “Hexo delivers” as the kids say.
I knew that this would all work from a command line on the computer and a command line on my Windows 7 PC. After a bunch of chewing - I’ve scrawled this post in victory as a sort of test.
Hexo is built in Node.JS. I installed it and played about with it as I was instructed.
npm install hexo
After installing Node.JS I encountered various errors and I switching to a stable version of NPM. (… which I thought I had already used but … I guess not)
npm -g install npm
This was discussed here but may be irrelevant.
I setup Jenkins to poll (and pull) my repository at
H/15 * * * *.
I had already setup a Hexo site and configured it to deploy to GitHub pages.
(… which incidentally don’t seem to do anything interesting for you with Jekyll AFAIK)
The “secret” to this recipe seemed to be that the Jenkins build seems to require installing Hexo itself to work.
npm install in the folder but full-on
npm install hexo et al.
This seems odd to me but it’s what worked … but this is a CI server so longish builds are fine with me.
I used five steps, each a shell command, to perform the generation and deploy the site.
The first command installs Hexo.
I tried to install it (globally?) with
-g but encountered a security exception.
npm install hexo
The second command installs a sitemap plugin that should make my site reachable from Google-like crawlers
npm install hexo-generator-sitemap --save
The third command … installs … the site?
This may be redundant but I’m not interested in going through a “change” > “reboot” > “check” cycle to learn that I’ve broken my configuration.
The fourth command actually generates the site.
The fifth and final command uploads the generated site.
It seems odd to me that this doesn’t implicitly generate the site, but I’m not worried.
So … yeah … that’s that. This post was the first one that I set to push out through this system.
Next … I need / want to get this theme working on small (mobile) screens.
… and finish the template engine for my other stuff.
… and a script-binding generator.
… and write a blub about setting up Jenkins ; that was way harder than it should have been.