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
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"trigger.dev": patch
|
||||
---
|
||||
|
||||
Add openssl to prod worker image and allow passing auth token via env var for deploy
|
||||
@@ -4,6 +4,7 @@ ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
busybox \
|
||||
dumb-init \
|
||||
openssl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create and set workdir with appropriate permissions
|
||||
|
||||
@@ -72,6 +72,33 @@ export async function login(options?: LoginOptions): Promise<LoginResult> {
|
||||
intro("Logging in to Trigger.dev");
|
||||
}
|
||||
|
||||
const accessTokenFromEnv = process.env.TRIGGER_ACCESS_TOKEN;
|
||||
|
||||
if (accessTokenFromEnv) {
|
||||
const auth = {
|
||||
accessToken: accessTokenFromEnv,
|
||||
apiUrl: process.env.TRIGGER_API_URL ?? "https://api.trigger.dev",
|
||||
};
|
||||
const apiClient = new CliApiClient(auth.apiUrl, auth.accessToken);
|
||||
const userData = await apiClient.whoAmI();
|
||||
|
||||
if (!userData.success) {
|
||||
throw new Error(userData.error);
|
||||
}
|
||||
|
||||
return {
|
||||
ok: true as const,
|
||||
profile: options?.profile ?? "default",
|
||||
userId: userData.data.userId,
|
||||
email: userData.data.email,
|
||||
dashboardUrl: userData.data.dashboardUrl,
|
||||
auth: {
|
||||
accessToken: auth.accessToken,
|
||||
apiUrl: auth.apiUrl,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
const authConfig = readAuthConfigProfile(options?.profile);
|
||||
|
||||
if (authConfig && authConfig.accessToken) {
|
||||
|
||||
Reference in New Issue
Block a user