Skip to content

Commit 72b8887

Browse files
committed
feat(examples): multitenant using remote builds
1 parent 08742e2 commit 72b8887

4 files changed

Lines changed: 10 additions & 7 deletions

File tree

examples/multitenant-deploys/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WORKDIR /app
44

55
# Install rivet CLI
66
RUN apk add --no-cache curl unzip
7-
RUN curl -fsSL https://get.rivet.gg/install.sh | sh
7+
RUN curl -fsSL https://releases.rivet.gg/rivet/latest/install.sh | sh
88

99
# Copy package files and install dependencies
1010
COPY package.json yarn.lock ./

examples/multitenant-deploys/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ yarn test
6565
{
6666
"success": true,
6767
"appId": "your-app-id",
68-
"endpoint": "https://your-app-id.example.com"
68+
"endpoint": "https://your-app-id.example.com",
69+
"buildOutput": "..." // Output logs from build command
6970
}
7071
```
7172

examples/multitenant-deploys/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
},
99
"dependencies": {
1010
"@hono/node-server": "^1.7.0",
11-
"@rivet-gg/api-full": "workspace:*",
1211
"axios": "^1.6.7",
1312
"hono": "^4.0.5",
1413
"temp": "^0.9.4"

examples/multitenant-deploys/src/app.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { promisify } from "node:util";
44
import * as fs from "node:fs/promises";
55
import * as path from "node:path";
66
import temp from "temp";
7-
import { RivetClient } from "@rivet-gg/api-full";
87

98
const execAsync = promisify(exec);
109

@@ -22,7 +21,7 @@ if (!RIVET_CLOUD_TOKEN || !RIVET_PROJECT || !RIVET_ENVIRONMENT) {
2221
);
2322
}
2423

25-
export const rivet = new RivetClient({ token: RIVET_CLOUD_TOKEN });
24+
// export const rivet = new RivetClient({ token: RIVET_CLOUD_TOKEN });
2625

2726
export const app = new Hono();
2827

@@ -102,7 +101,10 @@ app.post("/deploy/:appId", async (c) => {
102101
functions: {
103102
[functionName]: {
104103
build_path: "./project/",
105-
dockerfile: "./project/Dockerfile",
104+
dockerfile: "./Dockerfile",
105+
unstable: {
106+
build_method: "remote"
107+
},
106108
build_args: {
107109
// See MY_ENV_VAR build args in Dockerfile
108110
MY_ENV_VAR: "custom env var",
@@ -137,7 +139,7 @@ app.post("/deploy/:appId", async (c) => {
137139

138140
// Get the function endpoint
139141
const endpointResult = await execAsync(
140-
`rivet function endpoint --environment prod ${functionName}`,
142+
`rivet function endpoint --environment ${RIVET_ENVIRONMENT} ${functionName}`,
141143
{
142144
cwd: tempDir,
143145
},
@@ -151,5 +153,6 @@ app.post("/deploy/:appId", async (c) => {
151153
success: true,
152154
appId,
153155
endpoint: endpointUrl,
156+
buildLog: deployResult.stdout,
154157
});
155158
});

0 commit comments

Comments
 (0)