Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (shipfe) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Shipfe
A powerful deployment tool for web applications with support for multiple environments and sub-environments.
Installation
npm install -g shipfeUsage
Initialize project
shipfe initDeploy to environment
# Deploy to default environment
shipfe deploy
# Deploy to specific environment
shipfe deploy --profile dev
# Deploy to sub-environment
shipfe deploy --profile dev-adminConfiguration
Edit shipfe.config.json to configure your deployment settings:
{
"environments": {
"dev": {
"build_command": "npm run build",
"local_dist_path": "./dist",
"servers": [
{
"host": "dev.example.com",
"port": 22,
"username": "deploy",
"remote_deploy_path": "/var/www/dev",
"delete_old": false
}
],
"remote_tmp": "/tmp"
}
}
}Authentication Options
Each server can have its own authentication method. Shipfe tries authentication methods in this order:
- Password (if
passwordis set in server config) - SSH Private Key from environment (if
SSH_PRIVATE_KEYenv var is set) - SSH Key file (if
key_pathis set in server config)
Example with multiple servers using different auth methods:
{
"environments": {
"prod": {
"build_command": "npm run build",
"local_dist_path": "./dist",
"servers": [
{
"host": "web1.prod.com",
"port": 22,
"username": "deploy",
"password": "web1_password",
"remote_deploy_path": "/var/www/prod",
"delete_old": false
},
{
"host": "web2.prod.com",
"port": 22,
"username": "deploy",
"key_path": "/home/user/.ssh/web2_key",
"remote_deploy_path": "/var/www/prod",
"delete_old": false
},
{
"host": "web3.prod.com",
"port": 22,
"username": "deploy",
"key_path": "/home/user/.ssh/web3_key",
"remote_deploy_path": "/var/www/prod",
"delete_old": false
}
],
"remote_tmp": "/tmp"
}
}
}In this example:
web1.prod.comuses password authenticationweb2.prod.comuses SSH key file/home/user/.ssh/web2_keyweb3.prod.comuses SSH key file/home/user/.ssh/web3_key
Or use environment variable for all servers:
export SSH_PRIVATE_KEY="$(cat ~/.ssh/prod_key)"
shipfe deploy --profile prodAuthentication
Shipfe supports multiple SSH authentication methods for each server individually. For each server, authentication methods are tried in this order:
- Password authentication: If
passwordis set in that server's config - SSH Private Key from environment: If
SSH_PRIVATE_KEYenvironment variable is set (applies to all servers) - SSH Key file: If
key_pathis set in that server's config
Usage Examples:
# Each server can use different authentication
shipfe deploy --profile prod
# Or override with environment variable for all servers
export SSH_PRIVATE_KEY="$(cat ~/.ssh/prod_key)"
shipfe deploy --profile prodSSH Key Setup for Individual Servers:
Generate SSH key pairs for each server:
# For server 1 ssh-keygen -t rsa -b 4096 -f ~/.ssh/server1_key -C "server1" # For server 2 ssh-keygen -t rsa -b 4096 -f ~/.ssh/server2_key -C "server2"
Copy public keys to respective servers:
ssh-copy-id -i ~/.ssh/server1_key.pub user@server1.com ssh-copy-id -i ~/.ssh/server2_key.pub user@server2.com
Configure shipfe with server-specific keys:
{ "servers": [ { "host": "server1.com", "key_path": "~/.ssh/server1_key" }, { "host": "server2.com", "key_path": "~/.ssh/server2_key" } ] }
Features
- Multiple environment support
- Sub-environment configuration
- Custom build commands
- SSH-based deployment
- Automatic backup and rollback
- Detailed logging
License
MIT