你好,我的项目中有简单的配置:
version: 2
jobs:
build:
docker:
- image: circleci/node:7
steps:
- checkout
- run:
name: install-dependencies
command: npm install
- run:
name: tests
command: npm test
- deploy:
name: digital-ocean
command: ssh -o "StrictHostKeyChecking no" user@hostname "cd ~/profile-store; git pull; npm install; forever start app.js"问题是它需要多个命令:
(在第二次迭代中,应该从服务器安装包,并在下一次运行时在客户端进行单元测试)
我尝试了以下语法:
但却犯了个错误。问题是:
如何在一条命令指令中执行3条命令?
发布于 2019-11-12 14:39:24
command: cd client && npm install && cd ..为了增强可读性,您可以使用折叠块标量(折叠换行为空格):
command: >-
cd client &&
npm install &&
cd ..注意,您实际上并不需要最终的cd ..,因为执行命令的shell实例没有被重用。
https://stackoverflow.com/questions/58817676
复制相似问题