@@ -11,8 +11,9 @@ import { cpus } from 'os'
11
11
import pLimit from 'p-limit'
12
12
import { setNextVersionInFixture } from './next-version-helpers.mjs'
13
13
14
- // This is the netlify testing application
15
- export const SITE_ID = process . env . NETLIFY_SITE_ID ?? 'ee859ce9-44a7-46be-830b-ead85e445e53'
14
+ // https://app.netlify.com/sites/next-runtime-testing
15
+ const DEFAULT_SITE_ID = 'ee859ce9-44a7-46be-830b-ead85e445e53'
16
+ export const SITE_ID = process . env . NETLIFY_SITE_ID ?? DEFAULT_SITE_ID
16
17
const NEXT_VERSION = process . env . NEXT_VERSION || 'latest'
17
18
18
19
export interface DeployResult {
@@ -39,6 +40,10 @@ interface E2EConfig {
39
40
* Some fixtures might pin to non-latest CLI versions. This is used to verify the used CLI version matches expected one
40
41
*/
41
42
expectedCliVersion ?: string
43
+ /**
44
+ * Site ID to deploy to. Defaults to the `NETLIFY_SITE_ID` environment variable or a default site.
45
+ */
46
+ siteId ?: string
42
47
}
43
48
44
49
/**
@@ -258,12 +263,12 @@ async function verifyFixture(isolatedFixtureRoot: string, { expectedCliVersion }
258
263
259
264
async function deploySite (
260
265
isolatedFixtureRoot : string ,
261
- { packagePath, cwd = '' } : E2EConfig ,
266
+ { packagePath, cwd = '' , siteId = SITE_ID } : E2EConfig ,
262
267
) : Promise < DeployResult > {
263
268
console . log ( `🚀 Building and deploying site...` )
264
269
265
270
const outputFile = 'deploy-output.txt'
266
- let cmd = `npx ntl deploy --build --site ${ SITE_ID } `
271
+ let cmd = `npx ntl deploy --build --site ${ siteId } `
267
272
268
273
if ( packagePath ) {
269
274
cmd += ` --filter ${ packagePath } `
@@ -273,7 +278,7 @@ async function deploySite(
273
278
await execaCommand ( cmd , { cwd : siteDir , all : true } ) . pipeAll ?.( join ( siteDir , outputFile ) )
274
279
const output = await readFile ( join ( siteDir , outputFile ) , 'utf-8' )
275
280
276
- const [ url ] = new RegExp ( / h t t p s : .+ r u n t i m e - t e s t i n g \. n e t l i f y \. a p p / gm) . exec ( output ) || [ ]
281
+ const [ url ] = new RegExp ( / h t t p s : .+ \. n e t l i f y \. a p p / gm) . exec ( output ) || [ ]
277
282
if ( ! url ) {
278
283
throw new Error ( 'Could not extract the URL from the build logs' )
279
284
}
0 commit comments