arc-deploy 0.1.4__tar.gz
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.
- arc_deploy-0.1.4/.gitignore +48 -0
- arc_deploy-0.1.4/LICENSE +21 -0
- arc_deploy-0.1.4/MANIFEST.in +14 -0
- arc_deploy-0.1.4/PKG-INFO +238 -0
- arc_deploy-0.1.4/README.md +209 -0
- arc_deploy-0.1.4/docs/cli/index.md +86 -0
- arc_deploy-0.1.4/docs/cli/monorepo.md +62 -0
- arc_deploy-0.1.4/docs/cli/package.md +84 -0
- arc_deploy-0.1.4/docs/cli/publishing.md +298 -0
- arc_deploy-0.1.4/docs/index.md +137 -0
- arc_deploy-0.1.4/examples/arc-agent-gateway.yaml +13 -0
- arc_deploy-0.1.4/examples/arc-nodejs-service.yaml +14 -0
- arc_deploy-0.1.4/examples/monorepo/README.md +26 -0
- arc_deploy-0.1.4/examples/monorepo/deploy-fullstack.yaml +50 -0
- arc_deploy-0.1.4/examples/monorepo/deploy.yaml +47 -0
- arc_deploy-0.1.4/mkdocs.yml +25 -0
- arc_deploy-0.1.4/publish.sh +97 -0
- arc_deploy-0.1.4/pyproject.toml +61 -0
- arc_deploy-0.1.4/src/arc_deploy/__init__.py +21 -0
- arc_deploy-0.1.4/src/arc_deploy/main.py +703 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
MANIFEST
|
|
23
|
+
|
|
24
|
+
# Virtual environments
|
|
25
|
+
venv/
|
|
26
|
+
env/
|
|
27
|
+
ENV/
|
|
28
|
+
.venv
|
|
29
|
+
|
|
30
|
+
# IDE
|
|
31
|
+
.vscode/
|
|
32
|
+
.idea/
|
|
33
|
+
*.swp
|
|
34
|
+
*.swo
|
|
35
|
+
*~
|
|
36
|
+
|
|
37
|
+
# Testing
|
|
38
|
+
.pytest_cache/
|
|
39
|
+
.coverage
|
|
40
|
+
htmlcov/
|
|
41
|
+
|
|
42
|
+
# uv
|
|
43
|
+
.uv/
|
|
44
|
+
uv.lock
|
|
45
|
+
|
|
46
|
+
# Local config
|
|
47
|
+
deploy.local.yaml
|
|
48
|
+
*.secret.yaml
|
arc_deploy-0.1.4/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Arcsite Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Include documentation
|
|
2
|
+
# README.md is automatically included
|
|
3
|
+
include LICENSE
|
|
4
|
+
|
|
5
|
+
# Include example configurations
|
|
6
|
+
recursive-include examples *.yaml *.md
|
|
7
|
+
|
|
8
|
+
# Exclude development files
|
|
9
|
+
exclude publish.sh
|
|
10
|
+
exclude .gitignore
|
|
11
|
+
global-exclude __pycache__
|
|
12
|
+
global-exclude *.py[cod]
|
|
13
|
+
global-exclude *.swp
|
|
14
|
+
global-exclude .DS_Store
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: arc-deploy
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: Unified deployment CLI tool for Docker Swarm with monorepo support
|
|
5
|
+
Project-URL: Homepage, https://github.com/your-org/deploy-controller
|
|
6
|
+
Project-URL: Documentation, https://github.com/your-org/deploy-controller/tree/main/cli
|
|
7
|
+
Project-URL: Repository, https://github.com/your-org/deploy-controller
|
|
8
|
+
Project-URL: Issues, https://github.com/your-org/deploy-controller/issues
|
|
9
|
+
Author-email: Arcsite Team <noreply@example.com>
|
|
10
|
+
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: cicd,cli,deployment,devops,docker,monorepo,swarm
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
23
|
+
Classifier: Topic :: System :: Systems Administration
|
|
24
|
+
Requires-Python: >=3.8
|
|
25
|
+
Requires-Dist: pyyaml>=6.0
|
|
26
|
+
Requires-Dist: rich>=13.0.0
|
|
27
|
+
Requires-Dist: typer>=0.9.0
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# Arc Deploy CLI
|
|
31
|
+
|
|
32
|
+
A unified CLI tool for building and deploying Docker services to the Deploy Controller. Supports both single-service and monorepo architectures with configuration-driven deployments.
|
|
33
|
+
|
|
34
|
+
## Features
|
|
35
|
+
|
|
36
|
+
- **Single Service & Monorepo Support**: Deploy one service or manage multiple services from a single configuration
|
|
37
|
+
- **Configuration Inheritance**: Shared settings via `common` section in monorepo configs
|
|
38
|
+
- **Unique Image Tagging**: Automatic tag generation using Git SHA and timestamp
|
|
39
|
+
- **Flexible Deployment Options**: Build only, build+push, or full deployment workflow
|
|
40
|
+
- **Real-time Monitoring**: Track deployment progress and status
|
|
41
|
+
|
|
42
|
+
## 📚 Documentation
|
|
43
|
+
|
|
44
|
+
Full documentation is available in the `docs/` directory or served via MkDocs:
|
|
45
|
+
|
|
46
|
+
- [Overview](docs/cli/index.md) - Installation and basic usage
|
|
47
|
+
- [Monorepo Guide](docs/cli/monorepo.md) - Configuring monorepo deployments
|
|
48
|
+
- [Publishing Guide](docs/cli/publishing.md) - How to publish the CLI package
|
|
49
|
+
- [Package Info](docs/cli/package.md) - Package structure and metadata
|
|
50
|
+
|
|
51
|
+
## 🚀 Quick Start
|
|
52
|
+
|
|
53
|
+
### Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Install via pip
|
|
57
|
+
pip install arc-deploy
|
|
58
|
+
|
|
59
|
+
# Or using uv
|
|
60
|
+
uv pip install arc-deploy
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Single Service Configuration
|
|
64
|
+
|
|
65
|
+
Create `deploy.yaml` in your project root:
|
|
66
|
+
|
|
67
|
+
```yaml
|
|
68
|
+
service_name: my_service
|
|
69
|
+
ecr_registry: 123.dkr.ecr.us-west-2.amazonaws.com
|
|
70
|
+
deploy_controller_url: https://deploy.example.com
|
|
71
|
+
aws_region: us-west-2
|
|
72
|
+
|
|
73
|
+
build:
|
|
74
|
+
dockerfile: Dockerfile
|
|
75
|
+
context: .
|
|
76
|
+
build_args:
|
|
77
|
+
NODE_ENV: production
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Deploy**:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
export WEBHOOK_TOKEN="your-token"
|
|
84
|
+
arc-deploy build-and-deploy --env test
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Monorepo Configuration
|
|
88
|
+
|
|
89
|
+
Create `deploy.yaml` at repository root:
|
|
90
|
+
|
|
91
|
+
```yaml
|
|
92
|
+
common:
|
|
93
|
+
ecr_registry: 123.dkr.ecr.us-west-2.amazonaws.com
|
|
94
|
+
deploy_controller_url: https://deploy.example.com
|
|
95
|
+
aws_region: us-west-2
|
|
96
|
+
|
|
97
|
+
services:
|
|
98
|
+
# 简化版本:不指定 service_name,使用 key 作为默认值
|
|
99
|
+
api:
|
|
100
|
+
build: { context: services/api }
|
|
101
|
+
worker:
|
|
102
|
+
build: { context: services/worker }
|
|
103
|
+
|
|
104
|
+
# 完整版本:指定不同的 service_name(用于不同的 Docker 服务名)
|
|
105
|
+
api-gateway:
|
|
106
|
+
service_name: arc_api_gateway # 可选:如果未指定,使用 key (api-gateway)
|
|
107
|
+
build: { context: services/api-gateway }
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Deploy**:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# List available services
|
|
114
|
+
arc-deploy list-services
|
|
115
|
+
|
|
116
|
+
# Deploy specific service(s)
|
|
117
|
+
arc-deploy build-and-deploy --env test --service api
|
|
118
|
+
arc-deploy build-and-deploy --env prod --service api,worker
|
|
119
|
+
|
|
120
|
+
# Deploy all services
|
|
121
|
+
arc-deploy build-and-deploy --env test --all
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Commands
|
|
125
|
+
|
|
126
|
+
### `build-and-deploy`
|
|
127
|
+
|
|
128
|
+
Build Docker image, push to ECR, and deploy via Deploy Controller.
|
|
129
|
+
|
|
130
|
+
**Options**:
|
|
131
|
+
- `--env`, `-e`: Deployment environment (test/prod) - **Required**
|
|
132
|
+
- `--config`, `-c`: Configuration file path (default: `deploy.yaml`)
|
|
133
|
+
- `--service`, `-s`: Service name(s) for monorepo (comma-separated or multiple flags)
|
|
134
|
+
- `--all`: Deploy all services (monorepo only)
|
|
135
|
+
- `--skip-push`: Build only, skip push and deploy
|
|
136
|
+
- `--skip-deploy`: Build and push only, skip deployment
|
|
137
|
+
|
|
138
|
+
**Examples**:
|
|
139
|
+
```bash
|
|
140
|
+
# Single service
|
|
141
|
+
arc-deploy build-and-deploy --env test
|
|
142
|
+
|
|
143
|
+
# Monorepo - specific service
|
|
144
|
+
arc-deploy build-and-deploy --env test --service api
|
|
145
|
+
|
|
146
|
+
# Monorepo - multiple services
|
|
147
|
+
arc-deploy build-and-deploy --env prod --service api,worker
|
|
148
|
+
|
|
149
|
+
# Build only (no push/deploy)
|
|
150
|
+
arc-deploy build-and-deploy --env test --skip-push
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### `validate-config`
|
|
154
|
+
|
|
155
|
+
Validate the deployment configuration file.
|
|
156
|
+
|
|
157
|
+
**Options**:
|
|
158
|
+
- `--config`, `-c`: Configuration file path (default: `deploy.yaml`)
|
|
159
|
+
|
|
160
|
+
**Example**:
|
|
161
|
+
```bash
|
|
162
|
+
arc-deploy validate-config
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### `build-only`
|
|
166
|
+
|
|
167
|
+
Build Docker image only (no push or deploy).
|
|
168
|
+
|
|
169
|
+
**Options**:
|
|
170
|
+
- `--config`, `-c`: Configuration file path (default: `deploy.yaml`)
|
|
171
|
+
- `--service`, `-s`: Service name for monorepo
|
|
172
|
+
- `--tag`, `-t`: Custom image tag (optional, defaults to auto-generated tag)
|
|
173
|
+
|
|
174
|
+
**Examples**:
|
|
175
|
+
```bash
|
|
176
|
+
# Single service
|
|
177
|
+
arc-deploy build-only
|
|
178
|
+
|
|
179
|
+
# Monorepo
|
|
180
|
+
arc-deploy build-only --service api
|
|
181
|
+
|
|
182
|
+
# With custom tag
|
|
183
|
+
arc-deploy build-only --tag v1.0.0
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### `list-services`
|
|
187
|
+
|
|
188
|
+
List all services in a monorepo configuration.
|
|
189
|
+
|
|
190
|
+
**Options**:
|
|
191
|
+
- `--config`, `-c`: Configuration file path (default: `deploy.yaml`)
|
|
192
|
+
|
|
193
|
+
**Example**:
|
|
194
|
+
```bash
|
|
195
|
+
arc-deploy list-services
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Environment Variables
|
|
199
|
+
|
|
200
|
+
- `WEBHOOK_TOKEN`: Bearer token for Deploy Controller webhook authentication (required for deployments)
|
|
201
|
+
- `AWS_PROFILE`: AWS profile name (or use standard AWS environment variables)
|
|
202
|
+
- `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`: AWS credentials (if not using profile)
|
|
203
|
+
|
|
204
|
+
## Configuration Reference
|
|
205
|
+
|
|
206
|
+
| Field | Description | Required |
|
|
207
|
+
|-------|-------------|----------|
|
|
208
|
+
| `service_name` | Service name in Deploy Controller | Yes |
|
|
209
|
+
| `ecr_registry` | ECR repository URL | Yes |
|
|
210
|
+
| `deploy_controller_url` | Base URL of Deploy Controller | Yes |
|
|
211
|
+
| `aws_region` | AWS region for ECR | Yes |
|
|
212
|
+
| `image_name` | Docker image name (defaults to `service_name`) | No |
|
|
213
|
+
| `build.dockerfile` | Path to Dockerfile (default: `Dockerfile`) | No |
|
|
214
|
+
| `build.context` | Build context path (default: `.`) | No |
|
|
215
|
+
| `build.build_args` | Dictionary of build arguments | No |
|
|
216
|
+
|
|
217
|
+
For monorepo configurations, see the [Monorepo Guide](docs/cli/monorepo.md) for details on `common` and `services` sections.
|
|
218
|
+
|
|
219
|
+
## Examples
|
|
220
|
+
|
|
221
|
+
Example configurations are available in the `examples/` directory:
|
|
222
|
+
- `arc-nodejs-service.yaml` - Single service example
|
|
223
|
+
- `arc-agent-gateway.yaml` - Single service example
|
|
224
|
+
- `monorepo/deploy.yaml` - Basic monorepo example
|
|
225
|
+
- `monorepo/deploy-fullstack.yaml` - Fullstack app example
|
|
226
|
+
|
|
227
|
+
## Development
|
|
228
|
+
|
|
229
|
+
For local development, install in editable mode:
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
cd cli
|
|
233
|
+
uv pip install -e .
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## License
|
|
237
|
+
|
|
238
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# Arc Deploy CLI
|
|
2
|
+
|
|
3
|
+
A unified CLI tool for building and deploying Docker services to the Deploy Controller. Supports both single-service and monorepo architectures with configuration-driven deployments.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Single Service & Monorepo Support**: Deploy one service or manage multiple services from a single configuration
|
|
8
|
+
- **Configuration Inheritance**: Shared settings via `common` section in monorepo configs
|
|
9
|
+
- **Unique Image Tagging**: Automatic tag generation using Git SHA and timestamp
|
|
10
|
+
- **Flexible Deployment Options**: Build only, build+push, or full deployment workflow
|
|
11
|
+
- **Real-time Monitoring**: Track deployment progress and status
|
|
12
|
+
|
|
13
|
+
## 📚 Documentation
|
|
14
|
+
|
|
15
|
+
Full documentation is available in the `docs/` directory or served via MkDocs:
|
|
16
|
+
|
|
17
|
+
- [Overview](docs/cli/index.md) - Installation and basic usage
|
|
18
|
+
- [Monorepo Guide](docs/cli/monorepo.md) - Configuring monorepo deployments
|
|
19
|
+
- [Publishing Guide](docs/cli/publishing.md) - How to publish the CLI package
|
|
20
|
+
- [Package Info](docs/cli/package.md) - Package structure and metadata
|
|
21
|
+
|
|
22
|
+
## 🚀 Quick Start
|
|
23
|
+
|
|
24
|
+
### Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Install via pip
|
|
28
|
+
pip install arc-deploy
|
|
29
|
+
|
|
30
|
+
# Or using uv
|
|
31
|
+
uv pip install arc-deploy
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Single Service Configuration
|
|
35
|
+
|
|
36
|
+
Create `deploy.yaml` in your project root:
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
service_name: my_service
|
|
40
|
+
ecr_registry: 123.dkr.ecr.us-west-2.amazonaws.com
|
|
41
|
+
deploy_controller_url: https://deploy.example.com
|
|
42
|
+
aws_region: us-west-2
|
|
43
|
+
|
|
44
|
+
build:
|
|
45
|
+
dockerfile: Dockerfile
|
|
46
|
+
context: .
|
|
47
|
+
build_args:
|
|
48
|
+
NODE_ENV: production
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Deploy**:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
export WEBHOOK_TOKEN="your-token"
|
|
55
|
+
arc-deploy build-and-deploy --env test
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Monorepo Configuration
|
|
59
|
+
|
|
60
|
+
Create `deploy.yaml` at repository root:
|
|
61
|
+
|
|
62
|
+
```yaml
|
|
63
|
+
common:
|
|
64
|
+
ecr_registry: 123.dkr.ecr.us-west-2.amazonaws.com
|
|
65
|
+
deploy_controller_url: https://deploy.example.com
|
|
66
|
+
aws_region: us-west-2
|
|
67
|
+
|
|
68
|
+
services:
|
|
69
|
+
# 简化版本:不指定 service_name,使用 key 作为默认值
|
|
70
|
+
api:
|
|
71
|
+
build: { context: services/api }
|
|
72
|
+
worker:
|
|
73
|
+
build: { context: services/worker }
|
|
74
|
+
|
|
75
|
+
# 完整版本:指定不同的 service_name(用于不同的 Docker 服务名)
|
|
76
|
+
api-gateway:
|
|
77
|
+
service_name: arc_api_gateway # 可选:如果未指定,使用 key (api-gateway)
|
|
78
|
+
build: { context: services/api-gateway }
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Deploy**:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# List available services
|
|
85
|
+
arc-deploy list-services
|
|
86
|
+
|
|
87
|
+
# Deploy specific service(s)
|
|
88
|
+
arc-deploy build-and-deploy --env test --service api
|
|
89
|
+
arc-deploy build-and-deploy --env prod --service api,worker
|
|
90
|
+
|
|
91
|
+
# Deploy all services
|
|
92
|
+
arc-deploy build-and-deploy --env test --all
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Commands
|
|
96
|
+
|
|
97
|
+
### `build-and-deploy`
|
|
98
|
+
|
|
99
|
+
Build Docker image, push to ECR, and deploy via Deploy Controller.
|
|
100
|
+
|
|
101
|
+
**Options**:
|
|
102
|
+
- `--env`, `-e`: Deployment environment (test/prod) - **Required**
|
|
103
|
+
- `--config`, `-c`: Configuration file path (default: `deploy.yaml`)
|
|
104
|
+
- `--service`, `-s`: Service name(s) for monorepo (comma-separated or multiple flags)
|
|
105
|
+
- `--all`: Deploy all services (monorepo only)
|
|
106
|
+
- `--skip-push`: Build only, skip push and deploy
|
|
107
|
+
- `--skip-deploy`: Build and push only, skip deployment
|
|
108
|
+
|
|
109
|
+
**Examples**:
|
|
110
|
+
```bash
|
|
111
|
+
# Single service
|
|
112
|
+
arc-deploy build-and-deploy --env test
|
|
113
|
+
|
|
114
|
+
# Monorepo - specific service
|
|
115
|
+
arc-deploy build-and-deploy --env test --service api
|
|
116
|
+
|
|
117
|
+
# Monorepo - multiple services
|
|
118
|
+
arc-deploy build-and-deploy --env prod --service api,worker
|
|
119
|
+
|
|
120
|
+
# Build only (no push/deploy)
|
|
121
|
+
arc-deploy build-and-deploy --env test --skip-push
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### `validate-config`
|
|
125
|
+
|
|
126
|
+
Validate the deployment configuration file.
|
|
127
|
+
|
|
128
|
+
**Options**:
|
|
129
|
+
- `--config`, `-c`: Configuration file path (default: `deploy.yaml`)
|
|
130
|
+
|
|
131
|
+
**Example**:
|
|
132
|
+
```bash
|
|
133
|
+
arc-deploy validate-config
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### `build-only`
|
|
137
|
+
|
|
138
|
+
Build Docker image only (no push or deploy).
|
|
139
|
+
|
|
140
|
+
**Options**:
|
|
141
|
+
- `--config`, `-c`: Configuration file path (default: `deploy.yaml`)
|
|
142
|
+
- `--service`, `-s`: Service name for monorepo
|
|
143
|
+
- `--tag`, `-t`: Custom image tag (optional, defaults to auto-generated tag)
|
|
144
|
+
|
|
145
|
+
**Examples**:
|
|
146
|
+
```bash
|
|
147
|
+
# Single service
|
|
148
|
+
arc-deploy build-only
|
|
149
|
+
|
|
150
|
+
# Monorepo
|
|
151
|
+
arc-deploy build-only --service api
|
|
152
|
+
|
|
153
|
+
# With custom tag
|
|
154
|
+
arc-deploy build-only --tag v1.0.0
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### `list-services`
|
|
158
|
+
|
|
159
|
+
List all services in a monorepo configuration.
|
|
160
|
+
|
|
161
|
+
**Options**:
|
|
162
|
+
- `--config`, `-c`: Configuration file path (default: `deploy.yaml`)
|
|
163
|
+
|
|
164
|
+
**Example**:
|
|
165
|
+
```bash
|
|
166
|
+
arc-deploy list-services
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Environment Variables
|
|
170
|
+
|
|
171
|
+
- `WEBHOOK_TOKEN`: Bearer token for Deploy Controller webhook authentication (required for deployments)
|
|
172
|
+
- `AWS_PROFILE`: AWS profile name (or use standard AWS environment variables)
|
|
173
|
+
- `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`: AWS credentials (if not using profile)
|
|
174
|
+
|
|
175
|
+
## Configuration Reference
|
|
176
|
+
|
|
177
|
+
| Field | Description | Required |
|
|
178
|
+
|-------|-------------|----------|
|
|
179
|
+
| `service_name` | Service name in Deploy Controller | Yes |
|
|
180
|
+
| `ecr_registry` | ECR repository URL | Yes |
|
|
181
|
+
| `deploy_controller_url` | Base URL of Deploy Controller | Yes |
|
|
182
|
+
| `aws_region` | AWS region for ECR | Yes |
|
|
183
|
+
| `image_name` | Docker image name (defaults to `service_name`) | No |
|
|
184
|
+
| `build.dockerfile` | Path to Dockerfile (default: `Dockerfile`) | No |
|
|
185
|
+
| `build.context` | Build context path (default: `.`) | No |
|
|
186
|
+
| `build.build_args` | Dictionary of build arguments | No |
|
|
187
|
+
|
|
188
|
+
For monorepo configurations, see the [Monorepo Guide](docs/cli/monorepo.md) for details on `common` and `services` sections.
|
|
189
|
+
|
|
190
|
+
## Examples
|
|
191
|
+
|
|
192
|
+
Example configurations are available in the `examples/` directory:
|
|
193
|
+
- `arc-nodejs-service.yaml` - Single service example
|
|
194
|
+
- `arc-agent-gateway.yaml` - Single service example
|
|
195
|
+
- `monorepo/deploy.yaml` - Basic monorepo example
|
|
196
|
+
- `monorepo/deploy-fullstack.yaml` - Fullstack app example
|
|
197
|
+
|
|
198
|
+
## Development
|
|
199
|
+
|
|
200
|
+
For local development, install in editable mode:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
cd cli
|
|
204
|
+
uv pip install -e .
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## License
|
|
208
|
+
|
|
209
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Deploy Controller CLI
|
|
2
|
+
|
|
3
|
+
A unified CLI tool for building and deploying Docker services to the Deploy Controller. Supports both single-service and monorepo architectures.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Install via pip
|
|
9
|
+
pip install arc-deploy
|
|
10
|
+
|
|
11
|
+
# Or using uv
|
|
12
|
+
uv pip install arc-deploy
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Configuration
|
|
16
|
+
|
|
17
|
+
### 1. Single Service
|
|
18
|
+
Create `deploy.yaml` in your project root:
|
|
19
|
+
|
|
20
|
+
```yaml
|
|
21
|
+
service_name: arc_nodejs_service
|
|
22
|
+
ecr_registry: 264778582408.dkr.ecr.us-west-2.amazonaws.com
|
|
23
|
+
deploy_controller_url: https://deploy-controller.example.com
|
|
24
|
+
aws_region: us-west-2
|
|
25
|
+
|
|
26
|
+
build:
|
|
27
|
+
dockerfile: Dockerfile
|
|
28
|
+
context: .
|
|
29
|
+
build_args:
|
|
30
|
+
NODE_ENV: production
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 2. Monorepo
|
|
34
|
+
Create `deploy.yaml` in your repository root. See [Monorepo Guide](monorepo.md) for details.
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
common:
|
|
38
|
+
ecr_registry: 264778582408.dkr.ecr.us-west-2.amazonaws.com
|
|
39
|
+
deploy_controller_url: https://deploy-controller.example.com
|
|
40
|
+
services:
|
|
41
|
+
api:
|
|
42
|
+
service_name: arc_api
|
|
43
|
+
build: { context: services/api }
|
|
44
|
+
worker:
|
|
45
|
+
service_name: arc_worker
|
|
46
|
+
build: { context: services/worker }
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Usage
|
|
50
|
+
|
|
51
|
+
**Environment Variables:**
|
|
52
|
+
```bash
|
|
53
|
+
export WEBHOOK_TOKEN="your-token"
|
|
54
|
+
export AWS_PROFILE="default" # or standard AWS env vars
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Commands:**
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Deploy (Single config or Monorepo root)
|
|
61
|
+
arc-deploy build-and-deploy --env test
|
|
62
|
+
|
|
63
|
+
# Monorepo: Deploy specific service(s)
|
|
64
|
+
arc-deploy build-and-deploy --env test --service api
|
|
65
|
+
arc-deploy build-and-deploy --env test --service api,worker
|
|
66
|
+
|
|
67
|
+
# Monorepo: Deploy all services
|
|
68
|
+
arc-deploy build-and-deploy --env test --all
|
|
69
|
+
|
|
70
|
+
# Build only (skip push/deploy)
|
|
71
|
+
arc-deploy build-only
|
|
72
|
+
|
|
73
|
+
# Validate config
|
|
74
|
+
arc-deploy validate-config
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Reference
|
|
78
|
+
|
|
79
|
+
| Field | Description |
|
|
80
|
+
|-------|-------------|
|
|
81
|
+
| `service_name` | **Required**. Must match service name in Deploy Controller. |
|
|
82
|
+
| `ecr_registry` | **Required**. ECR repository URL. |
|
|
83
|
+
| `deploy_controller_url` | **Required**. Base URL of the controller. |
|
|
84
|
+
| `build.dockerfile` | Path to Dockerfile (default: `Dockerfile`). |
|
|
85
|
+
| `build.context` | Build context path (default: `.`). |
|
|
86
|
+
| `build.build_args` | Dictionary of build arguments. |
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Monorepo Configuration Guide
|
|
2
|
+
|
|
3
|
+
## Directory Structure
|
|
4
|
+
```
|
|
5
|
+
repo/
|
|
6
|
+
├── deploy.yaml # Unified config at root
|
|
7
|
+
└── services/
|
|
8
|
+
├── service-a/
|
|
9
|
+
└── service-b/
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Configuration Logic
|
|
13
|
+
|
|
14
|
+
1. **Inheritance**:
|
|
15
|
+
* `common`: Settings applied to *all* services (e.g., registry, URL).
|
|
16
|
+
* `services`: Individual service configurations. Values here override `common`.
|
|
17
|
+
|
|
18
|
+
2. **Paths**:
|
|
19
|
+
* All paths (`dockerfile`, `context`) are **relative** to the `deploy.yaml` file location.
|
|
20
|
+
|
|
21
|
+
## Example Configuration
|
|
22
|
+
|
|
23
|
+
```yaml
|
|
24
|
+
common:
|
|
25
|
+
ecr_registry: 264778582408.dkr.ecr.us-west-2.amazonaws.com
|
|
26
|
+
deploy_controller_url: https://deploy-controller.example.com
|
|
27
|
+
aws_region: us-west-2
|
|
28
|
+
|
|
29
|
+
services:
|
|
30
|
+
# Service ID: 'frontend' (used in CLI: --service frontend)
|
|
31
|
+
frontend:
|
|
32
|
+
service_name: arc_frontend # Real service name in controller
|
|
33
|
+
build:
|
|
34
|
+
context: apps/frontend
|
|
35
|
+
|
|
36
|
+
# Service ID: 'backend'
|
|
37
|
+
backend:
|
|
38
|
+
service_name: arc_backend
|
|
39
|
+
build:
|
|
40
|
+
context: apps/backend
|
|
41
|
+
dockerfile: apps/backend/Dockerfile.prod
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## CLI Usage
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# List all available services
|
|
48
|
+
arc-deploy list-services
|
|
49
|
+
|
|
50
|
+
# Deploy specific services from root
|
|
51
|
+
arc-deploy build-and-deploy --env test --service frontend
|
|
52
|
+
arc-deploy build-and-deploy --env prod --service frontend,backend
|
|
53
|
+
|
|
54
|
+
# Deploy all services
|
|
55
|
+
arc-deploy build-and-deploy --env test --all
|
|
56
|
+
|
|
57
|
+
# Build only (skip push and deploy)
|
|
58
|
+
arc-deploy build-and-deploy --env test --service frontend --skip-push
|
|
59
|
+
|
|
60
|
+
# Build and push only (skip deploy)
|
|
61
|
+
arc-deploy build-and-deploy --env test --service frontend --skip-deploy
|
|
62
|
+
```
|