bolt / simple-deploy
A simple tool to deploy a site build from a local workstation to a (S)FTP enabled host.
Installs: 8 700
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 11
Forks: 3
Open Issues: 3
Requires
- bolt/bolt: ^3.4
- bolt/collection: ^1.1
- bolt/filesystem: ^2.4
- league/flysystem-sftp: ^1.0
- symfony/config: ^2.8 || ^3.3 || ^4.0
- symfony/console: ^2.8 || ^3.3 || ^4.0
- symfony/yaml: ^2.8 || ^3.3 || ^4.0
Requires (Dev)
- doctrine/cache: ^1.6
- phpunit/phpunit: ^4.8 || ^5.7 || ^6.0
This package is auto-updated.
Last update: 2024-11-29 05:26:43 UTC
README
To use this tool, on your development machine only you can create a file
named .deploy.yml
.
Each key in the .deploy.yml
represents a deployment target that can be
uploaded to via either FTP or SFTP (secure FTP).
Every deployment configuration you add to .deploy.yml
must set the protocol
to either ftp
or sftp
, and an options
array.
NOTE: If your host provides SFTP, it is the preferred upload method as it is both faster and more secure than FTP alone, and supports more functionality.
Command Usage
php app/nut setup:deploy [options] <target>
Arguments
Options
Example: Editing or creating a connection
php app/nut setup:deploy --edit production
Example: Checking a connection
php app/nut setup:deploy --check production
Example: Running a deployment
php app/nut setup:deploy production
Configuration File
Configuration is done in a .deploy.yml
file in the site's root directory on
your development environment, with the following format:
staging:
protocol:
options:
host:
root:
username:
…
FTP Options
Options
Example
staging:
protocol: ftp
options:
host: example.com
root: my-site
username: deploy
password: 'your password goes here'
NOTE: In the above example, the root directory is a subdirectory of the
remote user's home directory called my-site/
, e.g. /home/deploy/my-site/
.
SFTP Options
Options
NOTE: Either a password
or privateKey
must be set.
Example: Password Login
production:
protocol: sftp
options:
host: example.com
username: deploy
password: 'your password goes here'
root: /var/www/sites/example.com
Example: Key-Based Login
production:
protocol: sftp
options:
host: example.com
username: deploy
privateKey: /home/your_home_dir/.ssh/id_rsa
root: /var/www/sites/example.com
Setting Permissions
You can control the permissions of newly created files and directories by
adding a permissions
key under options
.
By default, Simple Deploy will set files to 0664
and directories to 0775
,
but if you need less restricted permissions (not recommended) you can set
them like:
options:
permissions:
file: 0666
dir: 0777
Of course more secure values are also possible and recommended.
Editing
A very simple editor is also available by adding the --edit
option to the
command.
php app/nut setup:deploy --edit <target>
Example: Editing the configuration for the "production" target
php app/nut setup:deploy --edit production