Skip to content

Commit

Permalink
Add Drupal, Grav, Nextcloud and Python as installable/creatable Apps
Browse files Browse the repository at this point in the history
  • Loading branch information
niristius committed Nov 13, 2023
1 parent d4361e2 commit e17c475
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/commands/app/create/python.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
import React from "react";
import {
AppInstallationResult,
AppInstaller,
} from "../../../lib/app/Installer.js";

export const staticInstaller = new AppInstaller(
"be57d166-dae9-4480-bae2-da3f3c6f0a2e",
"custom python site",
["document-root", "site-title", "wait"] as const,
);

export default class InstallNode extends ExecRenderBaseCommand<
typeof InstallNode,
AppInstallationResult
> {
static description = staticInstaller.description;
static flags = staticInstaller.flags;

protected async exec(): Promise<{ appInstallationId: string }> {
return staticInstaller.exec(
this.apiClient,
this.args,
this.flags,
this.config,
);
}

protected render(result: AppInstallationResult): React.ReactNode {
return staticInstaller.render(result, this.flags);
}
}
36 changes: 36 additions & 0 deletions src/commands/app/install/drupal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
import React from "react";
import {
AppInstallationResult,
AppInstaller,
} from "../../../lib/app/Installer.js";

const installer = new AppInstaller(
"3d8a261a-3d6f-4e09-b68c-bfe90aece514",
"Drupal",
[
"version",
"host",
"admin-user",
"admin-email",
"admin-pass",
"site-title",
"wait",
] as const,
);

export default class InstallShopware6 extends ExecRenderBaseCommand<
typeof InstallShopware6,
AppInstallationResult
> {
static description = installer.description;
static flags = installer.flags;

protected async exec(): Promise<{ appInstallationId: string }> {
return installer.exec(this.apiClient, this.args, this.flags, this.config);
}

protected render(result: AppInstallationResult): React.ReactNode {
return installer.render(result, this.flags);
}
}
37 changes: 37 additions & 0 deletions src/commands/app/install/grav.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
import React from "react";
import {
AppInstallationResult,
AppInstaller,
} from "../../../lib/app/Installer.js";

const installer = new AppInstaller(
"d3a465da-75a2-44ab-8e81-6960055f6255",
"Grav",
[
"version",
"admin-user",
"admin-email",
"admin-pass",
"admin-firstname",
"admin-lastname",
"site-title",
"wait",
] as const,
);

export default class InstallGrav extends ExecRenderBaseCommand<
typeof InstallGrav,
AppInstallationResult
> {
static description = installer.description;
static flags = installer.flags;

protected async exec(): Promise<{ appInstallationId: string }> {
return installer.exec(this.apiClient, this.args, this.flags, this.config);
}

protected render(result: AppInstallationResult): React.ReactNode {
return installer.render(result, this.flags);
}
}
36 changes: 36 additions & 0 deletions src/commands/app/install/nextcloud.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
import React from "react";
import {
AppInstallationResult,
AppInstaller,
} from "../../../lib/app/Installer.js";

const installer = new AppInstaller(
"0b97d59f-ee13-4f18-a1f6-53e1beaf2e70",
"Shopware 6",
[
"version",
"host",
"admin-user",
"admin-email",
"admin-pass",
"site-title",
"wait",
] as const,
);

export default class InstallShopware6 extends ExecRenderBaseCommand<
typeof InstallShopware6,
AppInstallationResult
> {
static description = installer.description;
static flags = installer.flags;

protected async exec(): Promise<{ appInstallationId: string }> {
return installer.exec(this.apiClient, this.args, this.flags, this.config);
}

protected render(result: AppInstallationResult): React.ReactNode {
return installer.render(result, this.flags);
}
}

0 comments on commit e17c475

Please sign in to comment.