Frontend Deployment Automation Tool
Main problem: front-dev should manual build and send buildp path on other dev servers
- 🔄 Environment variable substitution in
.env
files - 🏗️ Build automation with custom commands
- 🚀 Multi-server SFTP deployment
- 🔒 Secure credential management
- 📊 Detailed logging for debugging
- Go 1.18+
- Git
git clone https://github.com/17neverends/buildcast.git
cd buildcast
go mod download
go build -o buildcast main.go
- config.json
{
// main settings
"main_cmd": "npm run build", // cmd for build frontend app
"build_output": "build", // path name for build files output
"frontend_env_path": ".env", // path to env file
"env_host": "REACT_APP_API_URL=", // field in env file for change
// individual remote server settings
"servers": [
{
"ip": "xx.xx.xx.xxx", // IP for connect
"password": "...", // password for connect
"user": "root", // system username
"host": "https://test.io", // this value will be override in .env
"sftp_port": 22, // sftp connection port
"path": "/home/project" // path for download files on remore server
}
]
}
-
Basic commands
./buildcast --config=config.json --service=admin_dashboard
-
Command Line Options
Flag Description --config Path to configuration file --service Service name suffix for deployment path
-
Reads configuration file
-
Backs up original .env file
-
For each server:
-
Updates environment variables
-
Executes build command
-
Cleans target directory
-
Deploys via SFTP
-
Restores original .env
-
-
github.com/pkg/sftp
-
golang.org/x/crypto/ssh