node package manager

vs-deploy

Commands for deploying files of your workspace to a destination.

vs-deploy

Latest Release Installs Rating

Visual Studio Code (VS Code) extension that provides commands to deploy files of a workspace to a destination.

The extension supports the following destination types:

There is also build-in support for the following compilers and processors:

Donate

Table of contents

  1. Demos
  2. Install
  3. How to use

Demos []

Deploying to SFTP []

Demo SFTP

Deploy on save []

Demo Deploy on save

Deploy to remote Visual Studio Code instance []

Demo Remote

Deploy to ZIP file []

Demo ZIP

Install []

Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter:

ext install vs-deploy

Or search for things like vs-deploy in your editor:

Screenshot VSCode Extension search

How to use []

Detailed information can be found at the wiki.

Otherwise...

Settings []

Open (or create) your settings.json in your .vscode subfolder of your workspace.

Add a deploy section:

{
    "deploy": {
    }
}

Packages []

A package is a description of files of your workspace that should be deployed.

Add the subsection packages and add one or more entry:

{
    "deploy": {
        "packages": [
            {
                "name": "Version 2.3.4",
                "description": "Package version 2.3.4",
                "files": [
                    "**/*.php",
                    "/*.json"
                ],
                "exclude": [
                    "tests/**"
                ],
                "deployOnSave": true
            }
        ]
    }
}

Look at the wiki to get more information about packages.

Targets []

A target describes where a file or package should be transfered to.

Add the subsection targets and add one or more entry:

{
    "deploy": {
        "targets": [
            {
                "type": "sftp",
                "name": "My SFTP folder",
                "description": "A SFTP folder",
                "dir": "/my_package_files",
                "host": "localhost", "port": 22,
                "user": "tester", "password": "password",
 
                "mappings": [
                    {
                        "source": "dir/of/files/that/should/be/mapped",
                        "target": "dir/on/target"
                    }
                ]
            },
            {
                "type": "ftp",
                "name": "My FTP folder",
                "description": "A FTP folder",
                "dir": "/my_package_files",
                "host": "localhost", "port": 21,
                "user": "anonymous", "password": "",
 
                "deployed": [
                    {
                        "type": "sql",
                        "engine": "mysql",
 
                        "queries": [
                            "TRUNCATE TABLE `debug`",
                            "TRUNCATE TABLE `logs`"
                        ]
                    },
                    {
                        "target": "https://github.com/mkloubert"
                    }
                ]
            },
            {
                "type": "local",
                "name": "My local folder",
                "description": "A local folder",
                "dir": "E:/test/my_package_files"
            },
            {
                "type": "local",
                "name": "My network folder",
                "description": "A SMB shared network folder",
                "dir": "\\\\MyServer\\my_package_files"
            },
            {
                "type": "zip",
                "name": "My ZIP file",
                "description": "Create a ZIP file in a target directory",
                "target": "E:/test"
            },
            {
                "type": "mail",
                "name": "My mail server",
                "description": "An email deployer",
                "host": "smtp.example.com", "port": 465,
                "secure": true, "requireTLS": true,
                "user": "mkloubert@example.com", "password": "P@assword123!",
                "from": "mkloubert@example.com",
                "to": "tm@example.com, ys@example.com"
            },
            {
                "type": "script",
                "name": "My script",
                "description": "A deploy script",
                "script": "E:/test/deploy.js",
                "options": {
                    "TM": 5979,
                    "MK": "23979"
                }
            },
            {
                "type": "http",
                "name": "My HTTP service",
                "description": "A HTTP service on a HTTP server, e.g.",
                "url": "https://host.example.com/webdav/?file=${VSDeploy-File}",
                "user": "mkloubert", "password": "P@ssword123!"
            },
            {
                "type": "remote",
                "name": "My remote target",
                "description": "Some remote VS Code instances to deploy to",
                "hosts": ["localhost", "192.168.0.101", "192.168.0.101:5979"]
            },
            {
                "type": "app",
                "name": "My App",
                "description": "An app to call",
                "app": "E:/test/deploy.cmd",
                "arguments": ["a", "b", "c"]
            },
            {
                "type": "batch",
                "name": "My Batch",
                "description": "A batch operation",
                "targets": ["My mail server", "My ZIP file"]
            },
            {
                "type": "azureblob",
                "name": "My Azure blob storage",
                "description": "An container in an Azure blob storage",
                "container": "my-container",
                "account": "my-storage-account",
                "accessKey": "<ACCESS-KEY-FROM-AZURE-PORTAL>"
            },
            {
                "type": "s3bucket",
                "name": "My Amazon Bucket",
                "description": "An Amazon AWS S3 bucket",
                "bucket": "my-bucket"
            },
            {
                "type": "dropbox",
                "name": "My DropBox folder",
                "description": "Deploy to my DropBox folder",
 
                "token": "<ACCESS-TOKEN>"
            },
            {
                "type": "api",
                "name": "My REST API",
                "description": "Deploys to a vs-rest-api",
 
                "host": "vscode.example.com",
                "user": "rgrimes", "password": "lori"
            }
        ]
    }
}

Look at the wiki to get more information about targets.

How to execute []

Press F1 to open the list of commands and enter one of the following commands:

Demo How to execute

Name Description Shortcut (CTRL is CMD on Mac)
Deploy: Deploy current file / folder Deploys the current opened file. CTRL + ALT + F
Deploy: Start/stop listening for files Start/stop listening for files from a remote machine. CTRL + ALT + L
Deploy: Deploy workspace Deploys a specific package. CTRL + ALT + W