Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building on Gitlab CI requires disabling thumbnails. #27

Open
Kruemelkatze opened this issue Jun 14, 2021 · 3 comments
Open

Building on Gitlab CI requires disabling thumbnails. #27

Kruemelkatze opened this issue Jun 14, 2021 · 3 comments

Comments

@Kruemelkatze
Copy link

Kruemelkatze commented Jun 14, 2021

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.

@valryon
Copy link
Member

valryon commented Jun 14, 2021

Thanks for the guide and for digging into the issue!

And while I'm here, I want to say that I cannot maintain the project (not enough time, not skilled enough in node.js), and my associate is not available either, but there's definitely a good update to be done on presskit.html... dependencies update, bug fixes, some new features, that kind of things. We're kinda stuck right now, sorry. :/

@Kruemelkatze
Copy link
Author

Kruemelkatze commented Jun 16, 2021

Thank's for dropping by!

Is there any chance that you have a list of bugs and potential new features? Maybe I could invest some spare time and at least update the dependencies, do some critical fixes and provide a PR.

@valryon
Copy link
Member

valryon commented Jun 16, 2021

I think updating the whole thing (node version, dependencies, etc) + resolving the issues would already be super nice.

The #1 feature I can think of is to generate a game presskit page without requiring to have a company page. But the way the code is done right now doesn't make it very easy. Maybe a general revamp of the node side (keeping the clean rendering) would be better...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants