A PHP CLI tool for uploading version changesets to an FTP remote server. This is quite helpful when you make changesets to a project under version control and want to upload only changed files by revision number or range.
You can manage several projects with the same tool.
repo2ftp -c project_config_name [-m module] -r rev_range
- all files marked as (M)odified or (A)dded will be uploaded
- all files marked as (D)eleted will be deleted from the remote side
- 'rev_range' is in the same form used by the VCS
- if 'module' option is not provided, 'base' is assumed
[options] -l [language] (language [it|en], defaults to system language) -r [revision range] (the revision range in the form used by the VCS, i.e. in git revA..revB) -c [project] (the project name, as the name of ini file in config folder) -m [module] (the module/profile name, you can have multiple profiles in a project) -d (test mode, does not process the job, only lists the actions to do) -u (uploads only, skips delete job) -e (deletes only, skips upload job)
Create a folder named "config" at the same level of repo2ftp. Inside create an ".ini" file with the name of your project, don't use spaces! Inside the ini file put these options:
ftp.host = "ftp.server.net"
ftp.username = "username"
ftp.password = "password"module.base.type = "svn" ; or "git" module.base.path.local = "/the/absolute/path/of/the/project"
module.base.path.repository = "/trunk"
module.base.path.ftp = "/httpdocs/project"
module.base.path.exclude[] = "/^example//"
module.base.path.exclude[] = "/^tmp//"
you have a project named "Hello Word" with the following:
the absolute path of the project is "/home/user/work/hello_world" and contains the following
.
..
.svn
css/
images/
uploads/
index.php
httpdocs/ <- your project goes here
httpsdocs/
logs/
your ini file should look like this:
ftp.host = "ftp.myftpserver.com"
ftp.username = "your_username"
ftp.password = "your_password"module.base.type = "svn" module.base.path.local = "/home/user/work/hello_world"
module.base.path.repository = "/trunk"
module.base.path.ftp = "/httpdocs"
module.base.path.exclude[] = "/^uploads//"