init 命令
初始化Shipfe配置文件。
语法
bash
shipfe init [options]描述
init 命令在当前目录创建 shipfe.config.json 配置文件。这个文件包含了部署所需的所有配置信息。
选项
| 选项 | 描述 |
|---|---|
-f, --force | 强制覆盖已存在的配置文件 |
-h, --help | 显示帮助信息 |
示例
基本初始化
bash
shipfe init这将在当前目录创建 shipfe.config.json 文件。
强制覆盖
bash
shipfe init --force如果配置文件已存在,将被覆盖。
生成的配置文件
init 命令会生成一个包含默认值的配置文件:
json
{
"remote_host": "",
"remote_user": "",
"remote_path": "",
"local_path": "./dist",
"keep_releases": 5,
"build_command": "",
"delete_old": false,
"enable_shared": false,
"hashed_asset_patterns": [
"**/*.js",
"**/*.css",
"**/*.png",
"**/*.jpg",
"**/*.svg",
"**/*.woff2"
]
}下一步
创建配置文件后,您需要:
- 编辑配置文件,填入您的服务器信息
- 配置SSH密钥认证
- 运行
shipfe deploy进行首次部署