Skip to content

Commit

Permalink
[continuous-deploy-fingerprint] Support EXPO_STAGING env variable (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
wschurman authored Sep 20, 2024
1 parent 4b7860b commit 58d3e4c
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 46 deletions.
9 changes: 3 additions & 6 deletions build/command/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions build/continuous-deploy-fingerprint/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions build/preview-build/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions build/preview-comment/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions build/preview/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions build/setup/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion src/eas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ export function getUpdateGroupQr({
url.searchParams.append('appScheme', appSlug.replace(/[^A-Za-z0-9+\-.]/g, ''));
}

if (process.env.EXPO_STAGING) {
url.searchParams.append('host', 'staging-u.expo.dev');
}

url.searchParams.append('projectId', projectId);
url.searchParams.append('groupId', updateGroupId);

Expand All @@ -104,5 +108,6 @@ export function getUpdateGroupWebsite({
projectId: string;
updateGroupId: string;
}): string {
return `https://expo.dev/projects/${projectId}/updates/${updateGroupId}`;
const baseUrl = process.env.EXPO_STAGING ? 'staging.expo.dev' : 'expo.dev';
return `https://${baseUrl}/projects/${projectId}/updates/${updateGroupId}`;
}
10 changes: 3 additions & 7 deletions src/expo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,9 @@ export function projectDeepLink(project: ProjectInfo, channel?: string): string
}

export function getBuildLogsUrl(build: BuildInfo): string {
// TODO: reuse this function from the original source
// see: https://github.com/expo/eas-cli/blob/896f7f038582347c57dc700be9ea7d092b5a3a21/packages/eas-cli/src/build/utils/url.ts#L13-L21
const { project } = build;
const path = project
? `/accounts/${project.ownerAccount.name}/projects/${project.slug}/builds/${build.id}`
: `/builds/${build.id}`;

const url = new URL(path, 'https://expo.dev');
const path = `/accounts/${project.ownerAccount.name}/projects/${project.slug}/builds/${build.id}`;
const baseUrl = process.env.EXPO_STAGING ? 'staging.expo.dev' : 'expo.dev';
const url = new URL(path, `https://${baseUrl}`);
return url.toString();
}

0 comments on commit 58d3e4c

Please sign in to comment.