Push to several FTP servers

Viewed 71

So I have a gitlab repo that currently sync with an SFTP server everytime I make an commit. Now I have another SFTP server which I also have to push the files to but I'm not sure how I should do this automatically. This is the yml script I have right now:

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

What would the best way to do this to several servers? Thanks

1 Answers
Related