Skip to content

Commit b89f0fd

Browse files
authored
Merge pull request #827 from vespa-engine/thomasht86/fix-deploy-prod-util
add source-url and make it waiting optional
2 parents 7b94aaf + 99380a7 commit b89f0fd

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

vespa/utils/deploy_prod.py

+16-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def deploy_prod(
2222
application (str): Vespa Cloud application
2323
api_key (str): Vespa Cloud Control-plane API key
2424
application_root (str): Path to the Vespa application root. If application is packaged with maven, this should refer to the generated target/application directory.
25-
max_wait (int, optional): Max wait time in seconds. Defaults to 3600.
25+
max_wait (int, optional): Max wait time in seconds. Defaults to 3600. If set to -1, the script will return immediately after deployment is submitted.
2626
source_url (str, optional): Source URL (git commit URL) for the deployment. Defaults to None.
2727
2828
@@ -36,6 +36,9 @@ def deploy_prod(
3636
build_no = vespa_cloud.deploy_to_prod(
3737
instance="default", application_root=application_root, source_url=source_url
3838
)
39+
if max_wait == -1:
40+
print(f"Deployment submitted. Build number: {build_no}")
41+
return
3942
success = vespa_cloud.wait_for_prod_deployment(build_no, max_wait=max_wait)
4043
if not success:
4144
raise ValueError(
@@ -56,11 +59,21 @@ def deploy_prod(
5659
"--application-root", required=True, help="Path to the Vespa application root"
5760
)
5861
args.add_argument(
59-
"--max-wait", type=int, default=3600, help="Max wait time in seconds"
62+
"--max-wait",
63+
type=int,
64+
default=3600,
65+
help="Max wait time in seconds. -1 to return immediately after deployment is submitted.",
6066
)
6167
args.add_argument(
6268
"--source-url", help="Source URL (git commit URL) for the deployment"
6369
)
6470

6571
args = args.parse_args()
66-
deploy_prod(args.tenant, args.application, args.api_key, args.application_root)
72+
deploy_prod(
73+
args.tenant,
74+
args.application,
75+
args.api_key,
76+
args.application_root,
77+
args.max_wait,
78+
args.source_url,
79+
)

0 commit comments

Comments
 (0)