跪拜 Guibai
← All articles
Frontend · Backend · Developer

A VS Code Extension That Zips, Uploads, and Deploys to Linux Servers in One Click

By 前端之虎陈随易 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Many developers still deploy frontend and small backend projects by hand because setting up a CI/CD pipeline feels like overkill. Simple Deploy removes the repetitive SFTP dance without forcing a workflow migration, cutting a 5-to-12-minute manual process down to a button press and a log review.

Summary

Manual deployment still means opening an SFTP client, navigating local and remote directories, dragging files, and double-checking that configs and user uploads aren't overwritten. Simple Deploy moves that entire sequence into VS Code. A project is configured once with a server address, an upload rule like `dist/**`, optional delete and retain rules, and shell commands to run before and after the transfer.

Instead of pushing hundreds of individual files, the extension compresses everything into a single ZIP archive, uploads it, and decompresses on the server. That sidesteps the per-file overhead that makes SFTP drags slow and that weakens rsync's incremental advantage when frontend builds produce new hashed filenames every time. Pre-commands run locally and halt the deploy on failure; post-commands run on the server for restarts or cache clears.

The extension targets the gap between ad-hoc manual uploads and a full CI/CD pipeline. It suits personal sites, documentation, client projects, and any workflow where a developer wants to push a prepared build to a Linux box with a single click and a clear log of what happened.

Takeaways
Server credentials, upload rules, delete rules, retain rules, and pre/post commands are saved per project inside VS Code.
Files are compressed into one ZIP before upload, then decompressed on the server, avoiding the overhead of transferring hundreds of small files individually.
Default behavior is overwrite-only; the extension never deletes server files unless explicit delete rules are set.
Retain rules protect critical server-side files like configs and user uploads from both overwrites and deletions.
A failed pre-command stops the entire deployment, preventing a broken build from reaching the server.
Post-commands run sequentially on the server for tasks like restarting a Node process or reloading Nginx, but a post-command failure does not roll back already-published files.
Deployment logs capture build time, compressed size, upload time, and per-step status so failures are traceable.
The extension supports any project that publishes files to a Linux server reachable via SSH, including Vue, React, Node, Java, Python, and Go projects.
Estimated manual time savings: roughly 4 minutes per deploy, or over 6 hours a month at 5 deploys per day.
Conclusions

ZIP-then-upload is a pragmatic optimization for frontend builds where hashed filenames make rsync's delta transfers less effective, a detail many deployment tools overlook.

The explicit retain-rule mechanism acknowledges a real operational risk: deployment tools that blindly mirror a local directory can wipe user-generated content and environment configs that exist only on the server.

Positioning the tool as a VS Code extension rather than a CLI or web dashboard keeps the deployment trigger inside the same window where code is written and built, reducing context-switching friction that CI/CD platforms don't address for solo developers and small teams.

Concepts & terms
Pre-commands
Shell commands that run locally before files are uploaded. If any pre-command fails, the deployment stops, ensuring only a successful build reaches the server.
Post-commands
Shell commands that execute on the remote server after files are uploaded and decompressed. Used for restarting services, reloading web servers, or clearing caches. Failures are logged but do not roll back the deployment.
Retain rules
Glob patterns that mark server-side files or directories as untouchable. Local files with the same name will not overwrite them, and delete rules will not remove them, protecting configs and user data.
From the discussion
Featured comments
白丶白白白白同学

Everyone can leave now, it costs money.

前端之虎陈随易

Freeloader, get lost.

白丶白白白白同学  → 前端之虎陈随易

I'm just giving a heads-up to the JY folks who don't know. After all, your article didn't mention this most critical point.

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗