Docker 配置.yml以执行多个命令
您好,我的项目中有简单的配置:Docker 配置.yml以执行多个命令,docker,yaml,configure,circleci,Docker,Yaml,Configure,Circleci,您好,我的项目中有简单的配置: version: 2 jobs: build: docker: - image: circleci/node:7 steps: - checkout - run: name: install-dependencies command: npm install - ru
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"
问题是它需要乘法命令:
- cd客户端
- npm启动
- cd
- 命令:[“cd客户端”、“npm安装”、“cd..”]
command: cd client && npm install && cd ..
为了增强可读性,可以使用折叠块标量(将换行符折叠为空格):
请注意,您实际上并不需要最终的cd..
,因为执行命令的shell实例不会被重复使用
command: >-
cd client &&
npm install &&
cd ..