This repository was archived by the owner on Jun 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
Building on Gitlab CI requires disabling thumbnails. #27
Copy link
Copy link
Open
Description
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/presskitHowever, 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/
PROJECTAfter disabling thumbnail generation, it now runs as expected.
Hope this helps anyone.
kennedy
Metadata
Metadata
Assignees
Labels
No labels