azure-deploy-cli 0.1.12__tar.gz → 1.0.0__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.
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/.pre-commit-config.yaml +1 -1
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/CHANGELOG.md +5 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/PKG-INFO +62 -9
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/README.md +59 -8
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/pyproject.toml +1 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/requirements-dev.txt +1 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/requirements.txt +1 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/_version.py +3 -3
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/aca/aca_cli.py +41 -75
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/aca/deploy_aca.py +111 -60
- azure_deploy_cli-1.0.0/src/azure_deploy_cli/aca/model.py +81 -0
- azure_deploy_cli-1.0.0/src/azure_deploy_cli/aca/yaml_loader.py +53 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/utils/docker.py +43 -33
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/utils/logging.py +1 -1
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli.egg-info/PKG-INFO +62 -9
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli.egg-info/SOURCES.txt +2 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli.egg-info/requires.txt +2 -0
- azure_deploy_cli-1.0.0/tests/test_probe_config.py +165 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/tests/test_retag_image.py +94 -55
- azure_deploy_cli-0.1.12/src/azure_deploy_cli/aca/model.py +0 -35
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/.github/dependabot.yml +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/.github/workflows/1-1-pr-build-check.yaml +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/.github/workflows/1-2-staging.yaml +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/.github/workflows/1-3-release.yaml +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/.github/workflows/2-build.yaml +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/.gitignore +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/LICENSE +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/Makefile +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/setup.cfg +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/setup.sh +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/__init__.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/aca/bash/aca-cert/create.sh +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/aca/bash/aca-cert/destroy.sh +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/cli.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/identity/__init__.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/identity/group.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/identity/identity_cli.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/identity/managed_identity.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/identity/models.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/identity/py.typed +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/identity/role.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/identity/service_principal.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/py.typed +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/utils/__init__.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/utils/azure_cli.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/utils/env.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/utils/key_vault.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli/utils/py.typed +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli.egg-info/dependency_links.txt +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli.egg-info/entry_points.txt +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/src/azure_deploy_cli.egg-info/top_level.txt +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/tests/__init__.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/tests/fixtures/.env.example +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/tests/identity/__init__.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/tests/identity/test_models.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/tests/roles-config.json +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/tests/test.sh +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/tests/test_aca_cli.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/tests/test_deploy_aca.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/tests/test_env.py +0 -0
- {azure_deploy_cli-0.1.12 → azure_deploy_cli-1.0.0}/tests/test_package.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: azure-deploy-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Python CLI for Azure deployment automation - identity, roles, and container apps management
|
|
5
5
|
Author-email: decewei <celinew1221@gmail.com>
|
|
6
6
|
License: Mozilla Public License Version 2.0
|
|
@@ -399,6 +399,7 @@ Requires-Dist: azure-mgmt-keyvault
|
|
|
399
399
|
Requires-Dist: azure-mgmt-msi
|
|
400
400
|
Requires-Dist: python-dotenv>=1.0.0
|
|
401
401
|
Requires-Dist: pydantic>=2.0.0
|
|
402
|
+
Requires-Dist: pyyaml>=6.0
|
|
402
403
|
Provides-Extra: dev
|
|
403
404
|
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
404
405
|
Requires-Dist: mypy>=1.7.0; extra == "dev"
|
|
@@ -409,6 +410,7 @@ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
|
409
410
|
Requires-Dist: commitizen>=3.0.0; extra == "dev"
|
|
410
411
|
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
|
|
411
412
|
Requires-Dist: types-setuptools; extra == "dev"
|
|
413
|
+
Requires-Dist: types-PyYAML; extra == "dev"
|
|
412
414
|
Dynamic: license-file
|
|
413
415
|
|
|
414
416
|
# Azure Deploy CLI
|
|
@@ -459,11 +461,11 @@ pip install -e /path/to/scripts
|
|
|
459
461
|
|
|
460
462
|
### Azure Container Apps (ACA) Deployment
|
|
461
463
|
|
|
462
|
-
The ACA deployment process is split into two stages for better control:
|
|
464
|
+
The ACA deployment process uses YAML configuration for containers and is split into two stages for better control:
|
|
463
465
|
|
|
464
466
|
#### Stage 1: Deploy Revision
|
|
465
467
|
|
|
466
|
-
Deploy a new container revision without affecting traffic:
|
|
468
|
+
Deploy a new container revision from YAML configuration without affecting traffic:
|
|
467
469
|
|
|
468
470
|
```bash
|
|
469
471
|
azd azaca deploy \
|
|
@@ -474,25 +476,76 @@ azd azaca deploy \
|
|
|
474
476
|
--user-assigned-identity-name my-identity \
|
|
475
477
|
--container-app my-app \
|
|
476
478
|
--registry-server myregistry.azurecr.io \
|
|
477
|
-
--image-name my-image \
|
|
478
479
|
--stage prod \
|
|
479
|
-
--target-port
|
|
480
|
-
--cpu 0.5 \
|
|
481
|
-
--memory 1.0 \
|
|
480
|
+
--target-port 8080 \
|
|
482
481
|
--min-replicas 1 \
|
|
483
482
|
--max-replicas 10 \
|
|
484
483
|
--keyvault-name my-keyvault \
|
|
485
|
-
--
|
|
486
|
-
--env-vars ENV_VAR1 ENV_VAR2 \
|
|
484
|
+
--container-config ./container-config.yaml \
|
|
487
485
|
--env-var-secrets SECRET1 SECRET2
|
|
488
486
|
```
|
|
489
487
|
|
|
490
488
|
This command:
|
|
491
489
|
|
|
490
|
+
- Loads container configurations from YAML file
|
|
491
|
+
- Builds/pushes container images for all containers
|
|
492
492
|
- Creates or updates a new revision with 0% traffic
|
|
493
|
+
- Supports multiple containers with independent configurations
|
|
493
494
|
- Verifies the revision is healthy and active
|
|
494
495
|
- Outputs the revision name for use in traffic management
|
|
495
496
|
|
|
497
|
+
**Container Configuration YAML:**
|
|
498
|
+
|
|
499
|
+
The `--container-config` file specifies container settings including images, resources, environment variables, and health probes:
|
|
500
|
+
|
|
501
|
+
```yaml
|
|
502
|
+
containers:
|
|
503
|
+
- name: my-app
|
|
504
|
+
image_name: my-image
|
|
505
|
+
cpu: 0.5
|
|
506
|
+
memory: "1.0Gi"
|
|
507
|
+
env_vars:
|
|
508
|
+
- ENV_VAR1
|
|
509
|
+
- ENV_VAR2
|
|
510
|
+
# relative to the directory which command will run fromm
|
|
511
|
+
dockerfile: ./Dockerfile
|
|
512
|
+
probes:
|
|
513
|
+
- type: Liveness
|
|
514
|
+
http_get:
|
|
515
|
+
path: /health
|
|
516
|
+
port: 8080
|
|
517
|
+
initial_delay_seconds: 10
|
|
518
|
+
period_seconds: 30
|
|
519
|
+
- type: Readiness
|
|
520
|
+
http_get:
|
|
521
|
+
path: /ready
|
|
522
|
+
port: 8080
|
|
523
|
+
initial_delay_seconds: 5
|
|
524
|
+
period_seconds: 10
|
|
525
|
+
|
|
526
|
+
- name: sidecar
|
|
527
|
+
image_name: sidecar-image
|
|
528
|
+
cpu: 0.25
|
|
529
|
+
memory: "0.5Gi"
|
|
530
|
+
env_vars:
|
|
531
|
+
- SIDECAR_CONFIG
|
|
532
|
+
existing_image_tag: v1.0.0 # Optional: retag from existing image
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
**Configuration Fields:**
|
|
536
|
+
|
|
537
|
+
- `containers` (required): List of container configurations
|
|
538
|
+
- `name`: Container name (required)
|
|
539
|
+
- `image_name`: Image name without registry/tag (required)
|
|
540
|
+
- `cpu`: CPU allocation (required, e.g., 0.5)
|
|
541
|
+
- `memory`: Memory allocation (required, e.g., "1.0Gi")
|
|
542
|
+
- `env_vars`: List of environment variable names to load (optional)
|
|
543
|
+
- `dockerfile`: Path to Dockerfile for building (required if existing_image_tag not provided)
|
|
544
|
+
- `existing_image_tag`: Tag to retag from instead of building (required if dockerfile not provided)
|
|
545
|
+
- `probes`: List of health probes (optional)
|
|
546
|
+
|
|
547
|
+
**Note:** Ingress configuration (target port) and scaling parameters (min/max replicas) are specified via CLI arguments, not in the YAML file.
|
|
548
|
+
|
|
496
549
|
#### Stage 2: Update Traffic Weights
|
|
497
550
|
|
|
498
551
|
Update traffic distribution and deactivate old revisions:
|
|
@@ -46,11 +46,11 @@ pip install -e /path/to/scripts
|
|
|
46
46
|
|
|
47
47
|
### Azure Container Apps (ACA) Deployment
|
|
48
48
|
|
|
49
|
-
The ACA deployment process is split into two stages for better control:
|
|
49
|
+
The ACA deployment process uses YAML configuration for containers and is split into two stages for better control:
|
|
50
50
|
|
|
51
51
|
#### Stage 1: Deploy Revision
|
|
52
52
|
|
|
53
|
-
Deploy a new container revision without affecting traffic:
|
|
53
|
+
Deploy a new container revision from YAML configuration without affecting traffic:
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
56
|
azd azaca deploy \
|
|
@@ -61,25 +61,76 @@ azd azaca deploy \
|
|
|
61
61
|
--user-assigned-identity-name my-identity \
|
|
62
62
|
--container-app my-app \
|
|
63
63
|
--registry-server myregistry.azurecr.io \
|
|
64
|
-
--image-name my-image \
|
|
65
64
|
--stage prod \
|
|
66
|
-
--target-port
|
|
67
|
-
--cpu 0.5 \
|
|
68
|
-
--memory 1.0 \
|
|
65
|
+
--target-port 8080 \
|
|
69
66
|
--min-replicas 1 \
|
|
70
67
|
--max-replicas 10 \
|
|
71
68
|
--keyvault-name my-keyvault \
|
|
72
|
-
--
|
|
73
|
-
--env-vars ENV_VAR1 ENV_VAR2 \
|
|
69
|
+
--container-config ./container-config.yaml \
|
|
74
70
|
--env-var-secrets SECRET1 SECRET2
|
|
75
71
|
```
|
|
76
72
|
|
|
77
73
|
This command:
|
|
78
74
|
|
|
75
|
+
- Loads container configurations from YAML file
|
|
76
|
+
- Builds/pushes container images for all containers
|
|
79
77
|
- Creates or updates a new revision with 0% traffic
|
|
78
|
+
- Supports multiple containers with independent configurations
|
|
80
79
|
- Verifies the revision is healthy and active
|
|
81
80
|
- Outputs the revision name for use in traffic management
|
|
82
81
|
|
|
82
|
+
**Container Configuration YAML:**
|
|
83
|
+
|
|
84
|
+
The `--container-config` file specifies container settings including images, resources, environment variables, and health probes:
|
|
85
|
+
|
|
86
|
+
```yaml
|
|
87
|
+
containers:
|
|
88
|
+
- name: my-app
|
|
89
|
+
image_name: my-image
|
|
90
|
+
cpu: 0.5
|
|
91
|
+
memory: "1.0Gi"
|
|
92
|
+
env_vars:
|
|
93
|
+
- ENV_VAR1
|
|
94
|
+
- ENV_VAR2
|
|
95
|
+
# relative to the directory which command will run fromm
|
|
96
|
+
dockerfile: ./Dockerfile
|
|
97
|
+
probes:
|
|
98
|
+
- type: Liveness
|
|
99
|
+
http_get:
|
|
100
|
+
path: /health
|
|
101
|
+
port: 8080
|
|
102
|
+
initial_delay_seconds: 10
|
|
103
|
+
period_seconds: 30
|
|
104
|
+
- type: Readiness
|
|
105
|
+
http_get:
|
|
106
|
+
path: /ready
|
|
107
|
+
port: 8080
|
|
108
|
+
initial_delay_seconds: 5
|
|
109
|
+
period_seconds: 10
|
|
110
|
+
|
|
111
|
+
- name: sidecar
|
|
112
|
+
image_name: sidecar-image
|
|
113
|
+
cpu: 0.25
|
|
114
|
+
memory: "0.5Gi"
|
|
115
|
+
env_vars:
|
|
116
|
+
- SIDECAR_CONFIG
|
|
117
|
+
existing_image_tag: v1.0.0 # Optional: retag from existing image
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Configuration Fields:**
|
|
121
|
+
|
|
122
|
+
- `containers` (required): List of container configurations
|
|
123
|
+
- `name`: Container name (required)
|
|
124
|
+
- `image_name`: Image name without registry/tag (required)
|
|
125
|
+
- `cpu`: CPU allocation (required, e.g., 0.5)
|
|
126
|
+
- `memory`: Memory allocation (required, e.g., "1.0Gi")
|
|
127
|
+
- `env_vars`: List of environment variable names to load (optional)
|
|
128
|
+
- `dockerfile`: Path to Dockerfile for building (required if existing_image_tag not provided)
|
|
129
|
+
- `existing_image_tag`: Tag to retag from instead of building (required if dockerfile not provided)
|
|
130
|
+
- `probes`: List of health probes (optional)
|
|
131
|
+
|
|
132
|
+
**Note:** Ingress configuration (target port) and scaling parameters (min/max replicas) are specified via CLI arguments, not in the YAML file.
|
|
133
|
+
|
|
83
134
|
#### Stage 2: Update Traffic Weights
|
|
84
135
|
|
|
85
136
|
Update traffic distribution and deactivate old revisions:
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.
|
|
32
|
-
__version_tuple__ = version_tuple = (
|
|
31
|
+
__version__ = version = '1.0.0'
|
|
32
|
+
__version_tuple__ = version_tuple = (1, 0, 0)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g2aebd8fbb'
|
|
@@ -15,14 +15,13 @@ from ..utils.logging import get_logger
|
|
|
15
15
|
from .deploy_aca import (
|
|
16
16
|
SecretKeyVaultConfig,
|
|
17
17
|
bind_aca_managed_certificate,
|
|
18
|
-
build_acr_image,
|
|
19
18
|
create_container_app_env,
|
|
20
19
|
deploy_revision,
|
|
21
20
|
generate_revision_suffix,
|
|
22
|
-
get_aca_docker_image_name,
|
|
23
21
|
update_traffic_weights,
|
|
24
22
|
validate_revision_suffix_and_throw,
|
|
25
23
|
)
|
|
24
|
+
from .yaml_loader import ContainerAppConfig, load_app_config_yaml
|
|
26
25
|
|
|
27
26
|
logger = get_logger(__name__)
|
|
28
27
|
|
|
@@ -92,16 +91,16 @@ def _validate_cli_deploy(args: Any):
|
|
|
92
91
|
|
|
93
92
|
def cli_deploy(args: Any) -> None:
|
|
94
93
|
"""
|
|
95
|
-
|
|
96
|
-
Deploy Azure Container App revision without updating traffic.
|
|
94
|
+
Deploy Azure Container App revision from YAML configuration without updating traffic.
|
|
97
95
|
|
|
98
96
|
This command orchestrates:
|
|
99
|
-
1.
|
|
100
|
-
2.
|
|
101
|
-
3.
|
|
102
|
-
4.
|
|
103
|
-
5.
|
|
104
|
-
6.
|
|
97
|
+
1. Load container configuration from YAML
|
|
98
|
+
2. Create/get user-assigned managed identity (if specified)
|
|
99
|
+
3. Assign roles to the identity (if role config provided)
|
|
100
|
+
4. Build/push container images for all containers
|
|
101
|
+
5. Deploy new revision with 0% traffic
|
|
102
|
+
6. Verify revision activation and health
|
|
103
|
+
7. Output the revision name for use in traffic management
|
|
105
104
|
|
|
106
105
|
Args:
|
|
107
106
|
args: Parsed command line arguments
|
|
@@ -128,24 +127,9 @@ def cli_deploy(args: Any) -> None:
|
|
|
128
127
|
else generate_revision_suffix(stage=args.stage)
|
|
129
128
|
)
|
|
130
129
|
|
|
131
|
-
logger.critical("
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
registry_server=args.registry_server,
|
|
135
|
-
dockerfile=args.dockerfile,
|
|
136
|
-
full_image_name=get_aca_docker_image_name(
|
|
137
|
-
registry_server=args.registry_server,
|
|
138
|
-
image_name=args.image_name,
|
|
139
|
-
image_tag=revision_suffix,
|
|
140
|
-
),
|
|
141
|
-
source_full_image_name=get_aca_docker_image_name(
|
|
142
|
-
registry_server=args.registry_server,
|
|
143
|
-
image_name=args.image_name,
|
|
144
|
-
image_tag=args.existing_image_tag,
|
|
145
|
-
)
|
|
146
|
-
if args.existing_image_tag
|
|
147
|
-
else None,
|
|
148
|
-
)
|
|
130
|
+
logger.critical(f"Loading container configuration from '{args.container_config}'...")
|
|
131
|
+
app_config: ContainerAppConfig = load_app_config_yaml(args.container_config)
|
|
132
|
+
logger.critical(f"Loaded configuration with {len(app_config.containers)} container(s)")
|
|
149
133
|
|
|
150
134
|
logger.critical("Setting up managed identity and roles...")
|
|
151
135
|
user_identity = create_or_get_user_identity(
|
|
@@ -180,14 +164,13 @@ def cli_deploy(args: Any) -> None:
|
|
|
180
164
|
registry_server=args.registry_server,
|
|
181
165
|
registry_user=registry_user,
|
|
182
166
|
registry_pass_env_name=REGISTRY_PASS_SECRET_ENV_NAME,
|
|
183
|
-
image_name=args.image_name,
|
|
184
|
-
image_tag=revision_suffix,
|
|
185
167
|
revision_suffix=revision_suffix,
|
|
186
168
|
location=args.location,
|
|
187
169
|
stage=args.stage,
|
|
170
|
+
container_configs=app_config.containers,
|
|
188
171
|
target_port=args.target_port,
|
|
189
|
-
|
|
190
|
-
|
|
172
|
+
ingress_external=args.ingress_external,
|
|
173
|
+
ingress_transport=args.ingress_transport,
|
|
191
174
|
min_replicas=args.min_replicas,
|
|
192
175
|
max_replicas=args.max_replicas,
|
|
193
176
|
secret_key_vault_config=SecretKeyVaultConfig(
|
|
@@ -196,8 +179,6 @@ def cli_deploy(args: Any) -> None:
|
|
|
196
179
|
secret_names=args.env_var_secrets or [],
|
|
197
180
|
user_identity=user_identity,
|
|
198
181
|
),
|
|
199
|
-
env_var_names=args.env_vars,
|
|
200
|
-
existing_image_tag=args.existing_image_tag,
|
|
201
182
|
)
|
|
202
183
|
|
|
203
184
|
if args.custom_domains:
|
|
@@ -352,65 +333,57 @@ def add_commands(subparsers: argparse._SubParsersAction) -> None:
|
|
|
352
333
|
help="Container registry server.",
|
|
353
334
|
)
|
|
354
335
|
deploy_parser.add_argument(
|
|
355
|
-
"--
|
|
336
|
+
"--keyvault-name",
|
|
356
337
|
required=True,
|
|
357
338
|
type=str,
|
|
358
|
-
help="Name of the
|
|
339
|
+
help="Name of the Key Vault for storing secrets.",
|
|
359
340
|
)
|
|
341
|
+
|
|
360
342
|
deploy_parser.add_argument(
|
|
361
|
-
"--
|
|
362
|
-
required=
|
|
343
|
+
"--stage",
|
|
344
|
+
required=True,
|
|
363
345
|
type=str,
|
|
364
|
-
help=(
|
|
365
|
-
"Tag of an existing image to retag to the revision suffix. "
|
|
366
|
-
"If provided, the image with this tag will be pulled from the registry, "
|
|
367
|
-
"retagged to the revision suffix, and pushed. "
|
|
368
|
-
"If the image doesn't exist, deployment will fail."
|
|
369
|
-
),
|
|
346
|
+
help="Deployment stage label (e.g., staging, prod) used for revision naming.",
|
|
370
347
|
)
|
|
348
|
+
|
|
371
349
|
deploy_parser.add_argument(
|
|
372
350
|
"--target-port",
|
|
373
351
|
required=True,
|
|
374
352
|
type=int,
|
|
375
|
-
help="Target port for the container app.",
|
|
353
|
+
help="Target port for the container app ingress.",
|
|
376
354
|
)
|
|
355
|
+
|
|
377
356
|
deploy_parser.add_argument(
|
|
378
|
-
"--
|
|
379
|
-
required=
|
|
380
|
-
type=
|
|
381
|
-
|
|
357
|
+
"--ingress-external",
|
|
358
|
+
required=False,
|
|
359
|
+
type=bool,
|
|
360
|
+
default=True,
|
|
361
|
+
help="Whether ingress is external (default: True).",
|
|
382
362
|
)
|
|
363
|
+
|
|
383
364
|
deploy_parser.add_argument(
|
|
384
|
-
"--
|
|
385
|
-
required=
|
|
365
|
+
"--ingress-transport",
|
|
366
|
+
required=False,
|
|
386
367
|
type=str,
|
|
387
|
-
|
|
368
|
+
default="auto",
|
|
369
|
+
choices=["auto", "http", "http2", "tcp"],
|
|
370
|
+
help="Ingress transport protocol (default: auto).",
|
|
388
371
|
)
|
|
372
|
+
|
|
389
373
|
deploy_parser.add_argument(
|
|
390
374
|
"--min-replicas",
|
|
391
375
|
required=True,
|
|
392
376
|
type=int,
|
|
393
377
|
help="Minimum number of replicas for the container app.",
|
|
394
378
|
)
|
|
379
|
+
|
|
395
380
|
deploy_parser.add_argument(
|
|
396
381
|
"--max-replicas",
|
|
397
382
|
required=True,
|
|
398
383
|
type=int,
|
|
399
384
|
help="Maximum number of replicas for the container app.",
|
|
400
385
|
)
|
|
401
|
-
deploy_parser.add_argument(
|
|
402
|
-
"--keyvault-name",
|
|
403
|
-
required=True,
|
|
404
|
-
type=str,
|
|
405
|
-
help="Name of the Key Vault for storing secrets.",
|
|
406
|
-
)
|
|
407
386
|
|
|
408
|
-
deploy_parser.add_argument(
|
|
409
|
-
"--stage",
|
|
410
|
-
required=True,
|
|
411
|
-
type=str,
|
|
412
|
-
help="Deployment stage label (e.g., staging, prod) used for revision naming.",
|
|
413
|
-
)
|
|
414
387
|
deploy_parser.add_argument(
|
|
415
388
|
"--env-var-secrets",
|
|
416
389
|
required=False,
|
|
@@ -419,14 +392,6 @@ def add_commands(subparsers: argparse._SubParsersAction) -> None:
|
|
|
419
392
|
help="Space-separated names of environment variables to be stored as secrets in Key Vault.",
|
|
420
393
|
)
|
|
421
394
|
|
|
422
|
-
deploy_parser.add_argument(
|
|
423
|
-
"--env-vars",
|
|
424
|
-
required=False,
|
|
425
|
-
type=str,
|
|
426
|
-
nargs="+",
|
|
427
|
-
help="Space-separated names of environment variables to pass to the container.",
|
|
428
|
-
)
|
|
429
|
-
|
|
430
395
|
deploy_parser.add_argument(
|
|
431
396
|
"--role-config",
|
|
432
397
|
required=False,
|
|
@@ -458,10 +423,11 @@ def add_commands(subparsers: argparse._SubParsersAction) -> None:
|
|
|
458
423
|
)
|
|
459
424
|
|
|
460
425
|
deploy_parser.add_argument(
|
|
461
|
-
"--
|
|
426
|
+
"--container-config",
|
|
462
427
|
required=True,
|
|
463
|
-
type=
|
|
464
|
-
help="Path to
|
|
428
|
+
type=Path,
|
|
429
|
+
help="Path to YAML file containing container configurations "
|
|
430
|
+
"(includes image names, cpu, memory, env_vars, probes, ingress, and scale settings)",
|
|
465
431
|
)
|
|
466
432
|
|
|
467
433
|
deploy_parser.set_defaults(func=cli_deploy)
|