【问题标题】:CircleCI files are not synced to the serverCircleCI 文件未同步到服务器
【发布时间】:2018-11-01 06:17:48
【问题描述】:

我是 CircleCI 的新手,我的配置如下。我正在尝试将文件同步到服务器。连接工作正常,但完成后没有文件被复制到服务器。我的路径和 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 serverpilot@1XX.104.XX.XX:/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 ./ serverpilot@172.XXX.XX.XX:/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

【问题讨论】:

    标签: circleci circleci-2.0


    【解决方案1】:

    没有文件被复制到您的服务器,因为deploy 作业没有任何文件。

    build 作业获取文件,但checkout 步骤基本上是git clone。有几种方法可以将文件放入deploy 作业,但在这种情况下,您最好的选择是使用CircleCI Workspaces 将文件从build 作业复制到deploy 作业。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-28
      • 1970-01-01
      • 2012-04-02
      相关资源
      最近更新 更多