Set auction id in deployment request
This commit is contained in:
parent
61e1116e33
commit
b84527d9c6
@ -20,12 +20,11 @@ import click
|
||||
import yaml
|
||||
|
||||
from stack_orchestrator.deploy.webapp.util import (
|
||||
AUCTION_KIND_PROVIDER,
|
||||
TOKEN_DENOM,
|
||||
LaconicRegistryClient,
|
||||
)
|
||||
|
||||
AUCTION_KIND_PROVIDER = "provider"
|
||||
TOKEN_DENOM = "alnt"
|
||||
|
||||
def fatal(msg: str):
|
||||
print(msg, file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
@ -136,9 +136,10 @@ def command(
|
||||
if not deployer_record:
|
||||
fatal(f"Unable to locate deployer: {deployer}")
|
||||
|
||||
deployer_records.append(deployer_records_by_owner[0])
|
||||
deployer_records.append(deployer_record)
|
||||
|
||||
# Create and send request to each deployer
|
||||
deployment_requests = []
|
||||
for deployer_record in deployer_records:
|
||||
# If env_file
|
||||
if env_file:
|
||||
@ -183,11 +184,15 @@ def command(
|
||||
"application": app,
|
||||
"version": "1.0.0",
|
||||
"name": f"{app_record.attributes.name}@{app_record.attributes.version}",
|
||||
"deployer": deployer,
|
||||
"meta": {"when": str(datetime.utcnow())},
|
||||
}
|
||||
}
|
||||
|
||||
if auction_id:
|
||||
deployment_request["record"]["auction"] = auction_id
|
||||
else:
|
||||
deployment_request["record"]["deployer"] = deployer
|
||||
|
||||
if config_ref:
|
||||
deployment_request["record"]["config"] = {"ref": config_ref}
|
||||
|
||||
@ -214,11 +219,14 @@ def command(
|
||||
elif use_payment:
|
||||
deployment_request["record"]["payment"] = use_payment
|
||||
|
||||
deployment_requests.append(deployment_request)
|
||||
|
||||
# Send all requests
|
||||
for deployment_request in deployment_requests:
|
||||
if dry_run:
|
||||
print(yaml.dump(deployment_request))
|
||||
return
|
||||
continue
|
||||
|
||||
# Send the request
|
||||
laconic.publish(deployment_request)
|
||||
finally:
|
||||
shutil.rmtree(tempdir, ignore_errors=True)
|
||||
|
Loading…
Reference in New Issue
Block a user