Environment variables added

This commit is contained in:
stefan.meyer
2024-11-05 20:45:10 +00:00
parent 8e7704c3c9
commit 2d940f6bc1
2 changed files with 9 additions and 1 deletions

View File

@@ -56,7 +56,7 @@ export default function EnvEdit({ app }: {
<FormItem>
<FormLabel>Env Variables</FormLabel>
<FormControl>
<Textarea className="h-96" placeholder="NAME=VALUE..." {...field} value={field.value} />
<Textarea className="h-96" placeholder="NAME=VALUE,NAME=VALUE,NAME=VALUE,..." {...field} value={field.value} />
</FormControl>
<FormMessage />
</FormItem>

View File

@@ -90,6 +90,13 @@ class DeploymentService {
async createDeployment(app: AppExtendedModel, buildJobName?: string) {
await this.createNamespaceIfNotExists(app.projectId);
const envVars = app.envVars
? app.envVars.split(',').map(env => {
const [name, value] = env.split('=');
return { name, value };
})
: [];
const existingDeployment = await this.getDeployment(app.projectId, app.id);
const body: V1Deployment = {
metadata: {
@@ -120,6 +127,7 @@ class DeploymentService {
name: app.id,
image: !!buildJobName ? buildService.createContainerRegistryUrlForAppId(app.id) : app.containerImageSource as string,
imagePullPolicy: 'Always',
...(envVars.length > 0 ? { env: envVars } : {}),
/*ports: [
{
containerPort: app.port