Skip to content

Commit

Permalink
Merge pull request #186 from krausvo1/resolve_version_placeholder
Browse files Browse the repository at this point in the history
Fix missing replacement of version placeholder in UI index file.
  • Loading branch information
pavelhoral authored Apr 5, 2024
2 parents db7f2b6 + 67db6b3 commit 05aa345
Show file tree
Hide file tree
Showing 4 changed files with 291 additions and 157 deletions.
16 changes: 16 additions & 0 deletions openidm-ui/openidm-ui-common/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const {
useLocalResources
} = require("@wrensecurity/commons-ui-build");
const gulp = require("gulp");
const replace = require("gulp-replace");
const argv = require("yargs").argv;

const TARGET_PATH = "target/www";

Expand All @@ -27,10 +29,24 @@ gulp.task("build:assets", useLocalResources({ "src/main/resources/**": "" }, { d

gulp.task("build:scripts", useLocalResources({ "src/main/js/**/*.js": "" }, { dest: TARGET_PATH }));

/**
* Include the version of Wren:IDM in the index file.
*
* This is needed to force the browser to refetch JavaScript files when a new version of Wren:IDM is deployed.
*/
gulp.task("build:version", () => (
gulp.src(`${TARGET_PATH}/index.html`)
.pipe(replace("${version}", argv["target-version"] || "dev"))
.pipe(gulp.dest(TARGET_PATH))
));

gulp.task("build", gulp.series(
gulp.parallel(
"build:assets",
"build:scripts"
),
gulp.parallel(
"build:version"
)
));

Expand Down
Loading

0 comments on commit 05aa345

Please sign in to comment.