|
1 | 1 | svn2ftp
|
2 | 2 | =======
|
| 3 | +## Purpose |
| 4 | +### Short Story |
| 5 | +This Python script automatically uploads SVN commits to a specified FTP location. |
3 | 6 |
|
4 |
| -Python script to automatically upload svn repo to ftp location |
| 7 | +### Long Story |
| 8 | +When converting my website to SVN, I wanted a tool to allow me to avoid manually |
| 9 | +uploading changes to my FTP server. I found some solutions online, but most of |
| 10 | +them weren't exactly what I was looking for, and many were too complicated. |
| 11 | + |
| 12 | +I ended up making something from scratch using the changelist provided by SVN. |
| 13 | +I had to figure out how to pass it the sensitive user information. I decided |
| 14 | +to use a local file which the script would use to extract what it needed. |
| 15 | +While it's not the most secure solution, it was good enough for my needs. |
| 16 | +Feel free to fork this project and implement your own way of passing the ftp information. |
| 17 | +An example solution could be to prompt the user each time a commit is pushed. |
| 18 | + |
| 19 | +## Installation |
| 20 | +This script is very simple to install. |
| 21 | + |
| 22 | +1. Copy post-commit.bat and FTP.py to your svn\hooks\ folder. |
| 23 | +2. Create a file that will contain the necessary FTP server information (each item should be on its own line, in the following order): |
| 24 | + - The full path location to the local SVN repo |
| 25 | + - The full URL to the FTP server |
| 26 | + - The username for the FTP server |
| 27 | + - The password for the FTP server |
| 28 | + - The root directory to upload the repo to (default should be './') |
| 29 | +3. Modify FTP.py's SETTINGS_FILE variable to the full location of this file |
| 30 | +4. Make a commit and see the script run. |
| 31 | + |
| 32 | +### Example settings file |
| 33 | +<pre> |
| 34 | +E:\mysite |
| 35 | +robbie.ftpserver.org |
| 36 | +robbie |
| 37 | +thepassword |
| 38 | +public_html/ |
| 39 | +</pre> |
| 40 | + |
| 41 | +## TODO |
| 42 | +- Modify post-commit.bat so the command prompt closes automatically |
| 43 | + - Add a debug variable to make this easily configurable |
| 44 | +- Fix bug when "adding" a file that already exists on the server |
0 commit comments