Gitlab CI fails to build hugo

I’ve been hosting a hugo blog on GitLab Pages.

The site was working fine all these days, but suddenly, it stopped working.

Running with gitlab-runner 11.1.0-rc2 (83bc9589)
  on docker-auto-scale fa6cab46
Using Docker executor with image dettmering/hugo-build ...
Pulling docker image dettmering/hugo-build ...
Using docker image sha256:6dfa746e064b281ef20fd9de163d31bf6096aea60c5d4600ccd45463d6c1ca6f for dettmering/hugo-build ...
Running on runner-fa6cab46-project-7288140-concurrent-0 via runner-fa6cab46-srm-1531893240-363d110c...
Cloning repository...
Cloning into '/builds/arjunkrishnababu96/arjunkrishnababu96.gitlab.io'...
Checking out 7ef98d53 as master...
Updating/initializing submodules...
Submodule 'themes/basics' (https://github.com/arjunkrishnababu96/basics.git) registered for path 'themes/basics'
Cloning into '/builds/arjunkrishnababu96/arjunkrishnababu96.gitlab.io/themes/basics'...
Submodule path 'themes/basics': checked out 'c3703cf044ed0d40682aadc0149f0e62e77ca771'
$ hugo
/bin/sh: eval: line 63: hugo: not found
ERROR: Job failed: exit code 127

It says hugo: not found.

The recent changes I made is nothing gigantic - just a minor change in the css stylesheet.

It was even working as recent as 3 days ago (when I made another minor change to the stylesheet).

Just for reference, my .gitlab-ci.yml is as follows. The file has been untouched, and since the whole thing was working earlier, I don’t think this file has anything to do with my current problem.

# This file is a template, and might need editing before it works on your project.
# Full project: https://gitlab.com/pages/hugo
image: dettmering/hugo-build

pages:
  script:
  - hugo
  artifacts:
    paths:
    - public
  only:
  - master

variables:
  GIT_SUBMODULE_STRATEGY: normal

test:
  script:
  - hugo
  except:
  - master

Any suggestions on what I can try? I’m new to CI.

I have managed to find the fix.

As per the instructions in the hugo docs here, I changed the image to monachus/hugo, and pushed to the repo.

It worked!

Here’s my full .gitlab-ci.yml .

# This file is a template, and might need editing before it works on your project.
# Full project: https://gitlab.com/pages/hugo
image: monachus/hugo
# ABOVE ^ LINE CHANGED

pages:
  script:
  - hugo
  artifacts:
    paths:
    - public
  only:
  - master

variables:
  GIT_SUBMODULE_STRATEGY: normal

test:
  script:
  - hugo
  except:
  - master
1 Like

Hi,

the issue with my docker image dettmering/hugo-build has been fixed. My image contains the hugo-extended version that supports SASS parsing, which the monachus/hugo image currently doesn’t.

1 Like