How to upload to FTP from Travis CI
The Travis doc says only that you should do this kind of stuffs in the after_success:
section. The specified command is just an example.
So, do what you want from your computer, then put the sequence of commands that you used in the after_success:
section.
In your case, creating an archive (with tar
) and then uploading it (with curl
or directly with ftp
) should work, if I correctly understood your needs.
- Use the find command to add everything except for specific folders.
- Add the environment variables
SFTP_USER
andSFTP_PASSWORD
in the Settings menu.
This is my yml:
language: node_jsafter_success:- find . -type d \( -path "./.*" -o -path "./node_modules" \) -prune -o -name "*" -print -exec curl --ftp-create-dirs -T {} ftp://your.server.com/dir/ --user ${SFTP_USER}:${SFTP_PASSWORD} \;
Sometimes the below link will help. Its about FTP deployment in node_js app.