denoland / deployctl

Command line tool for Deno Deploy
https://deno.com/deploy
MIT License
352 stars 58 forks source link

deployctl uses a list organizations endpoint that isn't part of the OpenAPI Schema #329

Open rawkode opened 1 month ago

rawkode commented 1 month ago

Can you please add this to the schema?

magurotuna commented 1 month ago

We include only stable endpoints in the OpenAPI schema, but some APIs used by deployctl may have breaking change in future so not included.

rawkode commented 1 month ago

I understand. This is making it rather difficult for me to automate my deployments, as each service relies on project level secrets.

I could solve this with deployment level secrets, but those are applied after the deployment has taken; which is failing because the secrets don't exist.

Catch 22

arnauorriols commented 1 month ago

I could solve this with deployment level secrets, but those are applied after the deployment has taken; which is failing because the secrets don't exist.

I see what you mean. When using deployctl deploy --env, it deploys once only with the project envs and then redeploys with a mix of the project env variables and the env variables provided). We are aware that this is suboptimal because of the scenario you described. However, when using the public API you can create deployments with specific env variables. Deployments created with the API will boot with the env variables already present, and your catch 22 situation should not take place.

I'm not sure I understand why you need the list_organizations endpoint though, can you clarify?

rawkode commented 1 month ago

@arnauorriols Creating a deployment with the API needs the project ID, which I was going to find by listing projects within an organization, and I need to find the organization ID first.

I could get around this with hard coding some IDs, but I'd like to make this a reusable module I can deploy all my projects with.

arnauorriols commented 1 month ago

The reason we don't provide a API to list organizations is because it is considered that all automatisms should be performed within the realm of a single organization. Creating an organization is expected to be a manual and infrequent procedure. Maybe you can get by keeping a mapping of organization ids in a config file or something similar?

rawkode commented 1 week ago

Can we have the ability to create a project with environment variables via deployctl?