Set up sFTP
Within CloudSuite, sFTP is used extensively to deploy changes to the Development Environment.
Ensure you have an sFTP client, or sFTP extension for Visual Studio Code.
Installing the sFTP extension in Visual Studio Code
Search for the sFTP extension in the Extensions panel and install it. Alternatively, execute the following command in your terminal:
code --install-extension Natizyskunk.sftp
For this example, we will use Visual Studio Code. You can set up a config by opening the Command Palette and searching for SFTP: Config. This will create a default config. Replace it with the following config and add your credentials/information.
Single Themes
sFTP config for regular themes
{
"name": "DEV ENVIRONMENT",
"host": "",
"protocol": "sftp",
"port": 22,
"username": "",
"remotePath": "",
"agent": "$SSH_AUTH_SOCK",
"privateKeyPath": "", // optional, path to your private key
"passphrase": true, // optional
"uploadOnSave": true,
"watcher": {
"files": "**/*",
"autoUpload": true,
"autoDelete": true
},
"ignore": [
"**/.vscode",
".idea",
".git",
".gitignore",
".gitlab-ci",
"package-lock.json",
"package.json",
"tsconfig.json",
".DS_Store",
"node_modules",
"webpack.config.js",
"**/src"
]
}
Monorepos
sFTP config for monorepo themes
[
{
"name": "Theme 1",
"host": "",
"protocol": "sftp",
"port": 22,
"username": "",
"context": "theme-1",
"remotePath": "customer/test-theme-1",
"privateKeyPath": "",
"agent": "$SSH_AUTH_SOCK",
"uploadOnSave": true,
"watcher": {
"files": "**/*",
"autoUpload": true,
"autoDelete": true
},
"ignore": [
"**/.vscode",
".idea",
".git",
".gitignore",
".gitlab-ci",
"package-lock.json",
"package.json",
"tsconfig.json",
".DS_Store",
"node_modules",
"webpack.config.js",
"**/src"
]
},
{
"name": "Theme 2",
"host": "",
"protocol": "sftp",
"port": 22,
"username": "",
"context": "theme-2",
"remotePath": "customer/test-theme-2",
"privateKeyPath": "",
"agent": "$SSH_AUTH_SOCK",
"uploadOnSave": true,
"watcher": {
"files": "**/*",
"autoUpload": true,
"autoDelete": true
},
"ignore": [
"**/.vscode",
".idea",
".git",
".gitignore",
".gitlab-ci",
"package-lock.json",
"package.json",
"tsconfig.json",
".DS_Store",
"node_modules",
"webpack.config.js",
"**/src"
]
}
]
Best Practices
Tips
-
To add your SSH agent to your keychain on a Mac, use the command
> ssh-add --apple-use-keychain --app -
To sync all changes to the sFTP server in VSCode, use the command:
Windows:
Ctrl + Shift + PMac:
.mdx + Shift + P