Download the PHP package mentosmenno2/sftp-deploy without Composer
On this page you can find all versions of the php package mentosmenno2/sftp-deploy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mentosmenno2/sftp-deploy
More information about mentosmenno2/sftp-deploy
Files in mentosmenno2/sftp-deploy
Package sftp-deploy
Short Description Package to deploy projects to an SFTP server
License MIT
Informations about the package sftp-deploy
Mentosmenno2 SFTP Deploy
Build and deploy PHP applications via (S)FTP, with a simple command!
Requirements
- PHP 7.1+
Installation
Install this dependency with composer as dev-dependency.
Add the commands to the Composer scripts by adding this in the composer.json
file.
Configuration
Use the init
command to generate a configuration file. See the Commands section below.
Open the generated sftp-deploy.config.json
file, and edit the properties following the specification below.
Configuration file properties
Property | Type | Default | Description |
---|---|---|---|
__builds_directory__ | string | "deployments" |
The path where the the build will be created. Relative to your project directory. |
builds_use_subdirectory | boolean | true |
Will make a separate subdirectory inside the builds_directory for your build. |
builds_keep_revisions | integer | 5 |
Revisions of builds to keep when cleaning up builds. |
__run_before__ | [] string | [] |
Commands to run before cloning your project from git |
__repo_url__ | string / null | null |
Repository url to use for cloning your project from git. |
repo_clone_directory | string | "." |
Path to clone the repo in. Relative to the builds_directory (with subdirectory if enabled). |
__repo_checkout__ | string | "master" |
Default branch or tag to checkout when cloning the repo. |
__run_after__ | [] string | [] |
Commands to run after cloning your project from git. |
__deploy_directory__ | string | "." |
Directory to upload to (S)FTP. Relative to the builds_directory (with subdirectory if enabled). |
__sftp_adapter__ | string | "sftp" |
Options: sftp , ftp . Adapter to choose for deploying. |
__sftp_host__ | string | "example.com" |
(S)FTP host. |
__sftp_port__ | integer | 22 |
(S)FTP port. SFTP usually uses 22 . FPT usually uses 21 . |
__sftp_username__ | string | "username" |
(S)FTP username. |
__sftp_password__ | string | "password" |
(S)FTP password. |
__sftp_root__ | string | "/path/to/root" |
Path where files from deploy_directory should be placed. Absolute path from (S)FTP root. |
__sftp_passive__ | boolean | true |
Use a passive connection. Only works when ftp is selected as sftp_adapter . |
__sftp_ssl__ | boolean | true |
Use a SSL connection. Only works when ftp is selected as sftp_adapter . |
__sftp_ignore_passive_address__ | boolean | false |
Don't use passive address. Useful when connection is blocked by firewall. Only works when ftp is selected as sftp_adapter . |
__sftp_private_key_file__ | string / null | null |
Path to private key file. Absolute path. Only works when sftp is selected as sftp_adapter . |
__sftp_private_key_password__ | string / null | null |
Private key password. Only works when sftp is selected as sftp_adapter . |
sftp_directory_permission | integer | 0755 |
Set directory permission of sftp_root . |
You can also use a custom configuration file. To do so, you can specify your custom configuration file, using the config
operand. If you do so, you should also change the current deploy command (see installation section), or create a new one.
Commands
All commands can be run in the following way:
Init
Generate a configuration file. This file will be called sftp-deploy.config.json
.
Build
Build the application.
Arguments
Argument | Required | Default | Description |
---|---|---|---|
checkout | No | master | The branch or tag you would like to checkout with git. Overwrites repo_checkout configuration parameter. |
Deploy
Build and deploy the application to a (S)FTP server.
Does these actions:
- First builds your app with the
build
command.- Then deploys that build to the (S)FTP server.
- Finally cleans up old builds with the
cleanup
command.
Arguments
Argument | Required | Default | Description |
---|---|---|---|
checkout | No | master | The branch or tag you would like to checkout with git. Overwrites repo_checkout configuration parameter. |
Cleanup
Cleanup old builds.
Notes:
- This only works when
builds_use_subdirectory
is enabled in the configuration.- Keeps up to
builds_keep_revisions
intact. See configuration.
Contributing
You are free to contribute on this project. I want this project to become better, just like you do.
If you want to contribute, please create a fork, and make a pull request.
Please note that your pull request needs to comply to these rules:
- It has to contain a description of why it's required or uesful.
- It has to contain a description of what the fix does.
- If some code could be unclear for other developers, please add comments.
- The code must pass the automatic Github action checks. You can test that locally by running
composer run test
.
Local installation
Code checks
Code must pass code checks to be used in this project.
You can also let the code checker try to fix problems by itself.
Note: This only fixes common problems. You may need to still fix some yourself.