【发布时间】:2018-10-16 18:04:13
【问题描述】:
我正在尝试在 Gitlab 中设置一个基本管道,该管道执行以下操作: 运行测试命令,编译客户端并使用 docker-compose 部署应用程序。
当我尝试使用npm install 时出现问题。
我的.gitlab-ci.yml 文件如下所示:
# This file is a template, and might need editing before it works on your
project.
# Official docker image.
image: docker:latest
services:
- docker:dind
stages:
- test
- build
- deploy
build:
stage: build
script:
- cd packages/public/client/
- npm install --only=production
- npm run build
test:
stage: test
only:
- develop
- production
script:
- echo run tests in this section
step-deploy-production:
stage: deploy
only:
- production
script:
- docker-compose up -d --build
environment: production
when: manual
错误是:
Skipping Git submodules setup
$ cd packages/public/client/
$ npm install --only=production
bash: line 69: npm: command not found
ERROR: Job failed: exit status 1
我正在使用最后一个 docker 映像,所以,我想知道是否可以在构建阶段定义新服务,还是应该在整个过程中使用不同的映像?
谢谢
【问题讨论】: