【发布时间】:2021-03-02 20:22:17
【问题描述】:
所以我有一个 gitlab 存储库,当前每次提交时它都会与 SFTP 服务器同步。现在我有另一个 SFTP 服务器,我还必须将文件推送到该服务器,但我不确定我应该如何自动执行此操作。这是我现在拥有的 yml 脚本:
stages:
- push
- notification
push:
stage: push
image: debian:stable
before_script:
- apt-get update -y --allow-unauthenticated
- apt-get install -y git git-ftp --allow-unauthenticated
- git config http.sslVerify "false"
- git config --global http.sslVerify "false"
- git config git-ftp.url "sftp://$FTP_URL/$FTP_PATH"
- git config git-ftp.user "$FTP_USER"
- git config git-ftp.password "$FTP_PASSWORD"
script:
- git ftp push -v --insecure
对多台服务器执行此操作的最佳方法是什么?谢谢
【问题讨论】:
标签: git gitlab yaml gitlab-ci sftp