feat: sbom-generation (#3)
Co-authored-by: Richard Attermeyer <richard.attermeyer@opitz-consulting.com> Reviewed-on: https://git.192.168.1.151.nip.io:8543/fjadmin/ci-demo-2/pulls/3pull/1/head
parent
a8bd947530
commit
22a3f74737
|
|
@ -1,6 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="JpaBuddyIdeaProjectConfig">
|
<component name="JpaBuddyIdeaProjectConfig">
|
||||||
|
<option name="defaultUnitInitialized" value="true" />
|
||||||
<option name="renamerInitialized" value="true" />
|
<option name="renamerInitialized" value="true" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="FrameworkDetectionExcludesConfiguration">
|
||||||
|
<file type="web" url="file://$PROJECT_DIR$" />
|
||||||
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" project-jdk-name="19" project-jdk-type="JavaSDK" />
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" project-jdk-name="19" project-jdk-type="JavaSDK" />
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
<option name="id" value="jpab" />
|
<option name="id" value="jpab" />
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Enable auto-env through the sdkman_auto_env config
|
||||||
|
# Add key=value pairs of SDKs to use below
|
||||||
|
java=17.0.8-tem
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
---
|
---
|
||||||
|
variables:
|
||||||
|
- &java_image "gradle:8.4.0-jdk17"
|
||||||
when:
|
when:
|
||||||
path: "app/**"
|
path: "app/**"
|
||||||
clone:
|
clone:
|
||||||
|
|
@ -9,7 +11,7 @@ clone:
|
||||||
steps:
|
steps:
|
||||||
"lint:style":
|
"lint:style":
|
||||||
group: lint
|
group: lint
|
||||||
image: gradle:8.4.0-jdk17
|
image: *java_image
|
||||||
commands:
|
commands:
|
||||||
- gradle spotlessCheck --no-daemon
|
- gradle spotlessCheck --no-daemon
|
||||||
"lint:hadolint":
|
"lint:hadolint":
|
||||||
|
|
@ -19,8 +21,12 @@ steps:
|
||||||
- hadolint --version
|
- hadolint --version
|
||||||
"build:java":
|
"build:java":
|
||||||
group: build
|
group: build
|
||||||
image: gradle:8.4.0-jdk17
|
image: *java_image
|
||||||
commands:
|
commands:
|
||||||
- ./gradlew build
|
- ./gradlew build
|
||||||
|
"analyze:sbom":
|
||||||
|
image: *java_image
|
||||||
|
commands:
|
||||||
|
- ./gradlew cyclonedxBom
|
||||||
depends_on:
|
depends_on:
|
||||||
- "lint_general"
|
- "lint_general"
|
||||||
|
|
|
||||||
|
|
@ -14,26 +14,39 @@ steps:
|
||||||
commands:
|
commands:
|
||||||
- pnpm install
|
- pnpm install
|
||||||
directory: frontend
|
directory: frontend
|
||||||
|
|
||||||
"lint:style":
|
"lint:style":
|
||||||
image: *frontend_image
|
image: *frontend_image
|
||||||
commands:
|
commands:
|
||||||
- pnpm run prettier
|
- pnpm run prettier
|
||||||
directory: frontend
|
directory: frontend
|
||||||
|
|
||||||
"lint:analyze":
|
"lint:analyze":
|
||||||
image: *frontend_image
|
image: *frontend_image
|
||||||
commands:
|
commands:
|
||||||
- pnpm run lint
|
- pnpm run lint
|
||||||
directory: frontend
|
directory: frontend
|
||||||
|
|
||||||
"build:frontend":
|
"build:frontend":
|
||||||
image: *frontend_image
|
image: *frontend_image
|
||||||
commands:
|
commands:
|
||||||
- pnpm run build
|
- pnpm run build
|
||||||
directory: frontend
|
directory: frontend
|
||||||
|
|
||||||
"build:tsc":
|
"build:tsc":
|
||||||
image: *frontend_image
|
image: *frontend_image
|
||||||
commands:
|
commands:
|
||||||
- pnpm add typescript
|
- pnpm add typescript
|
||||||
- pnpm run typecheck
|
- pnpm run typecheck
|
||||||
directory: frontend
|
directory: frontend
|
||||||
|
|
||||||
|
"analyze:sbom":
|
||||||
|
image: *frontend_image
|
||||||
|
commands:
|
||||||
|
- rm -rf node_modules
|
||||||
|
- npm install
|
||||||
|
- npx @cyclonedx/cyclonedx-npm --output-file bom.json
|
||||||
|
directory: frontend
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- "lint_general"
|
- "lint_general"
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,34 @@
|
||||||
* This file was generated by the Gradle 'init' task.
|
* This file was generated by the Gradle 'init' task.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
plugins { id("com.opitzconsulting.demo.ci.java-application-conventions") }
|
plugins {
|
||||||
|
id("com.opitzconsulting.demo.ci.java-application-conventions")
|
||||||
|
id("org.springframework.boot") version "3.1.5"
|
||||||
|
id("io.spring.dependency-management") version "1.1.3"
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("org.apache.commons:commons-text")
|
implementation("org.apache.commons:commons-text")
|
||||||
implementation(project(":utilities"))
|
implementation(project(":utilities"))
|
||||||
|
implementation("org.springframework.boot:spring-boot-starter-actuator")
|
||||||
|
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||||
|
implementation("org.springframework.boot:spring-boot-starter-security")
|
||||||
|
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||||
|
implementation("org.springframework.modulith:spring-modulith-starter-core")
|
||||||
|
implementation("org.springframework.modulith:spring-modulith-starter-jpa")
|
||||||
|
runtimeOnly("org.postgresql:postgresql")
|
||||||
|
runtimeOnly("org.springframework.modulith:spring-modulith-actuator")
|
||||||
|
runtimeOnly("org.springframework.modulith:spring-modulith-observability")
|
||||||
|
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
||||||
|
testImplementation("org.springframework.boot:spring-boot-testcontainers")
|
||||||
|
testImplementation("org.springframework.modulith:spring-modulith-starter-test")
|
||||||
|
testImplementation("org.springframework.security:spring-security-test")
|
||||||
|
testImplementation("org.testcontainers:junit-jupiter")
|
||||||
|
testImplementation("org.testcontainers:postgresql")
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencyManagement {
|
||||||
|
imports { mavenBom("org.springframework.modulith:spring-modulith-bom:1.0.2") }
|
||||||
}
|
}
|
||||||
|
|
||||||
application {
|
application {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ plugins { id("com.diffplug.spotless") version "6.22.0" }
|
||||||
|
|
||||||
repositories { mavenCentral() }
|
repositories { mavenCentral() }
|
||||||
|
|
||||||
|
allprojects { version = "0.1" }
|
||||||
|
|
||||||
spotless {
|
spotless {
|
||||||
encoding("UTF-8")
|
encoding("UTF-8")
|
||||||
java {
|
java {
|
||||||
|
|
|
||||||
|
|
@ -12,3 +12,8 @@ repositories {
|
||||||
// Use the plugin portal to apply community plugins in convention plugins.
|
// Use the plugin portal to apply community plugins in convention plugins.
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
// Use the Kotlin DSL plugin API to apply plugins from the Gradle Plugin Portal.
|
||||||
|
implementation("org.cyclonedx.bom:org.cyclonedx.bom.gradle.plugin:1.7.2")
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
plugins {
|
plugins {
|
||||||
// Apply the java Plugin to add support for Java.
|
// Apply the java Plugin to add support for Java.
|
||||||
java
|
java
|
||||||
|
id("org.cyclonedx.bom")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|
@ -31,3 +32,15 @@ tasks.named<Test>("test") {
|
||||||
// Use JUnit Platform for unit tests.
|
// Use JUnit Platform for unit tests.
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.cyclonedxBom {
|
||||||
|
setIncludeConfigs(listOf("runtimeClasspath"))
|
||||||
|
setSkipConfigs(listOf("compileClasspath", "testCompileClasspath"))
|
||||||
|
setProjectType("application")
|
||||||
|
setSchemaVersion("1.5")
|
||||||
|
setDestination(project.file("build/reports"))
|
||||||
|
setOutputName("bom")
|
||||||
|
setOutputFormat("json")
|
||||||
|
setIncludeBomSerialNumber(false)
|
||||||
|
setComponentVersion("2.0.0")
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
# Ignore artifacts:
|
# Ignore artifacts:
|
||||||
build
|
build
|
||||||
coverage
|
coverage
|
||||||
|
pnpm-lock.yaml
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
From your terminal:
|
From your terminal:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm run dev
|
pnpm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
This starts your app in development mode, rebuilding assets on file changes.
|
This starts your app in development mode, rebuilding assets on file changes.
|
||||||
|
|
@ -17,13 +17,13 @@ This starts your app in development mode, rebuilding assets on file changes.
|
||||||
First, build your app for production:
|
First, build your app for production:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm run build
|
pnpm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
Then run the app in production mode:
|
Then run the app in production mode:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm start
|
pnpm start
|
||||||
```
|
```
|
||||||
|
|
||||||
Now you'll need to pick a host to deploy it to.
|
Now you'll need to pick a host to deploy it to.
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1 @@
|
||||||
|
org.gradle.caching=true
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"devDependencies": {
|
||||||
|
"@commitlint/config-conventional": "^18.1.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
lockfileVersion: '6.0'
|
||||||
|
|
||||||
|
settings:
|
||||||
|
autoInstallPeers: true
|
||||||
|
excludeLinksFromLockfile: false
|
||||||
|
|
||||||
|
devDependencies:
|
||||||
|
'@commitlint/config-conventional':
|
||||||
|
specifier: ^18.1.0
|
||||||
|
version: 18.1.0
|
||||||
|
|
||||||
|
packages:
|
||||||
|
|
||||||
|
/@commitlint/config-conventional@18.1.0:
|
||||||
|
resolution: {integrity: sha512-8vvvtV3GOLEMHeKc8PjRL1lfP1Y4B6BG0WroFd9PJeRiOc3nFX1J0wlJenLURzl9Qus6YXVGWf+a/ZlbCKT3AA==}
|
||||||
|
engines: {node: '>=v18'}
|
||||||
|
dependencies:
|
||||||
|
conventional-changelog-conventionalcommits: 7.0.2
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/array-ify@1.0.0:
|
||||||
|
resolution: {integrity: sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==}
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/compare-func@2.0.0:
|
||||||
|
resolution: {integrity: sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==}
|
||||||
|
dependencies:
|
||||||
|
array-ify: 1.0.0
|
||||||
|
dot-prop: 5.3.0
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/conventional-changelog-conventionalcommits@7.0.2:
|
||||||
|
resolution: {integrity: sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==}
|
||||||
|
engines: {node: '>=16'}
|
||||||
|
dependencies:
|
||||||
|
compare-func: 2.0.0
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/dot-prop@5.3.0:
|
||||||
|
resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==}
|
||||||
|
engines: {node: '>=8'}
|
||||||
|
dependencies:
|
||||||
|
is-obj: 2.0.0
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/is-obj@2.0.0:
|
||||||
|
resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==}
|
||||||
|
engines: {node: '>=8'}
|
||||||
|
dev: true
|
||||||
Loading…
Reference in New Issue