Compare commits
29 Commits
v21
...
27db87792d
| Author | SHA1 | Date | |
|---|---|---|---|
|
27db87792d
|
|||
|
0af399275d
|
|||
|
7b707e5bb5
|
|||
|
634ae4365f
|
|||
|
49008be24a
|
|||
|
eca68b7bbf
|
|||
|
d0b5b92fc7
|
|||
|
4386dc4449
|
|||
|
32c7719942
|
|||
|
950ab8c568
|
|||
|
73043da77c
|
|||
|
30d6252992
|
|||
|
66ccf4b263
|
|||
|
5cc6bd6305
|
|||
|
c42313e022
|
|||
|
ac439261f0
|
|||
|
be19d2881e
|
|||
|
71bc53488d
|
|||
|
89db72a316
|
|||
|
06e72a794f
|
|||
|
ea45ef73f4
|
|||
|
ef9c56f6c9
|
|||
|
718f3e4a51
|
|||
|
9cb1bab118
|
|||
|
90dbeecdca
|
|||
|
b6545e2f62
|
|||
|
c1ca25ea24
|
|||
|
046124464e
|
|||
|
2eab631796
|
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>nbs-cloud-aggregator</artifactId>
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
<version>21</version>
|
||||
<version>26-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
|
||||
13
build/Dockerfile
Normal file
13
build/Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
||||
FROM eclipse-temurin:25-jre-alpine
|
||||
|
||||
# Create a non-root user for security
|
||||
RUN addgroup -S spring && adduser -S spring -G spring
|
||||
USER spring:spring
|
||||
|
||||
ARG JAR_FILE
|
||||
|
||||
COPY ${JAR_FILE} app.jar
|
||||
|
||||
EXPOSE 8082
|
||||
|
||||
ENTRYPOINT ["java", "-jar", "/app.jar"]
|
||||
85
build/Jenkinsfile
vendored
Normal file
85
build/Jenkinsfile
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
pipeline {
|
||||
agent { label 'docker' }
|
||||
|
||||
parameters {
|
||||
booleanParam(name: 'DRY_RUN', defaultValue: true, description: 'If checked, no code will be pushed to Gitea, Reposilite, or Docker.')
|
||||
}
|
||||
|
||||
environment {
|
||||
REPO_URL = credentials('reposilite-url')
|
||||
DOCKER_REGISTRY = credentials('docker-registry-url')
|
||||
GIT_URL_CLEAN = sh(script: "echo ${GIT_URL} | sed 's|https://||'", returnStdout: true).trim()
|
||||
IS_DRY_RUN = "${params.DRY_RUN}"
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Version & Tag') {
|
||||
steps {
|
||||
withCredentials([usernamePassword(credentialsId: 'Jenkins_Gitea',
|
||||
usernameVariable: 'GITEA_CREDS_USR',
|
||||
passwordVariable: 'GITEA_CREDS_PSW'),
|
||||
file(credentialsId: 'jenkins-gpg-key', variable: 'GPG_KEY_FILE')]) {
|
||||
sh '''
|
||||
gpg --batch --import "${GPG_KEY_FILE}"
|
||||
KEY_ID=$(gpg --list-keys --with-colons | awk -F: '/^pub:/ { print $5; exit }')
|
||||
|
||||
git config user.email "jenkins@77zzcx7.de"
|
||||
git config user.name "Jenkins"
|
||||
git config user.signingkey "$KEY_ID"
|
||||
git config commit.gpgsign true
|
||||
git config tag.gpgSign true
|
||||
|
||||
// We need to pass the repo url in -Darguments again because of insane maven lifecycle forking
|
||||
pkgx mvn release:prepare -B \
|
||||
-s build/settings.xml \
|
||||
-Dpassword="${GITEA_CREDS_PSW}" \
|
||||
-Dusername="${GITEA_CREDS_USR}" \
|
||||
-DdryRun=${IS_DRY_RUN} \
|
||||
-Drepository.url=${REPO_URL} \
|
||||
-DtagNameFormat="v@{project.version}" \
|
||||
-Darguments="-Drepository.url=${REPO_URL} -Dtag=v\\${project.version} -DskipTests"
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy Release') {
|
||||
steps {
|
||||
withCredentials([usernamePassword(credentialsId: 'reposilite-jenkins-cred',
|
||||
usernameVariable: 'REPO_USER',
|
||||
passwordVariable: 'REPO_TOKEN')]) {
|
||||
sh '''
|
||||
pkgx mvn release:perform -B \
|
||||
-s build/settings.xml \
|
||||
-DdryRun=${DRY_RUN} \
|
||||
-Drepository.url=${REPO_URL} \
|
||||
-Darguments="-Drepository.url=${REPO_URL} -DskipTests"
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Docker Build & Push') {
|
||||
steps {
|
||||
script {
|
||||
sh "pwd"
|
||||
sh "ls -R"
|
||||
def jarPath = sh(script: "ls target/checkout/web-container/target/*.jar | head -n 1", returnStdout: true).trim()
|
||||
def releaseVer = sh(script: "pkgx mvn help:evaluate -Dexpression=project.version -q -DforceStdout -f target/checkout/web-container/pom.xml", returnStdout: true).trim()
|
||||
|
||||
docker.withRegistry("${env.DOCKER_REGISTRY}", '') {
|
||||
def customImage = docker.build("${env.DOCKER_REGISTRY}/my-app:${releaseVer}",
|
||||
"-f build/Dockerfile --build-arg JAR_FILE=${jarPath} .")
|
||||
|
||||
if (params.DRY_RUN) {
|
||||
echo "DRY_RUN - do not push image to registry"
|
||||
}
|
||||
else {
|
||||
customImage.push("latest")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
20
build/settings.xml
Normal file
20
build/settings.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
|
||||
<servers>
|
||||
<server>
|
||||
<id>77zzcx7-releases</id>
|
||||
<username>${env.REPO_USER}</username>
|
||||
<password>${env.REPO_TOKEN}</password>
|
||||
</server>
|
||||
</servers>
|
||||
<mirrors>
|
||||
<mirror>
|
||||
<id>central</id>
|
||||
<mirrorOf>*</mirrorOf>
|
||||
<name>77zzcx7-central</name>
|
||||
<url>${env.REPO_URL}/releases</url>
|
||||
</mirror>
|
||||
</mirrors>
|
||||
</settings>
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>nbs-cloud-aggregator</artifactId>
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
<version>21</version>
|
||||
<version>26-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
<artifactId>nbs-cloud-aggregator</artifactId>
|
||||
<version>21</version>
|
||||
<version>26-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
<artifactId>nbs-cloud-aggregator</artifactId>
|
||||
<version>21</version>
|
||||
<version>26-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>nbs-cloud-aggregator</artifactId>
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
<version>21</version>
|
||||
<version>26-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>nbs-cloud-aggregator</artifactId>
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
<version>21</version>
|
||||
<version>26-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
|
||||
16
pom.xml
16
pom.xml
@@ -10,7 +10,7 @@
|
||||
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
<artifactId>nbs-cloud-aggregator</artifactId>
|
||||
<version>21</version>
|
||||
<version>26-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<description>The umbrella for all No BullShit cloud projects</description>
|
||||
<name>nbs-cloud-aggregator</name>
|
||||
@@ -31,26 +31,26 @@
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>18</java.version>
|
||||
<scmDeveloperConnectionProp />
|
||||
<repository.url>http://reposilite.intern.77zzcx7.de</repository.url>
|
||||
</properties>
|
||||
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>77zzcx7-snapshots</id>
|
||||
<url>http://192.168.10.4:8100/snapshots/</url>
|
||||
<url>${repository.url}/snapshots/</url>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>77zzcx7-releases</id>
|
||||
<url>http://192.168.10.4:8100/releases/</url>
|
||||
<url>${repository.url}/releases/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:https://77zzcx7.de/gitea/MK13/NoBullShit-cloud.git</connection>
|
||||
<developerConnection>${scmDeveloperConnectionProp}</developerConnection>
|
||||
<connection>scm:git:https://gitea.77zzcx7.de/MK13/NoBullShit-cloud.git</connection>
|
||||
<developerConnection>scm:git:https://gitea.77zzcx7.de/MK13/NoBullShit-cloud.git</developerConnection>
|
||||
<url>https://77zzcx7.de/gitea/MK13/NoBullShit-cloud</url>
|
||||
<tag>v21</tag>
|
||||
</scm>
|
||||
<tag>v22</tag>
|
||||
</scm>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>nbs-cloud-aggregator</artifactId>
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
<version>21</version>
|
||||
<version>26-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>nbs-cloud-aggregator</artifactId>
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
<version>21</version>
|
||||
<version>26-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>web-container-config</artifactId>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>nbs-cloud-aggregator</artifactId>
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
<version>21</version>
|
||||
<version>26-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>web-container-registry</artifactId>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
<artifactId>nbs-cloud-aggregator</artifactId>
|
||||
<version>21</version>
|
||||
<version>26-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
|
||||
Reference in New Issue
Block a user