crosscode: install and add Accounts; agent: Accounts installs and add-product
crosscode install takes --products accounts (one product per install); crosscode add <church> <product> installs a product next to a church's others, as its app user, undoing only its own folder, database, PM2 and site if a step fails. install_events/install_accounts share the checks, ports and nginx site. Agent 1.1.0: install jobs for Accounts, and add-product jobs (behind frp, with the Hub's ports and release). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,21 @@ describe("crosscode arguments for each job", () => {
|
||||
}))).toEqual(["install", "hope", "--products", "events", "--domain", "hope.co.za", "--events-domain", "events.hope.co.za", "--api-port", "20011", "--web-port", "20010", "--frp", "--version", "events@2.4.1"]);
|
||||
});
|
||||
|
||||
it("install: Accounts as a church's first product", () => {
|
||||
expect(crosscodeArgs(parsed({
|
||||
type: "install",
|
||||
args: { church: "grace", products: ["accounts"], domains: { accounts: "accounts.grace.crosscode.co.za" }, ports: { accounts: { web: 20020, api: 20021 } } },
|
||||
}))).toEqual(["install", "grace", "--products", "accounts", "--domain", "grace.crosscode.co.za", "--accounts-domain", "accounts.grace.crosscode.co.za", "--api-port", "20021", "--web-port", "20020", "--frp"]);
|
||||
expect(() => crosscodeArgs(parsed({ type: "install", args: { church: "grace", products: ["website"], domains: { website: "www.grace.co.za" }, ports: { website: { web: 20030, api: 20031 } } } }))).toThrow(/one product at a time/);
|
||||
});
|
||||
|
||||
it("add-product: Accounts next to Events, behind frp", () => {
|
||||
expect(crosscodeArgs(parsed({
|
||||
type: "add-product",
|
||||
args: { church: "hope", product: "accounts", version: "accounts@1.0.0", domain: "accounts.hope.co.za", ports: { web: 20012, api: 20013 } },
|
||||
}))).toEqual(["add", "hope", "accounts", "--domain", "accounts.hope.co.za", "--api-port", "20013", "--web-port", "20012", "--frp", "--version", "accounts@1.0.0"]);
|
||||
});
|
||||
|
||||
it("deploy, adopt, restart, uninstall, purge, status", () => {
|
||||
expect(crosscodeArgs(parsed({}))).toEqual(["deploy", "hope", "events", "--version", "events@2.4.1"]);
|
||||
expect(crosscodeArgs(parsed({ args: { church: "hope", products: ["events"], check: true } }))).toEqual(["deploy", "hope", "events", "--check"]);
|
||||
|
||||
Reference in New Issue
Block a user