feat: add support for coder_env (#11102)

Fixes #10166
This commit is contained in:
Mathias Fredriksson
2023-12-11 16:10:18 +02:00
committed by GitHub
parent 4612c28d99
commit 3e5d292135
7 changed files with 550 additions and 382 deletions
+1
View File
@@ -477,6 +477,7 @@ const createTemplateVersionTar = async (
env: {},
id: randomUUID(),
metadata: [],
extraEnvs: [],
scripts: [],
motdFile: "",
name: "dev",
+21
View File
@@ -122,6 +122,7 @@ export interface Agent {
/** Field 19 was startup_script_behavior, now removed. */
displayApps: DisplayApps | undefined;
scripts: Script[];
extraEnvs: Env[];
}
export interface Agent_Metadata {
@@ -145,6 +146,11 @@ export interface DisplayApps {
portForwardingHelper: boolean;
}
export interface Env {
name: string;
value: string;
}
/** Script represents a script to be run on the workspace. */
export interface Script {
displayName: string;
@@ -523,6 +529,9 @@ export const Agent = {
for (const v of message.scripts) {
Script.encode(v!, writer.uint32(170).fork()).ldelim();
}
for (const v of message.extraEnvs) {
Env.encode(v!, writer.uint32(178).fork()).ldelim();
}
return writer;
},
};
@@ -590,6 +599,18 @@ export const DisplayApps = {
},
};
export const Env = {
encode(message: Env, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
if (message.value !== "") {
writer.uint32(18).string(message.value);
}
return writer;
},
};
export const Script = {
encode(
message: Script,