Problem with building GitLab Pages

I am trying to host my hugo site on GitLab pages.

This is my .gitlab-ci.yaml (as i can found in tutorial):

image: publysher/hugo

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

GitLab is stucked for 25min on Pulling docker image publysher/hugo …
What did I do wrong?

Not sure, but doesn’t GitLab provide some kind of support forum where you can ask GitLab related questions?

Looks like there’s some problem with the Gitlab Runner at the moment.

About image: publysher/hugo, I do not use that, so I cannot comment. I use a different way to get hugo so that I have a control on which hugo version I am using (line 8 or 9).

Ok, i change docker image to alpine:3.4, and now GitLab passed build. But i have another problem:

=============================================================
Your rendered home page is blank: /index.html is zero-length
 * Did you specify a theme on the command-line or in your
   "config.toml" file?  (Current theme: "nofancy")
 * For more debugging information, run "hugo -v"
=============================================================

config.toml

baseurl = "http://lamberk.gitlab.io/docs/"
title = "Picasel Agency Docs"
#if not set copyright, default copyright template will be applied
copyright = "Copyright (c) 2008 - 2014, Steve Francia; all rights reserved."
theme = "nofancy"

[params]
	highlight="Assign a syntax highlight style"

[author]
    name = "Komarov Valentin"
    github = "lamberk"

I use theme nofancy and have only 1 post in content: mysql.md

+++
date = "2016-12-05T18:34:53+03:00"
draft = false
title = "mysql"

+++

Create database:

**CREATE DATABASE database_name CHARACTER SET utf8 COLLATE utf8_general_ci;**


Create user:

**CREATE USER 'username'@'localhost';**


Grant privileges:

**GRANT ALL PRIVILEGES ON database_name.* TO username@localhost WITH GRANT OPTION;**

Localhost is working correctly.

More info from GitLab:

$ hugo -v
INFO: 2016/12/06 10:19:30 hugo.go:463: Using config file: /builds/Lamberk/docs/config.toml
WARN: 2016/12/06 10:19:30 hugo.go:547: Unable to find static directory for theme hugo-theme-geppaku in /builds/Lamberk/docs/themes/hugo-theme-geppaku/static
WARN: 2016/12/06 10:19:30 hugo.go:557: Unable to find Static Directory: /builds/Lamberk/docs/static/
WARN: 2016/12/06 10:19:30 hugo.go:595: No static directories found to sync
Started building site
INFO: 2016/12/06 10:19:30 site.go:1251: found taxonomies: map[string]string{"tag":"tags", "category":"categories"}
WARN: 2016/12/06 10:19:30 site.go:2014: Unable to locate layout for taxonomy category: [taxonomy/category.html indexes/category.html _default/taxonomy.html _default/list.html theme/taxonomy/category.html theme/indexes/category.html theme/_default/taxonomy.html theme/_default/list.html]
WARN: 2016/12/06 10:19:30 site.go:1990: "categories/back/index.html" is rendered empty
WARN: 2016/12/06 10:19:30 site.go:2014: Unable to locate layout for taxonomy tag: [taxonomy/tag.html indexes/tag.html _default/taxonomy.html _default/list.html theme/taxonomy/tag.html theme/indexes/tag.html theme/_default/taxonomy.html theme/_default/list.html]
WARN: 2016/12/06 10:19:30 site.go:1990: "tags/nginx/index.html" is rendered empty
WARN: 2016/12/06 10:19:30 site.go:2014: Unable to locate layout for taxonomy category: [taxonomy/category.html indexes/category.html _default/taxonomy.html _default/list.html theme/taxonomy/category.html theme/indexes/category.html theme/_default/taxonomy.html theme/_default/list.html]
WARN: 2016/12/06 10:19:30 site.go:1990: "categories/deploy/index.html" is rendered empty
WARN: 2016/12/06 10:19:30 site.go:2014: Unable to locate layout for section post: [section/post.html _default/section.html _default/list.html indexes/post.html _default/indexes.html theme/section/post.html theme/_default/section.html theme/_default/list.html theme/indexes/post.html theme/_default/indexes.html theme/section/post.html theme/_default/section.html theme/_default/list.html theme/indexes/post.html theme/_default/indexes.html theme/theme/section/post.html theme/theme/_default/section.html theme/theme/_default/list.html theme/theme/indexes/post.html theme/theme/_default/indexes.html]
WARN: 2016/12/06 10:19:30 site.go:1990: "post" is rendered empty
WARN: 2016/12/06 10:19:30 site.go:2014: Unable to locate layout for page post/mysql.md: [post/single.html _default/single.html theme/post/single.html theme/_default/single.html _default/single.html theme/post/single.html theme/_default/single.html theme/theme/post/single.html theme/theme/_default/single.html theme/_default/single.html]
WARN: 2016/12/06 10:19:30 site.go:1990: "post/mysql.html" is rendered empty
WARN: 2016/12/06 10:19:30 site.go:2014: Unable to locate layout for page post/nginx.md: [post/single.html _default/single.html theme/post/single.html theme/_default/single.html _default/single.html theme/post/single.html theme/_default/single.html theme/theme/post/single.html theme/theme/_default/single.html theme/_default/single.html]
WARN: 2016/12/06 10:19:30 site.go:1990: "post/nginx.html" is rendered empty
WARN: 2016/12/06 10:19:30 site.go:2014: Unable to locate layout for homepage: [index.html _default/list.html theme/index.html theme/_default/list.html]
WARN: 2016/12/06 10:19:30 site.go:1990: "/" is rendered empty
=============================================================
Your rendered home page is blank: /index.html is zero-length
 * Did you specify a theme on the command-line or in your
   "config.toml" file?  (Current theme: "hugo-theme-geppaku")
=============================================================
WARN: 2016/12/06 10:19:30 site.go:2014: Unable to locate layout for 404 page: [404.html theme/404.html]
WARN: 2016/12/06 10:19:30 site.go:1990: "404.html" is rendered empty

I got it, the problem was with theme (git submodule) Resolved with this solution.

Yup, I take care of clone git submodules in my gitlab runner config too:

  - apk add git
  - git submodule init
  - git submodule update --force

Just a note to other new GitLab pages users who might end up here through a search - it’s kind of a flaky service.

That’s a bit harsh on it because that’s judging it by some pretty high standards but there are frequent delays with the builds/runners and sporadic downtime occurs somewhat frequently (at least for my tastes).

But, it is free and that’s great, just be aware that builds can sometimes take over an hour to execute and there might be other bumps in the road.

So the original issue here in this thread is common and isn’t indicative of a problem with Hugo, it’s a GitLab thing.

3 Likes