Troels Larsen
Troels Larsen

Reputation: 4631

Gitlab CI never finishes node build

I am using gitlab-ci to try to build a angular application, but when I add the ng build step. I am using a docker runner.

My .gitlab-ciyml looks like this:

stages:
  - build
image: tvl/gitlab-node-runner:latest
build:
  stage: build
  script:
    - 'npm install'
#    - 'ng build --prod'
    - 'pwd'
    - 'pwd'
    - 'pwd'
    - 'pwd'

The pwd lines are just added for debug. When I add the ng build --prod step, it finishes the job successfully (it runs all commands and actually builds), but the build is never finished - that is the say, the status in gitlab indicates 'running for 1930 minutes and 5 seconds'. I originally had additional commands to deploy to docker, and these were run and my container was spun up.

[sic]
  68% building modules 487/487 modules 0 active        79% module and chunk tree optimization                    80% module reviving 81% module order optimization    82% module id optimization         83% chunk reviving 84% chunk order optimization    85% chunk id optimization               86% hashing 87% module assets processing  88% chunk assets processing 89% additional chunk assets processing                          90% recording 91% additional asset processing    92% chunk asset optimization       94% asset optimization           95% emitting             Hash: 9f92d63fba4ffca06ebd
Time: 20203ms
chunk    {0} polyfills.2d45a4c73c85e24fe474.bundle.js (polyfills) 158 kB {4} [initial] [rendered]
chunk    {1} main.d8efb39cb35fc9a55d36.bundle.js (main) 69.2 kB {3} [initial] [rendered]
chunk    {2} styles.dbfc2b033acc59bb319f.bundle.css (styles) 69 bytes {4} [initial] [rendered]
chunk    {3} vendor.0d3d64c793f45b4d7693.bundle.js (vendor) 1.9 MB [initial] [rendered]
chunk    {4} inline.164b3a3f930a3c22cf14.bundle.js (inline) 0 bytes [entry] [rendered]
$ pwd
/builds/smarthome/asgard2
$ pwd
/builds/smarthome/asgard2
$ pwd
/builds/smarthome/asgard2
$ pwd
/builds/smarthome/asgard2

Does anyone have any idea why this could be or how to debug it?

For reference, my node runner is created from this:

FROM node
RUN echo deb http://apt.dockerproject.org/repo debian-jessie main > /etc/apt/sources.list.d/docker.list && \
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && \
apt-get update && \
apt-get install -y docker-engine
RUN npm install -g @angular/cli

Upvotes: 0

Views: 1272

Answers (1)

Troels Larsen
Troels Larsen

Reputation: 4631

I finally fixed this issue. I changed the build command to:

ng build --progress=false

This causes Angular CLI to produce less output. I'm not sure why gitlab-cli hangs due to this.

Upvotes: 1

Related Questions