reactjswordpressgitlab-ciyarnpkggitlab-ci-runner

GitLab CI Pipeline Job gives error JavaScript heap out of memory


We have a WordPress plugin written in JS with the help of the tool wp-reactivate.

Our goal is to make a GitLab CI Pipeline that increases the version in all places, builds the project and deploys it to the WordPress.org SVN repository. So far, the SVN deployment does work, incrementing the version number is unimplemented yet, but we have a problem building the project. The GitLab CI Runner refuses to finish the process since it ran out of available memory.

The error message

We have already tried (with no effect):

Our .gitlab-ci.yml file:

stages:
  - build
  - deploy

default:
  image: node

BuildApp:
  stage: build
  before_script:
    - GENERATE_SOURCEMAP=false
    - NODE_OPTIONS=\"--max_old_space_size=8192\"
    - node --max-old-space-size=8192
  script:
    - yarn
    - yarn prod

PluginSVN:
  stage: deploy
  before_script:
    - apt-get install subversion
    - curl -o /usr/bin/deploy.sh https://git-cdn.e15r.co/open-source/wp-org-plugin-deploy/raw/master/scripts/deploy.sh
    - chmod +x /usr/bin/deploy.sh
  script: /usr/bin/deploy.sh
  when: on_success

Is there any way to increase the amount of available memory, or reduce the amount of memory required for building the project?


Solution

  • Check Gitlab Forum: Every runner only have 1CPU, 4GB RAM,

    which means you don't have to adjust node options, it won't work.

    For me, self-hosted is an option.