Skip to content

Commit

Permalink
ci(core): assemble before build the docker image
Browse files Browse the repository at this point in the history
- support for www frontend build
  • Loading branch information
yacosta738 committed Dec 29, 2023
1 parent 37d858b commit 8413d4d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export default defineConfig({
srcDir: './src/main/webapp/src',
publicDir: './src/main/webapp/public',
root: './src/main/webapp',
outDir: './build/resources/main/static',
outDir: './build/www',
integrations: [tailwind()]
});
18 changes: 18 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.nio.file.Files
import kotlin.io.path.Path
import org.siouan.frontendgradleplugin.infrastructure.gradle.InstallFrontendTask
import org.springframework.boot.gradle.tasks.bundling.BootJar

plugins {
id("org.springframework.boot") version "3.2.1"
Expand Down Expand Up @@ -71,6 +72,23 @@ tasks.named<InstallFrontendTask>("installFrontend") {
outputs.dir("${projectDir}/node_modules").withPropertyName("nodeModulesDirectory")
}

tasks.register<Copy>("processFrontendResources") {
val frontendBuildDir = "${layout.buildDirectory.get()}/www"
val frontendResourcesDir = "${layout.buildDirectory.get()}/resources/main/static"

group = "Frontend"
description = "Process frontend resources"
dependsOn(":assembleFrontend")

from(frontendBuildDir)
into(frontendResourcesDir)
}

tasks.named<Task>("processResources") {
dependsOn("processFrontendResources")
}


tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "astro preview",
"astro": "astro",
"check": "astro check",
"clean": "echo Cleaning frontend",
"clean": "rm -rf dist && rm -rf .astro && rm -rf ./build/www",
"lint": "echo Linting frontend",
"test": "echo Testing frontend"
},
Expand Down

0 comments on commit 8413d4d

Please sign in to comment.