【发布时间】:2017-08-25 18:38:00
【问题描述】:
有关于为 circleci v1 而不是 v2 设置纱线的文档,因为看起来好像他们已经将纱线烘焙到 v2 api 中,但是,在我的 config.yml 中,我明确运行纱线来安装我的 deps,当我查看构建日志,它显示 npm 用于我所有的纱线命令......我显然需要覆盖这个/安装纱线?不幸的是,v2 文档似乎没有涉及到这一点,而且我的 google-foo 也没有取得成果……
更有趣的是,我的另一个项目是使用具有几乎完全相同配置的纱线……什么给出了?
这是我当前的 config.yml
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:7.10
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4
working_directory: ~/repo
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: yarn
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
# run tests!
- run: yarn test
- run: echo "ALL GOOD IN THE HOOD"
- deploy:
name: Deploy on deploy branch
command: |
if [ "${CIRCLE_BRANCH}" == "deploy" ]; then
./node_modules/.bin/firebase ...
fi
【问题讨论】: