Remote Deploy
VS Code extension để upload source local lên SFTP remote host, theo luồng Deployment/Remote Deploy của PhpStorm.
Hiện có
- Tạo profile SFTP bằng Password, SSH key pair, hoặc OpenSSH config + authentication agent.
- Sửa profile đã tạo từ Command Palette hoặc menu chuột phải trên profile trong Remote Deploy sidebar.
- Lưu password bằng VS Code SecretStorage.
- Upload file/thư mục từ Explorer hoặc Command Palette.
- Upload toàn workspace.
- Remote Deploy sidebar theo cấu trúc
Profile → Remote root → files/folders, luôn xếp folder trước file.
- Double-click file remote để mở trực tiếp trong editor;
Ctrl+S ghi file trở lại remote host.
- Compare file remote với local bằng VS Code Diff Viewer.
- Upload một file local trực tiếp vào thư mục remote đã chọn qua
Upload Here.
- Tạo directory, rename và xoá file/folder remote (có xác nhận trước khi xoá).
- Upload khi save: tắt, chỉ explicit save, hoặc luôn upload.
- Mapping local/remote, exclude glob và temporary upload + rename.
- OpenSSH alias dùng
sftp native, nên kế thừa ~/.ssh/config, ssh-agent, ProxyJump và known_hosts.
Chạy extension để phát triển
npm install
npm run compile
npm test
npm run package
Mở thư mục remote-deploy trong VS Code và nhấn F5. Trong Extension Development Host, chạy Remote Deploy: Add Profile từ Command Palette.
Cấu hình mẫu
{
"remoteDeploy.profiles": [
{
"name": "staging",
"protocol": "sftp",
"host": "staging.example.com",
"port": 22,
"username": "deploy",
"authentication": { "type": "keyPair", "privateKeyPath": "~/.ssh/id_ed25519" },
"localRoot": "${workspaceFolder}",
"remoteRoot": "/var/www/app",
"uploadOnSave": "explicitSave",
"useTemporaryFile": true,
"exclude": ["**/.git/**", "**/node_modules/**"]
}
],
"remoteDeploy.defaultProfile": "staging"
}
Với OpenSSH config, dùng authentication: { "type": "openSshConfig", "host": "my-staging" }. Thông tin host, key, agent và jump host được lấy từ ~/.ssh/config.
Tài liệu thiết kế và lộ trình được lưu trong project-overview.md của source repository.