//native
/**
* Deploy services
* Update and deploy the selected services
*/
export async function main(auth: RT.Qovery, environmentId: string, body: Body) {
const url = new URL(`https://api.qovery.com/environment/${environmentId}/service/deploy`)
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Token ' + auth.apiKey
},
body: JSON.stringify(body)
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
/* eslint-disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export interface Body {
applications?: {
/**
* id of the application to be deployed.
*/
application_id: string
/**
* Commit ID to deploy. Can be empty only if the service has been already deployed (in this case the service version won't be changed)
*/
git_commit_id?: string
[k: string]: unknown
}[]
databases?: string[]
containers?: {
/**
* id of the container to be updated.
*/
id: string
/**
* new tag for the container. Can be empty only if the service has been already deployed (in this case the service version won't be changed)
*/
image_tag?: string
[k: string]: unknown
}[]
jobs?: {
/**
* id of the job to be updated.
*/
id?: string
/**
* new tag for the job image. Use only if job is an image source. Can be empty only if the service has been already deployed (in this case the service version won't be changed)
*/
image_tag?: string
/**
* Commit ID to deploy. Use only if job is a repository source. Can be empty only if the service has been already deployed (in this case the service version won't be changed)
*/
git_commit_id?: string
[k: string]: unknown
}[]
helms?: {
/**
* id of the helm to be updated.
*/
id?: string
/**
* The new chart version for the Helm source. Use this only if the helm has a Helm repository source.
*/
chart_version?: string
/**
* The commit Id to deploy. Use this only if the helm has a Git repository source.
*/
git_commit_id?: string
/**
* The commit Id of the override values to deploy. Use only if the helm has a Git override values repository.
*/
values_override_git_commit_id?: string
[k: string]: unknown
}[]
terraforms?: {
/**
* Terraform service identifier
*/
id?: string
/**
* Commit to deploy for chart source.
*/
git_commit_id?: string
/**
* Deprecated: use action=PLAN instead.
*/
dry_run?: boolean
/**
* Deprecated: use action=FORCE_UNLOCK instead.
*/
force_unlock_state?: boolean
/**
* Terraform action to execute.
*/
action?: 'PLAN' | 'FORCE_UNLOCK' | 'MIGRATE_STATE'
[k: string]: unknown
}[]
[k: string]: unknown
}
Submitted by hugo697 235 days ago