auto-deploy-sh 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +121 -121
- package/package.json +82 -82
package/README.md
CHANGED
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
# Auto-deploy-sh
|
|
2
|
-
|
|
3
|
-
English|[简体中文](README_zh_CN.md)
|
|
4
|
-
|
|
5
|
-
This project aims to lower deployment barriers by providing an ultra-simple configuration and minimal dependency automated Docker deployment workflow. It helps developers quickly deploy applications to cloud servers without complex environment setups.
|
|
6
|
-
|
|
7
|
-
## Deployment Commands
|
|
8
|
-
|
|
9
|
-
### Project-Specific Configuration
|
|
10
|
-
|
|
11
|
-
**Install:**
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npm install auto-deploy-sh -D
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
**Run:**
|
|
18
|
-
|
|
19
|
-
- Add to `package.json`:
|
|
20
|
-
|
|
21
|
-
```json
|
|
22
|
-
"scripts": {
|
|
23
|
-
"deploy": "auto-deploy-sh"
|
|
24
|
-
}
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
2. Execute in terminal:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npm run deploy
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### Global Configuration
|
|
34
|
-
|
|
35
|
-
**Install:**
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npm install auto-deploy-sh -g
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
**Run** (in the root directory of the project to deploy):
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
auto-deploy-sh
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Advanced Usage
|
|
48
|
-
|
|
49
|
-
Run with a **custom configuration file**:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
auto-deploy <config-path>
|
|
53
|
-
# OR
|
|
54
|
-
auto-deploy -f <config-path>
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Useful for multi-environment deployment (e.g., development, staging, production).
|
|
58
|
-
|
|
59
|
-
## Configuration File Reference
|
|
60
|
-
|
|
61
|
-
The configuration file is **fixed as `deploy-config.json`**. If missing, the tool will **guide you to create it** (stored in the command execution directory by default) and automatically add `deploy-config.json` to `.gitignore` to **prevent accidental commits of sensitive data**.
|
|
62
|
-
|
|
63
|
-
> ⚠️ **Critical Note**: The configuration file contains sensitive information (e.g., passwords). If creating manually, ensure `deploy-config.json` is added to `.gitignore`.
|
|
64
|
-
|
|
65
|
-
### Configuration Properties
|
|
66
|
-
|
|
67
|
-
- `host`: Remote server IP address or domain name.
|
|
68
|
-
- `port`: SSH port number.
|
|
69
|
-
- `user`: SSH username for the remote server.
|
|
70
|
-
- `password`: Password for the SSH user.
|
|
71
|
-
- `beforLaunch`: **Pre-deployment commands** (array of strings) to execute locally before starting the deployment (e.g., `["npm run build"]`).
|
|
72
|
-
- `Dockerfile`: **Optional**. If omitted: 1. Check `dockerBuildFiles` for a file named `Dockerfile`; 2. If not found, search for `Dockerfile` in the **first-level directory of the current execution environment**.
|
|
73
|
-
- `dockerBuildFiles`: Files/directories to include in the Docker build context (required for Dockerfile execution).
|
|
74
|
-
- `imageTag`: Docker image tag, formatted as `[registry-url/][username/project-name]:[tag]` (e.g., `my-registry.com/user/my-app:v1.0`).
|
|
75
|
-
- `containerName`: Unique name for the running container (ensures no conflicts with existing containers).
|
|
76
|
-
- `BindPorts`: Port mapping, formatted as `<host-port>:<container-port>` (e.g., `"8080:80"`).
|
|
77
|
-
- `Options`: **Optional** advanced settings (all sub-properties are optional)
|
|
78
|
-
- `volumes`: Volume mappings (array of strings), formatted as `[host-path/volume-name]:[container-path]:[optional-flags]` (e.g., `["/host/data:/container/data:ro"]`).
|
|
79
|
-
- `networks`: Connect the container to a custom Docker network (created via `docker network create <network-name>`) for inter-container communication.
|
|
80
|
-
|
|
81
|
-
### Format Introduction
|
|
82
|
-
|
|
83
|
-
```json
|
|
84
|
-
{
|
|
85
|
-
"host": "string",
|
|
86
|
-
"port": "number | string",
|
|
87
|
-
"user": "string",
|
|
88
|
-
"password": "string",
|
|
89
|
-
"beforLaunch": "string[]",
|
|
90
|
-
"Dockerfile": "string",
|
|
91
|
-
"dockerBuildFiles": "string[]",
|
|
92
|
-
"imageTag": "string",
|
|
93
|
-
"containerName": "string",
|
|
94
|
-
"BindPorts": "string",
|
|
95
|
-
"Options": {
|
|
96
|
-
"volumes": "string[]",
|
|
97
|
-
"networks": "string"
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Full Configuration Example
|
|
103
|
-
|
|
104
|
-
```json
|
|
105
|
-
{
|
|
106
|
-
"host": "your-server-ip",
|
|
107
|
-
"port": 22,
|
|
108
|
-
"user": "ssh-username",
|
|
109
|
-
"password": "ssh-password",
|
|
110
|
-
"beforLaunch": ["npm run build"],
|
|
111
|
-
"Dockerfile": "./Dockerfile",
|
|
112
|
-
"dockerBuildFiles": ["./dist", "./package.json"],
|
|
113
|
-
"imageTag": "my-app:latest",
|
|
114
|
-
"containerName": "my-app-container",
|
|
115
|
-
"BindPorts": "80:80",
|
|
116
|
-
"Options": {
|
|
117
|
-
"volumes": ["/host/logs:/app/logs:rw"],
|
|
118
|
-
"networks": "my-custom-network"
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
```
|
|
1
|
+
# Auto-deploy-sh
|
|
2
|
+
|
|
3
|
+
English|[简体中文](README_zh_CN.md)
|
|
4
|
+
|
|
5
|
+
This project aims to lower deployment barriers by providing an ultra-simple configuration and minimal dependency automated Docker deployment workflow. It helps developers quickly deploy applications to cloud servers without complex environment setups.
|
|
6
|
+
|
|
7
|
+
## Deployment Commands
|
|
8
|
+
|
|
9
|
+
### Project-Specific Configuration
|
|
10
|
+
|
|
11
|
+
**Install:**
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install auto-deploy-sh -D
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**Run:**
|
|
18
|
+
|
|
19
|
+
- Add to `package.json`:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
"scripts": {
|
|
23
|
+
"deploy": "auto-deploy-sh"
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
2. Execute in terminal:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm run deploy
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Global Configuration
|
|
34
|
+
|
|
35
|
+
**Install:**
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install auto-deploy-sh -g
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Run** (in the root directory of the project to deploy):
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
auto-deploy-sh
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Advanced Usage
|
|
48
|
+
|
|
49
|
+
Run with a **custom configuration file**:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
auto-deploy-sh <config-path>
|
|
53
|
+
# OR
|
|
54
|
+
auto-deploy-sh -f <config-path>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Useful for multi-environment deployment (e.g., development, staging, production).
|
|
58
|
+
|
|
59
|
+
## Configuration File Reference
|
|
60
|
+
|
|
61
|
+
The configuration file is **fixed as `deploy-config.json`**. If missing, the tool will **guide you to create it** (stored in the command execution directory by default) and automatically add `deploy-config.json` to `.gitignore` to **prevent accidental commits of sensitive data**.
|
|
62
|
+
|
|
63
|
+
> ⚠️ **Critical Note**: The configuration file contains sensitive information (e.g., passwords). If creating manually, ensure `deploy-config.json` is added to `.gitignore`.
|
|
64
|
+
|
|
65
|
+
### Configuration Properties
|
|
66
|
+
|
|
67
|
+
- `host`: Remote server IP address or domain name.
|
|
68
|
+
- `port`: SSH port number.
|
|
69
|
+
- `user`: SSH username for the remote server.
|
|
70
|
+
- `password`: Password for the SSH user.
|
|
71
|
+
- `beforLaunch`: **Pre-deployment commands** (array of strings) to execute locally before starting the deployment (e.g., `["npm run build"]`).
|
|
72
|
+
- `Dockerfile`: **Optional**. If omitted: 1. Check `dockerBuildFiles` for a file named `Dockerfile`; 2. If not found, search for `Dockerfile` in the **first-level directory of the current execution environment**.
|
|
73
|
+
- `dockerBuildFiles`: Files/directories to include in the Docker build context (required for Dockerfile execution).
|
|
74
|
+
- `imageTag`: Docker image tag, formatted as `[registry-url/][username/project-name]:[tag]` (e.g., `my-registry.com/user/my-app:v1.0`).
|
|
75
|
+
- `containerName`: Unique name for the running container (ensures no conflicts with existing containers).
|
|
76
|
+
- `BindPorts`: Port mapping, formatted as `<host-port>:<container-port>` (e.g., `"8080:80"`).
|
|
77
|
+
- `Options`: **Optional** advanced settings (all sub-properties are optional)
|
|
78
|
+
- `volumes`: Volume mappings (array of strings), formatted as `[host-path/volume-name]:[container-path]:[optional-flags]` (e.g., `["/host/data:/container/data:ro"]`).
|
|
79
|
+
- `networks`: Connect the container to a custom Docker network (created via `docker network create <network-name>`) for inter-container communication.
|
|
80
|
+
|
|
81
|
+
### Format Introduction
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"host": "string",
|
|
86
|
+
"port": "number | string",
|
|
87
|
+
"user": "string",
|
|
88
|
+
"password": "string",
|
|
89
|
+
"beforLaunch": "string[]",
|
|
90
|
+
"Dockerfile": "string",
|
|
91
|
+
"dockerBuildFiles": "string[]",
|
|
92
|
+
"imageTag": "string",
|
|
93
|
+
"containerName": "string",
|
|
94
|
+
"BindPorts": "string",
|
|
95
|
+
"Options": {
|
|
96
|
+
"volumes": "string[]",
|
|
97
|
+
"networks": "string"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Full Configuration Example
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"host": "your-server-ip",
|
|
107
|
+
"port": 22,
|
|
108
|
+
"user": "ssh-username",
|
|
109
|
+
"password": "ssh-password",
|
|
110
|
+
"beforLaunch": ["npm run build"],
|
|
111
|
+
"Dockerfile": "./Dockerfile",
|
|
112
|
+
"dockerBuildFiles": ["./dist", "./package.json"],
|
|
113
|
+
"imageTag": "my-app:latest",
|
|
114
|
+
"containerName": "my-app-container",
|
|
115
|
+
"BindPorts": "80:80",
|
|
116
|
+
"Options": {
|
|
117
|
+
"volumes": ["/host/logs:/app/logs:rw"],
|
|
118
|
+
"networks": "my-custom-network"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
package/package.json
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "auto-deploy-sh",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "Automated Docker deployment tool",
|
|
5
|
-
"bin": {
|
|
6
|
-
"auto-deploy-sh": "./dist/cli/index.js"
|
|
7
|
-
},
|
|
8
|
-
"files": [
|
|
9
|
-
"dist",
|
|
10
|
-
"package.json",
|
|
11
|
-
"README.md"
|
|
12
|
-
],
|
|
13
|
-
"type": "module",
|
|
14
|
-
"main": "./dist/cli/index.js",
|
|
15
|
-
"scripts": {
|
|
16
|
-
"build": "npm run clean && tsc -p tsconfig.bulid.json",
|
|
17
|
-
"clean": "rimraf dist build",
|
|
18
|
-
"deploy": "node --loader ts-node/esm cli/index.ts",
|
|
19
|
-
"lint:doc": "prettier **/*.md --check",
|
|
20
|
-
"lint:doc:fix": "prettier **/*.md --write",
|
|
21
|
-
"lint:eslint": "eslint --cache --ext .ts,.vue,.js,.jsx,.tsx,.json",
|
|
22
|
-
"lint:eslint:fix": "eslint --cache --ext .ts,.vue,.js,.jsx,.tsx,.json --fix",
|
|
23
|
-
"prepare": "husky",
|
|
24
|
-
"prepack": "npm run build",
|
|
25
|
-
"postbuild": "node ./postbuild.js"
|
|
26
|
-
},
|
|
27
|
-
"keywords": [
|
|
28
|
-
"Automated",
|
|
29
|
-
"Lower deployment threshold",
|
|
30
|
-
"deployment",
|
|
31
|
-
"Minimalist configuration"
|
|
32
|
-
],
|
|
33
|
-
"repository": {
|
|
34
|
-
"type": "git",
|
|
35
|
-
"url": "https://github.com/yotomum-ml/auto-deploy-sh.git"
|
|
36
|
-
},
|
|
37
|
-
"author": "yotomum_ml",
|
|
38
|
-
"license": "
|
|
39
|
-
"lint-staged": {
|
|
40
|
-
"*.{js,ts,jsx,tsx,vue,css,json}": [
|
|
41
|
-
"eslint --no-warn-ignored"
|
|
42
|
-
],
|
|
43
|
-
"*.md": [
|
|
44
|
-
"prettier --check --no-warn-ignored"
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
"dependencies": {
|
|
48
|
-
"archiver": "^7.0.1",
|
|
49
|
-
"chalk": "^5.6.2",
|
|
50
|
-
"commander": "^13.1.0",
|
|
51
|
-
"execa": "^9.6.0",
|
|
52
|
-
"fs-extra": "^11.3.1",
|
|
53
|
-
"inquirer": "^12.9.6",
|
|
54
|
-
"node-ssh": "^13.2.1",
|
|
55
|
-
"ora": "^8.2.0",
|
|
56
|
-
"ssh2": "^1.17.0",
|
|
57
|
-
"ts-node": "^10.9.2"
|
|
58
|
-
},
|
|
59
|
-
"engines": {
|
|
60
|
-
"node": ">=18.0.0"
|
|
61
|
-
},
|
|
62
|
-
"devDependencies": {
|
|
63
|
-
"@commitlint/cli": "^19.8.1",
|
|
64
|
-
"@commitlint/config-conventional": "^19.8.1",
|
|
65
|
-
"@eslint/css": "^0.8.1",
|
|
66
|
-
"@eslint/js": "^9.29.0",
|
|
67
|
-
"@eslint/json": "^0.12.0",
|
|
68
|
-
"@stylistic/eslint-plugin": "^4.4.1",
|
|
69
|
-
"@types/archiver": "^6.0.3",
|
|
70
|
-
"@types/fs-extra": "^11.0.4",
|
|
71
|
-
"eslint": "^9.27.0",
|
|
72
|
-
"eslint-config-prettier": "^10.1.5",
|
|
73
|
-
"eslint-plugin-prettier": "^5.4.1",
|
|
74
|
-
"eslint-plugin-vue": "^10.2.0",
|
|
75
|
-
"husky": "^9.1.7",
|
|
76
|
-
"lint-staged": "^15.5.2",
|
|
77
|
-
"node-notifier": "^10.0.1",
|
|
78
|
-
"rimraf": "^5.0.10",
|
|
79
|
-
"typescript": "^5.8.3",
|
|
80
|
-
"typescript-eslint": "^8.34.1"
|
|
81
|
-
}
|
|
82
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "auto-deploy-sh",
|
|
3
|
+
"version": "2.0.2",
|
|
4
|
+
"description": "Automated Docker deployment tool",
|
|
5
|
+
"bin": {
|
|
6
|
+
"auto-deploy-sh": "./dist/cli/index.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"package.json",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "./dist/cli/index.js",
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "npm run clean && tsc -p tsconfig.bulid.json",
|
|
17
|
+
"clean": "rimraf dist build",
|
|
18
|
+
"deploy": "node --loader ts-node/esm cli/index.ts",
|
|
19
|
+
"lint:doc": "prettier **/*.md --check",
|
|
20
|
+
"lint:doc:fix": "prettier **/*.md --write",
|
|
21
|
+
"lint:eslint": "eslint --cache --ext .ts,.vue,.js,.jsx,.tsx,.json",
|
|
22
|
+
"lint:eslint:fix": "eslint --cache --ext .ts,.vue,.js,.jsx,.tsx,.json --fix",
|
|
23
|
+
"prepare": "husky",
|
|
24
|
+
"prepack": "npm run build",
|
|
25
|
+
"postbuild": "node ./postbuild.js"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"Automated",
|
|
29
|
+
"Lower deployment threshold",
|
|
30
|
+
"deployment",
|
|
31
|
+
"Minimalist configuration"
|
|
32
|
+
],
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/yotomum-ml/auto-deploy-sh.git"
|
|
36
|
+
},
|
|
37
|
+
"author": "yotomum_ml",
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"lint-staged": {
|
|
40
|
+
"*.{js,ts,jsx,tsx,vue,css,json}": [
|
|
41
|
+
"eslint --no-warn-ignored"
|
|
42
|
+
],
|
|
43
|
+
"*.md": [
|
|
44
|
+
"prettier --check --no-warn-ignored"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"archiver": "^7.0.1",
|
|
49
|
+
"chalk": "^5.6.2",
|
|
50
|
+
"commander": "^13.1.0",
|
|
51
|
+
"execa": "^9.6.0",
|
|
52
|
+
"fs-extra": "^11.3.1",
|
|
53
|
+
"inquirer": "^12.9.6",
|
|
54
|
+
"node-ssh": "^13.2.1",
|
|
55
|
+
"ora": "^8.2.0",
|
|
56
|
+
"ssh2": "^1.17.0",
|
|
57
|
+
"ts-node": "^10.9.2"
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">=18.0.0"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@commitlint/cli": "^19.8.1",
|
|
64
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
65
|
+
"@eslint/css": "^0.8.1",
|
|
66
|
+
"@eslint/js": "^9.29.0",
|
|
67
|
+
"@eslint/json": "^0.12.0",
|
|
68
|
+
"@stylistic/eslint-plugin": "^4.4.1",
|
|
69
|
+
"@types/archiver": "^6.0.3",
|
|
70
|
+
"@types/fs-extra": "^11.0.4",
|
|
71
|
+
"eslint": "^9.27.0",
|
|
72
|
+
"eslint-config-prettier": "^10.1.5",
|
|
73
|
+
"eslint-plugin-prettier": "^5.4.1",
|
|
74
|
+
"eslint-plugin-vue": "^10.2.0",
|
|
75
|
+
"husky": "^9.1.7",
|
|
76
|
+
"lint-staged": "^15.5.2",
|
|
77
|
+
"node-notifier": "^10.0.1",
|
|
78
|
+
"rimraf": "^5.0.10",
|
|
79
|
+
"typescript": "^5.8.3",
|
|
80
|
+
"typescript-eslint": "^8.34.1"
|
|
81
|
+
}
|
|
82
|
+
}
|