Enabled deployment
continuous-integration/drone/push Build encountered an error Details

This commit is contained in:
Jim Martens 2023-08-15 00:13:28 +02:00
parent 28b1484459
commit fc46987bb8
6 changed files with 105 additions and 0 deletions

View File

@ -1,3 +1,4 @@
---
kind: pipeline
name: default
type: docker
@ -33,3 +34,38 @@ trigger:
- pull_request
- custom
---
kind: pipeline
name: default
type: docker
platform:
os: linux
arch: arm64
clone:
skip_verify: true
steps:
- name: build Docker container
image: gradle:8.2-jdk17
volumes:
- name: cache
path: /home/gradle/.gradle
commands:
- wget https://github.com/docker/docker-credential-helpers/releases/download/v0.8.0/docker-credential-pass-v0.8.0.linux-arm64
- mv docker-credential-pass-v0.8.0.linux-arm64 docker-credential-pass
- chmod +x ./docker-credentials-pass
- gradlew jib
volumes:
- name: cache
host:
path: /var/lib/drone/cache/.gradle
trigger:
event:
include:
- push
- custom

View File

@ -15,4 +15,5 @@ dependencies {
implementation(libs.plugin.nebula.release)
implementation(libs.plugin.gradle.versions)
implementation(libs.plugin.version.catalog)
implementation(libs.plugin.jib)
}

View File

@ -0,0 +1,21 @@
plugins {
id("com.google.cloud.tools.jib")
id("twomartens.java-base")
}
tasks.named("jib") {
dependsOn("build")
}
tasks.named("jibDockerBuild") {
dependsOn("build")
}
tasks.named("build") {
dependsOn("cleanCache")
}
tasks.register("cleanCache") {
delete("${buildDir}/jib-cache")
delete("${buildDir}/libs")
}

View File

@ -22,6 +22,7 @@ plugin-lombok = "8.0.1"
plugin-gradle-versions = "0.46.0"
plugin-version-catalog = "0.8.0"
plugin-kotlin-gradle = "1.9.0"
plugin-jib = "3.3.1"
[libraries]
spring-boot = { module = "org.springframework.boot:spring-boot-dependencies", version.ref = "spring-boot" }
@ -37,6 +38,8 @@ spring-boot-oauth2-resource-server = { module = "org.springframework.boot:spring
spring-boot-config = { module = "org.springframework.boot:spring-boot-configuration-processor", version.ref = "spring-boot" }
spring-cloud = { module = "org.springframework.cloud:spring-cloud-dependencies", version.ref = "spring-cloud" }
spring-cloud-starter = { module = "org.springframework.cloud:spring-cloud-starter" }
spring-cloud-starter-config = { module = "org.springframework.cloud:spring-cloud-starter-config" }
spring-cloud-config-server = { module = "org.springframework.cloud:spring-cloud-config-server" }
spring-boot-starter = { module = "org.springframework.boot:spring-boot-starter" }
spring-grpc = { module = "net.devh:grpc-spring-boot-starter", version.ref = "spring-grpc" }
spring-ui = { module = "org.springdoc:springdoc-openapi-starter-webmvc-ui", version.ref = "spring-doc" }
@ -80,6 +83,7 @@ plugin-lombok = { module = "io.freefair.gradle:lombok-plugin", version.ref = "pl
plugin-gradle-versions = { module = "com.github.ben-manes:gradle-versions-plugin", version.ref = "plugin-gradle-versions" }
plugin-version-catalog = { module = "nl.littlerobots.vcu:plugin", version.ref = "plugin-version-catalog" }
plugin-kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "plugin-kotlin-gradle" }
plugin-jib = { module = "com.google.cloud.tools:jib-gradle-plugin", version.ref = "plugin-jib" }
[bundles]
logging = [

View File

@ -0,0 +1,42 @@
plugins {
id("twomartens.jib")
}
dependencies {
implementation(project(":server"))
}
val dockerUsername = System.getenv("DOCKER_USERNAME") ?: "UNKNOWN"
val dockerPassword = System.getenv("DOCKER_PASSWORD") ?: "UNKNOWN"
jib {
from {
image = "amazoncorretto:" + properties["projectSourceCompatibility"]
platforms {
platform {
architecture = "amd64"
os = "linux"
}
platform {
architecture = "arm64"
os = "linux"
}
}
}
to {
image = "2martens/wahlrecht"
tags = setOf(
"latest",
properties["version"].toString().replace("+", "-"))
credHelper {
helper = "pass"
}
}
container {
extraClasspath = listOf("/configmap")
mainClass = "de.twomartens.wahlrecht.MainApplication"
jvmFlags = listOf("-XX:+UseContainerSupport",
"-XX:MaxRAMPercentage=75.0",
"-Dlog4j.configurationFile=/configmap/log4j2.xml")
}
}

View File

@ -2,6 +2,7 @@ val projectname: String = providers.gradleProperty("projectname").get()
rootProject.name = projectname
include("server")
include("deploy")
for (subproject in rootProject.children) {
subproject.projectDir = file("module-" + subproject.name)