Skip to content

Commit 1c24348

Browse files
authored
v3: add openssl to prod image and fix deploy command auth via env var (#1011)
* add openssl to prod worker * make deploy command accept auth token via env var
1 parent f854cb9 commit 1c24348

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

.changeset/rare-roses-float.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
Add openssl to prod worker image and allow passing auth token via env var for deploy

packages/cli-v3/src/Containerfile.prod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ ENV DEBIAN_FRONTEND=noninteractive
44
RUN apt-get update && apt-get install -y --no-install-recommends \
55
busybox \
66
dumb-init \
7+
openssl \
78
&& rm -rf /var/lib/apt/lists/*
89

910
# Create and set workdir with appropriate permissions

packages/cli-v3/src/commands/login.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,33 @@ export async function login(options?: LoginOptions): Promise<LoginResult> {
7272
intro("Logging in to Trigger.dev");
7373
}
7474

75+
const accessTokenFromEnv = process.env.TRIGGER_ACCESS_TOKEN;
76+
77+
if (accessTokenFromEnv) {
78+
const auth = {
79+
accessToken: accessTokenFromEnv,
80+
apiUrl: process.env.TRIGGER_API_URL ?? "https://api.trigger.dev",
81+
};
82+
const apiClient = new CliApiClient(auth.apiUrl, auth.accessToken);
83+
const userData = await apiClient.whoAmI();
84+
85+
if (!userData.success) {
86+
throw new Error(userData.error);
87+
}
88+
89+
return {
90+
ok: true as const,
91+
profile: options?.profile ?? "default",
92+
userId: userData.data.userId,
93+
email: userData.data.email,
94+
dashboardUrl: userData.data.dashboardUrl,
95+
auth: {
96+
accessToken: auth.accessToken,
97+
apiUrl: auth.apiUrl,
98+
},
99+
};
100+
}
101+
75102
const authConfig = readAuthConfigProfile(options?.profile);
76103

77104
if (authConfig && authConfig.accessToken) {

0 commit comments

Comments
 (0)