我正在使用gitlab-ci来尝试构建一个角度应用程序,但是当我添加ng build
步骤时。我正在使用码头运动员。
我的.gitlab-ciyml看起来像这样:
stages:
- build
image: tvl/gitlab-node-runner:latest
build:
stage: build
script:
- 'npm install'
# - 'ng build --prod'
- 'pwd'
- 'pwd'
- 'pwd'
- 'pwd'
仅添加pwd
行进行调试。当我添加ng build --prod
步骤时,它成功完成了作业(它运行所有命令并实际构建),但构建永远不会完成 - 也就是说,gitlab中的状态表示'运行1930分钟和5秒。我最初有额外的命令要部署到docker,这些命令已经运行,我的容器被旋转了。
[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
有没有人知道为什么会这样或如何调试它?
作为参考,我的节点运行器是通过以下方式创建的:
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
答案 0 :(得分:0)
我终于解决了这个问题。我将构建命令更改为:
ng build --progress=false
这会导致Angular CLI产生较少的输出。我不确定为什么gitlab-cli因此而挂起。