Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Building on Gitlab CI requires disabling thumbnails. #27

@Kruemelkatze

Description

@Kruemelkatze

This is part issue, part information for others. :)

It took me quite a while to get our presskit to build on Gitlab CI. Apart from the problem that some packages seem to be outdated (no wonder, as it has not been maintained since 2019), the sharp package requires python and one of its dependencies requires make.

I got the project to build (and deploy, but that most likely will be different for most users) using this config:

image: nikolaik/python-nodejs:python3.9-nodejs14-alpine

stages:
  - setup
  - build
  - deploy

cache:
  paths:
    - node_modules/

install_dependencies:
  before_script: 
    - apk add --virtual build-dependencies build-base gcc
  stage: setup
  script:
    - npm i presskit

build_project:
  stage: build
  script:
    - npx presskit build --ignore-thumbnails
  artifacts:
    paths:
      - build/
  
deploy_project:
  stage: deploy
  only:
    - master
  before_script:
    - 'which ssh-agent || ( apk update && apk add openssh-client )'
    - mkdir -p ~/.ssh
    - eval $(ssh-agent -s)
    - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
    - echo "$SSH_PRIVATE_KEY" | ssh-add -
    - 'which rsync || ( apk update && apk add rsync )'
  script:
    - ls -la
    - rsync -hrvz --inplace --delete --delete-excluded build/* gitlabdeploy@HOST:/var/www/WEBSITE/presskit

However, I had to disable the thumbnail generation, as it silently failed the CI build. The runner reported a success, but no HTML files were generated:

$ npx presskit build
Starting directory: /builds/COMPANY/COMPANY-presskit
Finding data…
- company: "COMPANY" /builds/COMPANY/COMPANY-presskit/data.xml
- product: "PROJECT" /builds/COMPANY/COMPANY-presskit/PROJECT/data.xml
Generating HTML…
- "PROJECT" -> /builds/COMPANY/COMPANY-presskit/build/PROJECT/index.html
$ ls build/
PROJECT

After disabling thumbnail generation, it now runs as expected.
Hope this helps anyone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions