我使用https://github.com/sameersbn/docker-gitlab-ci-multi-runner并使用docker compose旋转这个。
奇怪的是,我的工作卡在npm命令上无法识别。 但我的基本图像是node:latest,所以它应该可以工作。
这是我的.gitlab-ci.yml文件:
image: node:latest
cache:
paths:
- node_modules/
before_script:
- npm install
- bower install --allow-root
stages:
- build_deploy
build_&_deploy_app:
stage: build_deploy
only:
- master
script:
- gulp build -production
- gulp deploy
variables:
GIT_SSL_NO_VERIFY: "1"
注意:我需要启用SSL验证,因为这是另一个需要解决的问题。
作业的输出是:
gitlab-ci-multi-runner 1.1.4 (9e2fd1a)
WARNING: image is not supported by selected executor and shell
Using Shell executor...
Running on 6687502ce71f...
Fetching changes...
HEAD is now at 42e9d51 Update .gitlab-ci.yml
Checking out 42e9d511 as master...
HEAD is now at 42e9d51... Update .gitlab-ci.yml
Checking cache for default...
$ npm prune
bash: line 56: npm: command not found
ERROR: Build failed: exit status 1