11package documentation.builds
22
3+ import jetbrains.buildServer.configs.kotlin.ArtifactDependency
34import jetbrains.buildServer.configs.kotlin.BuildType
5+ import jetbrains.buildServer.configs.kotlin.buildSteps.ScriptBuildStep
46import jetbrains.buildServer.configs.kotlin.buildSteps.script
57import kotlinlang.builds.BuildWebHelpFrontend
68
@@ -11,6 +13,7 @@ abstract class WritersideBuilder(
1113): BuildType({
1214 val dockerImageTag = " 2025.07.8502"
1315 val frontend = " file:///opt/static/"
16+ val output_dir = " /opt/sources/artifacts"
1417
1518 name = " ${instance.uppercase()} documentation build"
1619 description = " Build $module /$instance documentation with the docker"
@@ -34,9 +37,31 @@ abstract class WritersideBuilder(
3437 -e MODULE_INSTANCE=$module /$instance
3538 -e RUNNER=teamcity
3639 -e FRONTEND=$frontend
37- -e OUTPUT_DIR=/opt/sources/artifacts
40+ -e OUTPUT_DIR=$output_dir
3841 """ .trimIndent()
3942 }
43+ script {
44+ name = " Post processing files"
45+ workingDir = " artifacts"
46+ // language=bash
47+ scriptContent = """
48+ #!/bin/bash
49+ set -ex
50+
51+ export ASSET_HASH="%dep.${BuildWebHelpFrontend .id ? : throw RuntimeException (" BuildWebHelpFrontend.id must not be null" )} .build.number%"
52+
53+ echo "Iterate over html files"
54+ html_files=$(find . -type f -name '*.html')
55+ for file in ${' $' } html_files; do
56+ echo "Processing ${' $' } file"
57+ echo "Fix assets hash ${' $' } ASSET_HASH"
58+ sed -E "s/(custom-frontend-app\/[^\"^']+\.(js|css))([\"\'])/\1?${' $' } ASSET_HASH\3/g" "${' $' } file"
59+ done
60+ """ .trimIndent()
61+
62+ dockerImagePlatform = ScriptBuildStep .ImagePlatform .Linux
63+ dockerImage = " alpine:latest"
64+ }
4065 }
4166
4267 requirements {
0 commit comments