0

Auto deploy containers

by
Published Oct 17, 2025

Triggers a new container deploy in each environment matching the following conditions - environment should have the auto-deploy enabled - the container should have the same image name and a different tag

Script qovery Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
/**
3
 * Auto deploy containers
4
 * Triggers a new container deploy in each environment matching the following conditions
5
- environment should have the auto-deploy enabled
6
- the container should have the same image name and a different tag
7

8
 */
9
export async function main(auth: RT.Qovery, organizationId: string, body: Body) {
10
	const url = new URL(`https://api.qovery.com/organization/${organizationId}/container/deploy`)
11

12
	const response = await fetch(url, {
13
		method: 'POST',
14
		headers: {
15
			'Content-Type': 'application/json',
16
			Authorization: 'Token ' + auth.apiKey
17
		},
18
		body: JSON.stringify(body)
19
	})
20
	if (!response.ok) {
21
		const text = await response.text()
22
		throw new Error(`${response.status} ${text}`)
23
	}
24
	return await response.json()
25
}
26

27
/* eslint-disable */
28
/**
29
 * This file was automatically generated by json-schema-to-typescript.
30
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
31
 * and run json-schema-to-typescript to regenerate this file.
32
 */
33

34
export interface Body {
35
	/**
36
	 * the container image name to deploy
37
	 */
38
	image_name?: string
39
	/**
40
	 * the new tag to deploy
41
	 */
42
	tag?: string
43
	[k: string]: unknown
44
}
45