Skip to content

Commit

Permalink
#15 build docker image in pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
stoerti committed Aug 19, 2024
1 parent 7147dd1 commit 097d35a
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build-gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ jobs:
java-version: '17'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build
- name: Build Frontend
run: ./gradlew frontend:appNpmBuild
- name: Build Backend
run: ./gradlew build -x test
- name: Test
run: ./gradlew test jacocoTestReport
- name: Build Image
run: ./gradlew jibDockerBuild
- name: Test Results
uses: dorny/test-reporter@v1
if: always()
Expand Down Expand Up @@ -50,4 +54,4 @@ jobs:
with:
name: code-coverage-report-markdown
path: '*/coverage-results.md'
retention-days: 1
retention-days: 1
5 changes: 5 additions & 0 deletions backend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ dependencies {
}

tasks.withType<KotlinCompile> {
dependsOn(":frontend:appNpmBuild")
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
Expand Down Expand Up @@ -97,6 +98,10 @@ jib {
architecture = "arm64"
os = "linux"
}
platform {
architecture = "amd64"
os = "linux"
}
}
}
to {
Expand Down
34 changes: 34 additions & 0 deletions frontend/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import com.moowork.gradle.node.npm.NpmTask


plugins {
id("com.github.node-gradle.node") version "2.2.2"
//id("com.github.node-gradle.node") version "7.0.2"
}

group = "org.quizmania"
version = "0.0.1-SNAPSHOT"

tasks.register<NpmTask>("appNpmInstall") {
description = "Installs all dependencies from package.json"
workingDir = file("${project.projectDir}/src/main/webapp")
args = listOf("install")
}


tasks.register<NpmTask>("appNpmBuild") {
dependsOn("appNpmInstall")
description = "Builds project"
workingDir = file("${project.projectDir}/src/main/webapp")
args = listOf("run", "build")
}

node {
download = true
version = "20.16.0"
npmVersion = "10.8.2"
// Set the work directory for unpacking node
workDir = file("${project.buildDir}/nodejs")
// Set the work directory for NPM
npmWorkDir = file("${project.buildDir}/npm")
}
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
rootProject.name = "quizmania"

include(":backend")
include(":frontend")

0 comments on commit 097d35a

Please sign in to comment.