我是CircleCI的新手,我的配置如下。我正在尝试rsync文件到服务器。连接工作正常,但在完成后没有文件被复制到服务器。我的路径和rsync命令有什么问题吗?
version: 2
jobs:
build:
docker:
- image: duanecilliers/alpine-composer-rsync:latest
steps:
- checkout
deploy:
machine:
enabled: true
steps:
- add_ssh_keys:
fingerprints:
- "5e:3c:c3:58:9d:cf:fX:XX:XX:XX:XX:84:8a:b9:XX:XX"
- run:
name: Deploy Over SSH
command: |
rsync -e ssh -avvz --exclude=node_modules ~/project [email protected]:/srv/users/serverpilot/apps/XXXX/public/
workflows:
version: 2
build-and-deploy:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only: master
我得到以下输出。
#!/bin/bash -eo pipefail
rsync -e ssh -avvz --exclude=node_modules ./ [email protected]:/srv/users/serverpilot/apps/xxx/public/
opening connection using: ssh -l serverpilot 172.XXX.XX.XX rsync --server -vvlogDtprze.iLs . /srv/users/serverpilot/apps/xxx/public/ (9 args)
Warning: Permanently added '172.XXX.XX.XX' (ECDSA) to the list of known hosts.
sending incremental file list
delta-transmission enabled
./
total: matches=0 hash_hits=0 false_alarms=0 data=0
sent 62 bytes received 50 bytes 32.00 bytes/sec
total size is 0 speedup is 0.00
没有文件被复制到您的服务器,因为deploy
作业没有任何文件。
build
工作得到文件,但checkout
步骤,这基本上是git clone
。有几种方法可以将文件放入deploy
作业,但在这种情况下,您最好的选择是使用CircleCI Workspaces将文件从build
作业复制到deploy
作业。