Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
c56d0f6
Update deploy.yml
m1k3dcdc Sep 24, 2025
9fa6f7f
Update openshift-build.yml
m1k3dcdc Sep 24, 2025
e01adf5
Update Jenkinsfile
m1k3dcdc Sep 25, 2025
a0361d8
Update Dockerfile
m1k3dcdc Sep 25, 2025
2b1448d
Update Jenkinsfile
m1k3dcdc Sep 25, 2025
2006d11
Update Jenkinsfile
m1k3dcdc Sep 25, 2025
7b1ab41
Update Jenkinsfile
m1k3dcdc Sep 25, 2025
faf5eec
Update openshift-build.yml
m1k3dcdc Sep 25, 2025
044bbe5
Update Jenkinsfile
m1k3dcdc Sep 25, 2025
821f2b2
Update Jenkinsfile
m1k3dcdc Sep 25, 2025
b67a56a
Update Dockerfile
m1k3dcdc Sep 25, 2025
48c2080
Update Jenkinsfile
m1k3dcdc Sep 25, 2025
f96a449
Update Jenkinsfile
m1k3dcdc Sep 25, 2025
3527303
Update Jenkinsfile
m1k3dcdc Sep 25, 2025
ca0dd55
Update Jenkinsfile
m1k3dcdc Sep 25, 2025
19b32b0
Update Jenkinsfile
m1k3dcdc Sep 25, 2025
b6ccd60
Update Jenkinsfile
m1k3dcdc Sep 25, 2025
fba1dc3
Update Jenkinsfile
m1k3dcdc Sep 25, 2025
e1973ef
Update Jenkinsfile
m1k3dcdc Sep 25, 2025
5d72be3
Update Jenkinsfile
m1k3dcdc Sep 25, 2025
ed51aad
Update Jenkinsfile
m1k3dcdc Sep 25, 2025
1fe97b5
Update Dockerfile
m1k3dcdc Sep 25, 2025
31bf8bc
Update deploy.yml
m1k3dcdc Sep 25, 2025
a5de764
Update openshift-build.yml
m1k3dcdc Sep 25, 2025
c8beea9
Update openshift-build.yml
m1k3dcdc Sep 25, 2025
450cc72
Update deploy.yml
m1k3dcdc Sep 25, 2025
7e28e2a
Update deploy.yml
m1k3dcdc Sep 25, 2025
5022e44
Update Jenkinsfile
m1k3dcdc Sep 26, 2025
b7d5594
Update Jenkinsfile
m1k3dcdc Sep 26, 2025
fe116db
Update Jenkinsfile
m1k3dcdc Sep 26, 2025
45e8744
Update deploy.yml
m1k3dcdc Sep 26, 2025
4ec66f9
Update Jenkinsfile
m1k3dcdc Sep 26, 2025
ec8cb30
Update Jenkinsfile
m1k3dcdc Sep 26, 2025
7f25778
Update Jenkinsfile
m1k3dcdc Sep 26, 2025
ba4914f
Update deploy.yml
m1k3dcdc Sep 26, 2025
4618403
Update deploy.yml
m1k3dcdc Sep 26, 2025
4f7141f
Update deploy.yml
m1k3dcdc Sep 26, 2025
f8e2db3
Delete renovate.json
m1k3dcdc Sep 26, 2025
1a2e8ea
Update Jenkinsfile
m1k3dcdc Sep 26, 2025
8bc3b54
Delete openshift-build.yml
m1k3dcdc Sep 26, 2025
641b077
Merge branch 'main' of https://github.com/m1k3dcdc/hello-java-spring-…
m1k3dcdc Sep 26, 2025
0b8c9e8
Update deploy.yml
m1k3dcdc Sep 26, 2025
932f61a
Update deploy.yml
m1k3dcdc Sep 26, 2025
0587f16
Update deploy.yml
m1k3dcdc Sep 26, 2025
8339091
Update deploy.yml
m1k3dcdc Sep 26, 2025
c9d94f1
Update deploy.yml
m1k3dcdc Sep 26, 2025
81a6593
Update deploy.yml
m1k3dcdc Oct 1, 2025
18bf1d5
Update deploy.yml
m1k3dcdc Oct 1, 2025
0603b50
Update deploy.yml
m1k3dcdc Oct 1, 2025
a65faf6
Update deploy.yml
m1k3dcdc Oct 1, 2025
7f8c8a3
Update deploy.yml
m1k3dcdc Oct 1, 2025
fedae91
Update deploy.yml
m1k3dcdc Oct 1, 2025
89d6a34
Update deploy.yml
m1k3dcdc Oct 1, 2025
e25bf71
Update deploy.yml
m1k3dcdc Oct 1, 2025
42125e3
Update deploy.yml
m1k3dcdc Oct 1, 2025
2c66c9c
Create build.yaml
m1k3dcdc Oct 1, 2025
f77b822
Update build.yaml
m1k3dcdc Oct 1, 2025
f504cd2
Rename build.yaml to openshift-build.yaml
m1k3dcdc Oct 1, 2025
dc6ee7d
Update Jenkinsfile
m1k3dcdc Oct 1, 2025
a5df751
Update Jenkinsfile
m1k3dcdc Oct 1, 2025
42d8b38
Update Jenkinsfile
m1k3dcdc Oct 1, 2025
5e92f07
Update Jenkinsfile
m1k3dcdc Oct 1, 2025
0eabf2d
Update Jenkinsfile
m1k3dcdc Oct 1, 2025
a0f0d7e
Update Jenkinsfile
m1k3dcdc Oct 1, 2025
86e0c85
Update Jenkinsfile apco si
m1k3dcdc Oct 1, 2025
9f7f1eb
Update openshift-build.yaml
m1k3dcdc Oct 1, 2025
366ba3b
Update Jenkinsfile www
m1k3dcdc Oct 1, 2025
099bc63
Update Jenkinsfile 2
m1k3dcdc Oct 2, 2025
7ca5eac
Update Jenkinsfile
m1k3dcdc Oct 2, 2025
d40fcd8
Update Jenkinsfile
m1k3dcdc Oct 2, 2025
f2497ed
Delete openshift-build.yaml
m1k3dcdc Oct 2, 2025
6d59017
Update deploy.yml
m1k3dcdc Oct 2, 2025
2cea57b
Update Jenkinsfile
m1k3dcdc Oct 2, 2025
bd5a068
Update deploy.yml
m1k3dcdc Oct 2, 2025
01d74c6
Update deploy.yml
m1k3dcdc Oct 2, 2025
0710b1b
Update deploy.yml
m1k3dcdc Oct 2, 2025
49dc5fe
Update Jenkinsfile
m1k3dcdc Oct 2, 2025
15837ab
Update Jenkinsfile
m1k3dcdc Oct 2, 2025
5821970
Update Jenkinsfile
m1k3dcdc Oct 2, 2025
1f86e81
Update Jenkinsfile
m1k3dcdc Oct 2, 2025
7067fe5
Update Jenkinsfile
m1k3dcdc Oct 2, 2025
124a72a
Update Jenkinsfile
m1k3dcdc Oct 2, 2025
66abb8d
Update Jenkinsfile
m1k3dcdc Oct 2, 2025
708e496
Update Jenkinsfile
m1k3dcdc Oct 2, 2025
f24baa9
Update deploy.yml
m1k3dcdc Oct 2, 2025
d1a819b
Update Jenkinsfile
m1k3dcdc Oct 2, 2025
6c2591c
Update Jenkinsfile
m1k3dcdc Oct 2, 2025
6457565
Update deploy.yml
m1k3dcdc Oct 2, 2025
550c065
Update Jenkinsfile
m1k3dcdc Oct 2, 2025
f1f6e63
Update deploy.yml
m1k3dcdc Oct 2, 2025
d3ecb60
Update deploy.yml
m1k3dcdc Oct 2, 2025
31ede54
Update Jenkinsfile
m1k3dcdc Oct 3, 2025
17926dc
Update deploy.yml
m1k3dcdc Oct 7, 2025
44a889e
Update Jenkinsfile
m1k3dcdc Oct 7, 2025
6fd9023
Update deploy.yml
m1k3dcdc Oct 7, 2025
72025eb
Update Jenkinsfile
m1k3dcdc Oct 7, 2025
8438f72
Update Jenkinsfile
m1k3dcdc Oct 7, 2025
60053c5
Update Dockerfile
m1k3dcdc Oct 7, 2025
d943b2c
Update deploy.yml
m1k3dcdc Oct 7, 2025
a8f5e2a
Update Jenkinsfile
m1k3dcdc Oct 7, 2025
521f5ca
Update Jenkinsfile
m1k3dcdc Oct 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Build the application first using Maven
FROM maven:3.8-openjdk-11 as build
WORKDIR /app
COPY . .
RUN mvn install
#FROM maven:3.8-openjdk-11 as build
#FROM 3.9.11-sapmachine-11 as build
#WORKDIR /app
#COPY . .
#RUN mvn clean install

# Inject the JAR file into a new container to keep the file small
FROM openjdk:11-jre-slim
WORKDIR /app
COPY --from=build /app/target/hello-java-spring-boot-*.jar /app/app.jar
EXPOSE 8080
ENTRYPOINT ["sh", "-c"]
CMD ["java -jar app.jar"]
#FROM openjdk:11-jre-slim
#WORKDIR /app
#COPY --from=build /app/target/hello-java-spring-boot-*.jar /app/app.jar
#EXPOSE 8080
#ENTRYPOINT ["sh", "-c"]
#CMD ["java -jar app.jar"]
FROM m1k3pjem/hello-java-spring-boot:latest
84 changes: 58 additions & 26 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,69 @@
// Based on:
// https://raw.githubusercontent.com/redhat-cop/container-pipelines/master/basic-spring-boot/Jenkinsfile

library identifier: "[email protected]",
retriever: modernSCM(
[
$class: "GitSCMSource",
remote: "https://github.com/redhat-cop/pipeline-library.git"
]
)

// The name you want to give your Spring Boot application
// Each resource related to your app will be given this name
appName = "hello-java-spring-boot"

pipeline {
// Use the 'maven' Jenkins agent image which is provided with OpenShift
agent { label "maven" }
options {
// set a timeout of 60 minutes for this pipeline
timeout(time: 5, unit: 'MINUTES')
}

environment {
DEV_PROJECT = "mavc23-dev"
APP_NAME = "hello-java-spring-boot"
APP_GIT_URL = "https://github.com/m1k3dcdc/hello-java-spring-boot.git"
}

agent any

stages {
stage("Checkout") {
steps {
checkout scm
stage('Create Container Image') {
steps {
echo '### Create Container Image... ###'

script {
openshift.withCluster() {
openshift.withProject("$DEV_PROJECT") {
echo "### Using project: ${openshift.project()}"
def buildConfigExists = openshift.selector("bc", "hello-java-spring-boot-bc").exists()

echo "### BuildConfig: " + APP_NAME + " exists, start new build to update app ..."
if (!buildConfigExists) {
echo "### newBuild " + APP_NAME + " does not exist"
openshift.newBuild("--name=hello-java-spring-boot-bc", "--image=docker.io/m1k3pjem/hello-java-spring-boot", "--binary")

if (!openshift.selector("route", APP_NAME).exists()) {
echo "### Route " + APP_NAME + " does not exist, exposing service ..."
//def service = openshift.selector("service", APP_NAME)
//service.expose()
} else {
echo "### Route " + APP_NAME + " exist"
}
}
openshift.selector("bc", "hello-java-spring-boot-bc").startBuild("--from-dir=.", "--follow")
}
}
}
}
}
stage("Docker Build") {
steps {
// This uploads your application's source code and performs a binary build in OpenShift
// This is a step defined in the shared library (see the top for the URL)
// (Or you could invoke this step using 'oc' commands!)
binaryBuild(buildConfigName: appName, buildFromPath: ".")

stage('Deploy') {
steps {
echo 'Deploying....'
script {
openshift.withCluster() {
openshift.withProject("mavc23-dev") {

def deployment = openshift.selector("dc", "hello-java-spring-boot")

if(!deployment.exists()){
//openshift.newApp('hello-java-spring-boot', "--as-deployment-config").narrow('svc').expose()
sh "oc apply -f . -n mavc23-dev"
}

}
}
}
}
}

// You could extend the pipeline by tagging the image,
// or deploying it to a production environment, etc......
}
}
105 changes: 58 additions & 47 deletions deploy.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,64 @@
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: Service
metadata:
labels:
app: hello-java-spring-boot
app.kubernetes.io/component: hello-java-spring-boot
app.kubernetes.io/instance: hello-java-spring-boot
name: hello-java-spring-boot
spec:
ports:
- name: 8080-tcp
port: 8080
protocol: TCP
targetPort: 8080
selector:
deployment: hello-java-spring-boot
sessionAffinity: None
type: ClusterIP
- apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: hello-java-spring-boot
app.kubernetes.io/component: hello-java-spring-boot
app.kubernetes.io/instance: hello-java-spring-boot
name: hello-java-spring-boot
spec:
replicas: 1
selector:
matchLabels:
- apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: hello-java-spring-boot
template:
metadata:
labels:
app.kubernetes.io/component: hello-java-spring-boot
app.kubernetes.io/instance: hello-java-spring-boot
name: hello-java-spring-boot-deploy
spec:
replicas: 1
selector:
matchLabels:
app: hello-java-spring-boot
name: hello-java-spring-boot
spec:
containers:
- image: monodot/hello-java-spring-boot:latest
imagePullPolicy: IfNotPresent
template:
metadata:
labels:
app: hello-java-spring-boot
name: hello-java-spring-boot
env:
- name: FAVOURITE_CHEESE
valueFrom:
configMapKeyRef: my-configmap
key: thefavourite.cheese
ports:
- containerPort: 8080
protocol: TCP
restartPolicy: Always
spec:
containers:
- image: docker.io/m1k3pjem/hello-java-spring-boot:latest
imagePullPolicy: IfNotPresent
name: hello-java-spring-boot
env:
- name: FAVOURITE_CHEESE
valueFrom:
configMapKeyRef:
name: hello-java-spring-boot-configmap
key: thefavourite.cheese
ports:
- containerPort: 8080
protocol: TCP
restartPolicy: Always
- apiVersion: v1
kind: Service
metadata:
labels:
app: hello-java-spring-boot
app.kubernetes.io/component: hello-java-spring-boot
app.kubernetes.io/instance: hello-java-spring-boot
name: hello-java-spring-boot-service
spec:
ports:
- name: 8080-tcp
port: 8080
protocol: TCP
targetPort: 8080
selector:
deployment: hello-java-spring-boot
sessionAffinity: None
type: ClusterIP
- apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: hello-java-spring-boot
app.kubernetes.io/component: hello-java-spring-boot
app.kubernetes.io/instance: hello-java-spring-boot
name: hello-java-spring-boot-configmap
data:
thefavourite.cheese: GOUDA
23 changes: 0 additions & 23 deletions openshift-build.yml

This file was deleted.

6 changes: 0 additions & 6 deletions renovate.json

This file was deleted.