Integrate with ci and registry
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/tag/push-image Pipeline was successful

This commit is contained in:
Ryan Harg 2024-11-21 11:49:50 +01:00
parent 09537c721c
commit 9e0ddfa4ba
3 changed files with 77 additions and 2 deletions

25
.woodpecker/build.yml Normal file
View file

@ -0,0 +1,25 @@
when:
- event: push
steps:
- name: build
image: eclipse-temurin:17-jdk-alpine
commands:
- ./gradlew clean build
- name: notify
image: deblan/woodpecker-email
settings:
debug: true
dsn:
from_secret: smtp_url
from:
address:
from_secret: email_sender
name: "Woodpecker CI"
recipients_only: true
recipients:
from_secret: email_recipient
when:
status:
- failure

View file

@ -0,0 +1,30 @@
when:
- event: tag
steps:
- name: push-image
image: eclipse-temurin:17-jdk-alpine
environment:
REGISTRY_USERNAME:
from_secret: registry_username
REGISTRY_PASSWORD:
from_secret: registry_password
commands:
- ./gradlew jib -Papp.version=${CI_COMMIT_TAG} -Pdocker.repo.username=$${REGISTRY_USERNAME} -Pdocker.repo.password=$${REGISTRY_PASSWORD}
- name: notify
image: deblan/woodpecker-email
settings:
debug: true
dsn:
from_secret: smtp_url
from:
address:
from_secret: email_sender
name: "Woodpecker CI"
recipients_only: true
recipients:
from_secret: email_recipient
when:
status:
- failure

View file

@ -8,7 +8,13 @@ plugins {
// Apply the application plugin to add support for building a CLI application in Java. // Apply the application plugin to add support for building a CLI application in Java.
application application
id("com.google.cloud.tools.jib") version "3.4.3" id("com.google.cloud.tools.jib") version "3.4.4"
}
project.version = if (project.hasProperty("app.version")) {
project.property("app.version").toString()
} else {
"0.0.1-SNAPSHOT"
} }
repositories { repositories {
@ -20,7 +26,21 @@ repositories {
} }
jib { jib {
to.image = "github-release-bot" to {
image = "registry.azw27.de/github-release-bot/github-release-bot"
tags = if (project.hasProperty("app.version")) {
setOf("v" + project.property("app.version").toString())
} else {
setOf("dev-snapshot")
}
auth {
username = if (project.hasProperty("docker.repo.username"))
project.property("docker.repo.username").toString() else ""
password = if (project.hasProperty("docker.repo.password"))
project.property("docker.repo.password").toString() else ""
}
}
container.creationTime.set(DateTimeFormatter.ISO_DATE_TIME.format(Instant.now().atZone(ZoneId.of("UTC")))) container.creationTime.set(DateTimeFormatter.ISO_DATE_TIME.format(Instant.now().atZone(ZoneId.of("UTC"))))
val buildDir = layout.buildDirectory.get() val buildDir = layout.buildDirectory.get()