Skip to content

Commit 7e91e8c

Browse files
committed
KTL-4149 fixup: build landing page
1 parent d222fca commit 7e91e8c

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

.teamcity/landings/builds/BuildLandingPage.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import jetbrains.buildServer.configs.kotlin.triggers.vcs
77
import landings.LandingConfiguration
88
import common.sanitizeId
99
import landings.createVcsRootForLanding
10+
import vcsRoots.KotlinLangOrg
1011

1112
/**
1213
* Build type for building a Vite landing page.
@@ -57,7 +58,7 @@ class BuildLandingPage(private val config: LandingConfiguration) : BuildType({
5758
node kotlin-web-site-scripts/patch-vite-base.mjs ${config.name}
5859
5960
# Install dependencies
60-
npm ci
61+
npm i
6162
6263
# Build
6364
npm run build

.teamcity/landings/builds/DeployLandingToProduction.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ class DeployLandingToProduction(private val config: LandingConfiguration) : Buil
1818

1919
type = Type.DEPLOYMENT
2020

21+
params {
22+
param("LANDING_NAME", config.name)
23+
}
24+
2125
requirements {
2226
contains("docker.server.osType", "linux")
2327
}

.teamcity/landings/builds/DeployLandingToStaging.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ class DeployLandingToStaging(private val config: LandingConfiguration) : BuildTy
1717

1818
type = Type.DEPLOYMENT
1919

20+
params {
21+
param("LANDING_NAME", config.name)
22+
}
23+
2024
requirements {
2125
contains("docker.server.osType", "linux")
2226
}

scripts/patch-vite-base.mjs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,25 @@ writeFileSync(viteConfigPath, content, 'utf-8');
5353

5454
console.log(`Successfully patched ${viteConfigPath} with base: '${basePath}'`);
5555

56+
// Patch BrowserRouter basename
57+
const appFile = 'src/App.tsx';
58+
59+
if (existsSync(appFile)) {
60+
console.log(`Checking ${appFile} for BrowserRouter...`);
61+
let sourceContent = readFileSync(appFile, 'utf-8');
62+
63+
if (sourceContent.includes('BrowserRouter')) {
64+
console.log(`Found BrowserRouter in ${appFile}, patching...`);
65+
sourceContent = sourceContent.replace(
66+
/<BrowserRouter\s*>/g,
67+
`<BrowserRouter basename="${basePath}">`
68+
);
69+
writeFileSync(appFile, sourceContent, 'utf-8');
70+
console.log(`Successfully patched BrowserRouter in ${appFile} with basename: '${basePath}'`);
71+
} else {
72+
console.log('Note: No BrowserRouter found in App.tsx');
73+
}
74+
} else {
75+
console.log('Note: src/App.tsx not found');
76+
}
77+

0 commit comments

Comments
 (0)