Been building and publishing my Jekyll blog site as an Azure Pipeline for several years with an occasional “tweak” needed. Recently the pipeline fell over because of the change to the Ruby version in the Azure Windows 2019 Host Agent. Problem is not yet solved but have found a workaround for now.

The Blog Site

My blog site https://davidjones.sportronics.com.au/

This is configured as a Jekyll site. It is authored in VS Code and submitted to an Azure Devops site. There is an Azure Pipeline to build the site and one to submit it to an Azure Blog Storage where it manifests as a Static Web Site. There is a CDN that then makes it available using a custom domain via SSL.

The site construction was based upon some blog posts some years ago by Carl-Hugo Marcotte. The construction is outlined on this blog; see Creating this web site. That has links to Carl-Hugo’s posts from 2018.

Numerous functionalities, such as …

  • Next and Previous page links
  • Twitter links
  • Page Category and Tag inclusion lists
  • Scalable image inclusion especially between desktop and mobiles
  • etc

… were added to the site’s software . See here.

The Issue

This month the Azure Pipeline build failed. It had been working without any tweaks for more than a year. When faced with build issues, they have been able to be resolved such the move to Ruby 3. The solution then was to specify Ruby version <3.0. In recent time I had been specifying version 3.1.4. The recent failure was that the Ruby version available changed to 3.1.5 so the pipeline failed on the Ruby version check. Also, when adjusted to this the build failed.

This issue has been raised in detail on StackOveflow with some replies here: Azure Devops Jekyll site build fails, worked previously including an answer with three options, one of which worked (as a work around).

The issue was reported to Agent image feedback here: Using the Ruby version 3.1.5 on Windows-2019 Agent failure Item No.9999

Discussion

An Azure Pipeline can run using a Windows or Ubuntu Hosted Agent where a specific programming environment is provide; or you can use a self-generated host. The Host Agent previously used was Windows 2019. The current Win 2019 software that is available is listed here. You can see towards the bottom, currently versions 3.07 and 3.15 are available for Ruby. You can take links from here to see the software available for other OS Host Agents.

So the problem here is that the Host Agent was updated with respect to Ruby.

No idea of what communication channel to follow to be aware of these Host Agent changes, except to monitor the links above!

Suggested Solutions aka Workarounds

In my pipeline there is a Ruby specification

Use Ruby > 3.0.0

The default steps is

Use Ruby >= 2.40

When reverted to this the chosen Ruby version fails, using 3.1.5. Also 3.0.7 fails.

One suggestion was to use choco to install a specific Ruby version

- script:  choco install ruby --version=3.1.5.1

This fails at the Install Gems step

Of the three suggestions on the accepted answer on StackOverflow, the one that worked for me was moving to an Ubuntu pipeline:

pool:
  vmImage: ubuntu-latest

I will need to create the deploy pipeline for this build. Just replacing the windows build pipeline with the ubuntu pipeline with the deploy pipeline failed when actually copying the build content

Conclusion and Workaround

The updating of the Azure Host Agent software can cause significant pipeline failures with Azure Devops. Better monitoring and broadcasting of Agent updates is needed.

My current workaround is as follows:

  • Add and edit blog posts in VS Code
  • Clear _site cats and tag folders
  • Run bundle exec jekyll build there
  • Install ‘'’Azure Storage``` add in in VS Code , if not there already.
  • Right on _site folder and choose Deploy to Static Web Site via Azure Storage
  • Might need to login to Azure
  • It then should find your storage account. Select it.
  • Deploy. You will be told tha the target needs deleting as part of this process.
    • The delete takes some time.
    • I found it quicker to delete the content or $web (not $web itself) using Azure Storage Explorer. 4 minutes v 15+ minutes
    • Working on an Az script for this.

GitHub Discussion on this

GitHub Discussion on this


Next: Use Ubuntu Pipeline: Ubuntu Pipeline Solution


 TopicSubtopic
<  Prev:   Softata
   
 This Category Links 
Category:Web Sites Index:Web Sites
  Next: > Azure Pipelines
<  Prev:   Blazor