Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/multitenant-deploys/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /app

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

# Copy package files and install dependencies
COPY package.json yarn.lock ./
Expand Down
3 changes: 2 additions & 1 deletion examples/multitenant-deploys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ yarn test
{
"success": true,
"appId": "your-app-id",
"endpoint": "https://your-app-id.example.com"
"endpoint": "https://your-app-id.example.com",
"buildOutput": "..." // Output logs from build command
}
```

Expand Down
1 change: 0 additions & 1 deletion examples/multitenant-deploys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
},
"dependencies": {
"@hono/node-server": "^1.7.0",
"@rivet-gg/api-full": "workspace:*",
"axios": "^1.6.7",
"hono": "^4.0.5",
"temp": "^0.9.4"
Expand Down
11 changes: 6 additions & 5 deletions examples/multitenant-deploys/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { promisify } from "node:util";
import * as fs from "node:fs/promises";
import * as path from "node:path";
import temp from "temp";
import { RivetClient } from "@rivet-gg/api-full";

const execAsync = promisify(exec);

Expand All @@ -22,8 +21,6 @@ if (!RIVET_CLOUD_TOKEN || !RIVET_PROJECT || !RIVET_ENVIRONMENT) {
);
}

export const rivet = new RivetClient({ token: RIVET_CLOUD_TOKEN });

export const app = new Hono();

app.onError((err, c) => {
Expand Down Expand Up @@ -102,7 +99,10 @@ app.post("/deploy/:appId", async (c) => {
functions: {
[functionName]: {
build_path: "./project/",
dockerfile: "./project/Dockerfile",
dockerfile: "./Dockerfile",
unstable: {
build_method: "remote"
},
build_args: {
// See MY_ENV_VAR build args in Dockerfile
MY_ENV_VAR: "custom env var",
Expand Down Expand Up @@ -137,7 +137,7 @@ app.post("/deploy/:appId", async (c) => {

// Get the function endpoint
const endpointResult = await execAsync(
`rivet function endpoint --environment prod ${functionName}`,
`rivet function endpoint --environment ${RIVET_ENVIRONMENT} ${functionName}`,
{
cwd: tempDir,
},
Expand All @@ -151,5 +151,6 @@ app.post("/deploy/:appId", async (c) => {
success: true,
appId,
endpoint: endpointUrl,
buildOutput: deployResult.stdout,
});
});
Loading