static-uploader
v1.0.0
Published
CLI tool to sync git file changes to fes.zuche.com
Readme
Static Uploader
A CLI tool to sync git repository file changes to fes.zuche.com static file server.
Installation
npm install
npm run buildUsage
You can run the tool using npx (if published) or directly via node:
node dist/index.js -u <username> -p <password> -f <file1>,<file2>Options
-u, --username <username>: Required. Your FES username.-p, --password <password>: Required. Your FES password.-f, --files <files>: Required. Comma-separated list of files to sync (relative to current directory).--pid <pid>: Project ID (default:801615).
Example
# Sync specific files
node dist/index.js -u myuser -p mypass -f dist/main.css,dist/app.js
# Sync with custom PID
node dist/index.js -u myuser -p mypass -f assets/logo.png --pid 123456Git Workflow Example (npx)
This example demonstrates how to use npx to run the tool, fetching credentials from environment variables, and syncing changes between master and master-synced branches.
# Assuming FES_USERNAME and FES_PASSWORD are set in your environment
npx static-uploader \
-u "$FES_USERNAME" \
-p "$FES_PASSWORD" \
--source master \
--target master-syncedCI/CD Integration
This tool is designed to be used in CI/CD pipelines. You can pass the list of changed files from your version control system to the -f argument.
Example (pseudo-code):
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD | tr '\n' ',')
node dist/index.js -u $FES_USER -p $FES_PASS -f "$CHANGED_FILES"