Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.
Marcel Kloubert edited this page Jul 15, 2018 · 73 revisions

vscode-deploy-reloaded wiki

Table of contents

  1. Settings

Settings []

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

Add a deploy.reloaded section:

{
    "deploy.reloaded": {
        "packages": [
            {
                "name": "Version 2.3.4",
                "description": "Package version 2.3.4",

                "files": [
                    "**/*.php",
                    "/*.json"
                ],
                "exclude": [
                    "tests/**"
                ],

                "deployOnSave": [ "My SFTP folder" ]
            }
        ],

        "targets": [
            {
                "type": "sftp",
                "name": "My SFTP folder",
                "description": "A SFTP folder",

                "host": "localhost", "port": 22,
                "user": "tester", "password": "password",

                "dir": "/my_package_files"
            }
        ]
    }
}
Name Description
alwaysShowWorkspaceNameInPopups Show workspace name in popups, even if there is only one workspace open. Default: (false)
alwaysShowWorkspaceSelector Always show workspace button, even if there is only one workspace open or not. Default: (false)
apis Defines one or more API hosts, which can control the editor.
buttons Defines one or more global buttons, which execute an editor command.
checkForRequirements One or more requirements to check.
clearOutputOnStartup Clear output on startup or not. Default: (false)
commands A list of one or more script based commands to register to VS Code.
deployOnChange Activate or deactivate deploy on change for all packages. Default: (true)
deployOnChangeButton Shows a button that (de-)activate "deploy on change" feature. Default: (false)
deployOnSave Activate or deactivate deploy on save for all packages. Default: (true)
deployOnSaveButton Shows a button that (de-)activate "deploy on save" feature. Default: (false)
env Settings for the environment of the current process.
executeOnStartup One or more shell commands, which should be run on startup.
fastCheckOnChange Value that indicates, if "fast file check" should be made for deploy on change in all packages by default. Default: (false)
fastCheckOnSave Value that indicates, if "fast file check" should be made for deploy on save in all packages by default. Default: (false)
fastCheckOnSync Value that indicates, if "fast file check" should be made for sync when open in all packages by default. Default: (false)
fastFileCheck Value that indicates, to do a "fast file check" for any "auto deploy" settings in all packages by default. Default: (false)
globals A list of variables that can be accessed globally (from scripts, e.g.).
ignore An optional list of one or more glob pattern for files that should ignored, even if they are trying to be deployed, s. Ignore files.
ignoreGitFolder Ignore .git folder by default or not. Default: (true)
ignoreSettingsFolder Ignore .vscode folder by default or not. Default: (true)
ignoreSvnFolder Ignore .svn folder by default or not. Default: (true)
imports One or more external settings to import.
initBower Runs bower install inside the workspace folder on startup, if a bower.json file exists and NO bower_components sub folder has been found. Default: (false)
initComposer Runs composer install inside the workspace folder on startup, if a composer.json file exists and NO vendor sub folder has been found. Default: (false)
initNodeModules Runs npm install inside the workspace folder on startup, if a package.json file exists and NO node_modules sub folder has been found. Default: (false)
initYarn Runs yarn install (instead of npm install) inside the workspace folder on startup, if a package.json file exists and NO node_modules folder has been found. Default: (false)
language The custom ID of the language to use (e.g. en, de).
openOutputOnStartup Open the output window on after settings have been (re)loaded or not. Default: (false)
packages One or more package that describe which files of your workspace should be deployed.
proxies Defines one or more TCP proxies.
removeIfEmpty [IN DEVELOPMENT] The default value, that indicates if a target folder should be removed, if it is empty after an operation, like remove on change. Default: (false)
removeOnChange Activate or deactivate remove on change for all packages. Default: (true)
removeOnChangeButton Shows a button that (de-)activate remove on change feature. Default: (false)
requiredExtensions Defines one or more required extensions.
runBuildTaskOnStartup Run build task on startup or define the wait time, in milliseconds, after the build task should be run after startup. Default: (false)
runGitPullOnStartup Run Git pull on startup or define the wait time, in milliseconds, after Git pull should be run after startup. Default: (false)
saveBeforeDeploy Indicates to save files automatically, before they are going to be deployed. Default: (true)
showPopupOnSuccess Show a popup after a successfull deploy operation or not. This requires to set up showPopupWhenFinished setting. Default: (true)
showPopupWhenFinished Shows a popup when a deploy operation has been finished. This can be a boolean value that indicates if a popup should be shown, when at least 2 files have been handled, or a number which defines the minimum number of handled files, before a popup is shown. Default: (false)
showStatusWhenFinished Show a button in the status bar, after a deploy operation has been finished or not. This can be a boolean value or a number, which defines the time, in milliseconds, after such a button should disapear automatically. Default: (false)
showWorkspaceNameInPopups Show workspace name as prefix in popup messages or not. Default: (false)
startupCommands A list of one or more Visual Studio Code commands that should be run on startup.
syncWhenOpen Activates or deactivates "sync when open" feature. Default: (true)
targets One or more target that describe where files can be deployed to.
timeToWaitBeforeActivateDeployOnChange The time (in milliseconds) to wait before activating 'deploy on change' feature.
timeToWaitBeforeActivateRemoveOnChange The time (in milliseconds) to wait before activating 'remove on change' feature.
useFastGlob Use fast-glob instead of node-glob by default or not. Default: (false)
useGlobalQueue Use a global queue for all deploy operations or not. Default: (false)
values Defines one or more values that can be accessed via placeholders, e.g.

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.reloaded": {
        "packages": [
            {
                "name": "Version 2.3.4",
                "description": "Package version 2.3.4",
                "files": [
                    "**/*.php",
                    "/*.json"
                ],
                "exclude": [
                    "tests/**"
                ]
            },
            {
                "name": "Version 2.3.5 (anything)",
                "description": "Package version 2.3.5"
            }
        ]
    }
}
Name Description
applyValuesTo Defines values that should be applied to one or more properties of that package.
button If defined, a button is shown in the status bar. Instead of defining properties, you can also use a boolean value, such as (true) or (false).
deployOnChange One or more files to deploy if they change. s. Deploy on change
deployOnSave Deploy a file of this package on save or not. s. Deploy on save
description The description of the package.
fastCheckOnChange Value that indicates, if "fast file check" should be made for deploy on change in that package. Default: (false)
fastCheckOnSave Value that indicates, if "fast file check" should be made for deploy on save in that package. Default: (false)
fastCheckOnSync Value that indicates, if "fast file check" should be made for sync when open in that package. Default: (false)
fastFileCheck Value that indicates, to do a "fast file check" for any "auto deploy" settings in that package by default. Default: (false)
files Files to include (s. node-glob). Default: **
git Settings for importing files from git.
if One or more conditions (as JavaScript code) that defines if package is available or not, similar to values.
isHidden Hide package in the GUI or not. Default: (false)
name The name of the package.
pauseFilesFor The number of milliseconds to wait before an auto operation can be done for a file again.
platforms One or more platform names the package is for. s. process.platform
removeIfEmpty [IN DEVELOPMENT] Indicates if a target folder should be removed, if it is empty after a remove on change operation of that package, or not. Default: (false)
removeOnChange One or more files to delete if they are deleted locally. s. Remove on change.
syncWhenOpen Sync files when open. This can be an object with settings, a string with a target name from where to sync from or a boolean value, that indicates to activate the feature for all files of that package.
targets One or more optional and explicit target names to deploy to.
useFastGlob Use fast-glob instead of node-glob for that package or not. Default: (false)

* supports placeholders

Buttons []

You are able to define status bar buttons for each of your packages by setting up the button property:

{
    "deploy.reloaded": {
        "packages": [
            {
                "name": "My package",
                
                "button": {
                    "text": "Deploy to 'My target'",
                    "tooltip": "Click here to deploy to the target...",

                    "targets": [ "My target" ]
                }
            }
        ],

        "targets": [
            {
                "name": "My target"
            }
        ]
    }
}
Name Description
color The custom (text) color.
command The custom ID for the underlying command.
enabled Enable button or not. Default: (true)
isRight Put button on the right side or not. Default: (false)
priority The priority.
showPrompt Ask before start deploy operation or not. Default: (false)
targets One or more custom target names for that button. If not defined, the targets from the underlying package are used.
text* The custom display text.
tooltip* The custom tooltip text.
type The type of deploy operation. Possible values are: delete, deploy or pull. Default: deploy

* supports placeholders

Targets []

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

The extension supports the following target types:

There also some special target types you can use:

Add the subsection targets in your .vscode/settings.json file and add one or more entry:

{
    "deploy.reloaded": {
        "targets": [
            {
                "type": "sftp",
                "name": "My SFTP folder",
                "description": "A SFTP folder",

                "dir": "/my_package_files",
                "host": "localhost", "port": 22,
                "user": "tester", "password": "password",

                "mappings": {
                    "/dir/of/files/that/should/be/mapped/**/*": "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": "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>"
            }
        ]
    }
}
Name Description
applyValuesTo Defines values that should be applied to one or more properties of that target.
beforeDelete List of operations that should be invoked BEFORE delete operation starts.
beforeDeploy List of operations that should be invoked BEFORE deployment starts.
beforePull List of operations that should be invoked BEFORE pull operation starts.
checkBeforeDeploy Check for newer files before a deploy operation starts or not. Default: (false)
checkBeforePull Check for older files before a pull operation starts or not. Default: (false)
deleted The operations that should be invoked AFTER ALL files have been deleted successfully.
deployed The operations that should be invoked AFTER ALL files have been deployed successfully.
description The description of the target.
encryptBy A custom algorithm to use for the encryption. Default: aes-256-ctr
encryptWith An optional password that is used to encrypt the data.
hideIf A list of one or more package names that indicates if that target is hidden from GUI if one of the package(s) has been selected.
if One or more conditions (as JavaScript code) that defines if target is available or not, similar to values.
isHidden Hide target in the GUI or not. Default: (false)
mappings The optional list of one or more folder mappings.
name The name of the target.
platforms One or more platform names the target is for. s. process.platform
prepare List of operations that should be invoked before the operations of beforeDeploy and even if no file is going to be handled.
pulled The operations that should be invoked AFTER ALL files have been pulled successfully.
showIf A list of one or more package names that indicates if that target is only shown in GUI if one of the package(s) has been selected.
transformer Path to a script which transforms data before it is deployed or after it has been pulled.
transformerOptions Options for the data transformer script.
type The type.
useFastGlob Use fast-glob instead of node-glob for that target or not. Default: (false)