~magentix/stapy-plugin-sftp

Allow to send Stapy website files to remote server by SFTP.
More verbose debug
First release

clone

read-only
https://git.sr.ht/~magentix/stapy-plugin-sftp
read/write
git@git.sr.ht:~magentix/stapy-plugin-sftp

You can also use your local clone with git send-email.

#Stapy - SFTP deployment

Allow to send website files to remote server by SFTP.

#Requirement

  • Stapy >= 1.17.1
  • pysftp module
pip install pysftp

#Installation

  1. Add the sftp.py plugin script in the plugins directory.

  2. Add the sftp.json config file in the source directory.

#Configuration

Open the sftp.json config file and edit with the remote server SFTP connection for the environments you want to deploy.

{
    "prod": {
        "host": "sftp.example.com",
        "user": "username",
        "pass": "password",
        "port": 22,
        "root": "./",
        "clean": false,
        "debug": true
    }
}

prod is your Stapy environment name in the web directory.

Key Description Example
host SFTP server host sftp.example.com
user SFTP username john
pass SFTP password Password!
port SFTP port 22
root The server directory where to add website files ./
clean Clean the server directory before upload files false
debug Display uploaded directories in the terminal false

The cleaning option allows to remove website files to avoid orphan files on the server (like a resource renamed). Take care that the root folder is correctly configured before activation.

#Deploy

Note: A build is performed before the deployment.

#From URL

Access to http://127.0.0.1:1985/_deploy/sftp

curl -s http://127.0.0.1:1985/_deploy/sftp

#From Editor

Add a new deployment button in the editor.json configuration file:

{
  ...
  "grid": {
    "actions": [
      ...
      {
        "path": "deploy/sftp",
        "class": "button-confirm pure-button",
        "label": "Deploy (SFTP)"
      }
      ...
    ]
  }
}

Screenshot