Building Antora Docs on Cloudflare Pages
My usual go to for building antora sites is with docker. I have a typical makefile that looks like this.
default:
docker run --rm -v $$PWD:/antora -t antora/antora antora-playbook.yml
However, using docker isn’t supported in cloudflare pages fast builder.
13:21:05.623 Initializing build environment. This may take up to a few minutes to complete
13:21:07.744 Success: Finished initializing build environment
13:21:07.744 Cloning repository...
13:21:09.292 Success: Finished cloning repository files
13:21:09.544 Installing dependencies
13:21:09.556 Python version set to 2.7
13:21:13.527 v12.18.0 is already installed.
13:21:14.918 Now using node v12.18.0 (npm v6.14.4)
13:21:15.264 Started restoring cached build plugins
13:21:15.281 Finished restoring cached build plugins
13:21:15.984 Attempting ruby version 2.7.1, read from environment
13:21:21.912 Using ruby version 2.7.1
13:21:22.295 Using PHP version 5.6
13:21:22.469 5.2 is already installed.
13:21:22.500 Using Swift version 5.2
13:21:22.500 Installing Hugo 0.54.0
13:21:23.170 Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
13:21:23.174 Started restoring cached go cache
13:21:23.196 Finished restoring cached go cache
13:21:23.355 go version go1.14.4 linux/amd64
13:21:23.376 go version go1.14.4 linux/amd64
13:21:23.380 Installing missing commands
13:21:23.380 Verify run directory
13:21:23.381 Executing user command: make
13:21:23.394 docker run --rm -v $PWD:/antora -t antora/antora antora-playbook.yml
13:21:23.400 /bin/sh: 1: docker: not found
13:21:23.400 Makefile:2: recipe for target 'default' failed
13:21:23.401 make: *** [default] Error 127
13:21:23.407 Failed: build command exited with code: 2
So now I need to set it up the manual way instead.
pages:
npm i -g [email protected]
antora -v
antora antora-playbook.yml
Make sure to set a newer node version (NODE_VERSION=16
) since it’s too old apparently.
13:29:53.668 npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=12.21.0"} (current: {"node":"12.18.0","npm":"6.14.4"})
Complete build log output:
13:39:08.093 Initializing build environment. This may take up to a few minutes to complete
13:39:10.139 Success: Finished initializing build environment
13:39:10.139 Cloning repository...
13:39:11.493 Success: Finished cloning repository files
13:39:11.725 Installing dependencies
13:39:11.737 Python version set to 2.7
13:39:15.612 Downloading and installing node v16.15.0...
13:39:16.098 Downloading https://nodejs.org/dist/v16.15.0/node-v16.15.0-linux-x64.tar.xz...
13:39:16.554 Computing checksum with sha256sum
13:39:16.688 Checksums matched!
13:39:21.169 Now using node v16.15.0 (npm v8.5.5)
13:39:21.737 Started restoring cached build plugins
13:39:21.753 Finished restoring cached build plugins
13:39:22.462 Attempting ruby version 2.7.1, read from environment
13:39:28.312 Using ruby version 2.7.1
13:39:28.670 Using PHP version 5.6
13:39:28.845 5.2 is already installed.
13:39:28.872 Using Swift version 5.2
13:39:28.873 Installing Hugo 0.54.0
13:39:29.542 Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
13:39:29.547 Started restoring cached go cache
13:39:29.568 Finished restoring cached go cache
13:39:29.723 go version go1.14.4 linux/amd64
13:39:29.744 go version go1.14.4 linux/amd64
13:39:29.748 Installing missing commands
13:39:29.749 Verify run directory
13:39:29.749 Executing user command: make pages
13:39:29.762 npm i -g [email protected]
13:39:37.024
13:39:37.024 added 215 packages, and audited 216 packages in 7s
13:39:37.024
13:39:37.024 20 packages are looking for funding
13:39:37.024 run `npm fund` for details
13:39:37.028
13:39:37.028 8 high severity vulnerabilities
13:39:37.028
13:39:37.028 To address issues that do not require attention, run:
13:39:37.028 npm audit fix
13:39:37.029
13:39:37.029 Some issues need review, and may require choosing
13:39:37.029 a different dependency.
13:39:37.029
13:39:37.029 Run `npm audit` for details.
13:39:37.043 antora -v
13:39:37.192 @antora/cli: 3.0.1
13:39:37.192 @antora/site-generator: 3.0.1
13:39:37.196 antora antora-playbook.yml
13:39:38.676 Finished
13:39:38.676 Note: No functions dir at /functions found. Skipping.
13:39:38.677 Validating asset output directory
13:39:39.047 Deploying your site to Cloudflare's global network...
13:39:41.663 Success: Your site was deployed!
Good to go 👍🏻