Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a5c98fd
added arch diagrams
initcron May 2, 2024
27719a0
added images
initcron May 2, 2024
503af65
added images
initcron May 2, 2024
7921a39
ideas with app
initcron May 2, 2024
f7c80ba
added jenkinsfile
May 20, 2025
3d839ea
Update Jenkinsfile
prahasR May 20, 2025
804b4d7
Added Jenkinsfile
prahasR May 20, 2025
c0e5724
Added Jenkinsfile
prahasR May 20, 2025
45d3e8d
test.md added
May 20, 2025
0c0d08a
Merge branch 'main' of https://github.com/prahasR/sysfoo
May 20, 2025
3b73a91
added change 2
May 20, 2025
8e99272
Merge pull request #1 from prahasR/readme
prahasR May 20, 2025
c939ef6
Added Jenkinsfile
prahasR May 20, 2025
13460e3
Added Jenkinsfile
prahasR May 20, 2025
6bb0797
added multi stage dockerfile to build sysfoo app
May 21, 2025
6db434f
Added Jenkinsfile
prahasR May 21, 2025
6748523
Added Jenkinsfile
prahasR May 21, 2025
1546149
Added Jenkinsfile
prahasR May 21, 2025
56b98df
Added Jenkinsfile
prahasR May 21, 2025
2b99464
Added Jenkinsfile
prahasR May 21, 2025
81fb285
Added Jenkinsfile
prahasR May 21, 2025
f4c5cf0
Added Jenkinsfile
prahasR May 21, 2025
aa2a26e
Added Jenkinsfile
prahasR May 21, 2025
c338347
Added Jenkinsfile
prahasR May 21, 2025
d864bc9
Added Jenkinsfile
prahasR May 21, 2025
7298d7c
Added Jenkinsfile
prahasR May 21, 2025
07104eb
Added Jenkinsfile
prahasR May 22, 2025
3712273
Added Jenkinsfile
prahasR May 22, 2025
2030530
Added Jenkinsfile
prahasR May 22, 2025
a06a82e
Added Jenkinsfile
prahasR May 22, 2025
8dbfb7b
Added Jenkinsfile
prahasR May 22, 2025
4a13989
Added Jenkinsfile
prahasR May 22, 2025
92e830d
Added Jenkinsfile
prahasR May 22, 2025
6550613
Added Jenkinsfile
prahasR May 22, 2025
4406ace
Added Jenkinsfile
prahasR May 22, 2025
2e733d1
Added conditional directive to package stage to run only for main branch
prahasR May 22, 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
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM maven:3.9.6-eclipse-temurin-17 AS build
WORKDIR /app
COPY . .
RUN mvn package -DskipTests

FROM eclipse-temurin:17-jre-noble as package
WORKDIR /app
COPY --from=build /app/target/sysfoo-*.jar ./sysfoo.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "sysfoo.jar"]
73 changes: 73 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
pipeline {
agent none
stages {
stage('build') {
agent {
docker {
image 'maven:3.8.8-eclipse-temurin-21-alpine'
}

}
steps {
echo 'compile maven app'
sh '''ls
echo "WORKSPACE = $WORKSPACE"'''
sh 'mvn clean install -Dmaven.repo.local=$WORKSPACE/.m2/repository'
}
}

stage('test') {
agent {
docker {
image 'maven:3.8.8-eclipse-temurin-21-alpine'
}

}
steps {
echo 'test maven app'
sh 'mvn clean test -Dmaven.repo.local=$WORKSPACE/.m2/repository'
echo 'my custom message'
}
}

stage('package') {
when { branch 'main'}
parallel {
stage('package') {
agent {
docker {
image 'maven:3.8.8-eclipse-temurin-21-alpine'
}

}
steps {
echo 'package maven app'
sh 'mvn package -DskipTests -Dmaven.repo.local=$WORKSPACE/.m2/repository'
archiveArtifacts '**/target/*.jar'
}
}

stage('Docker B&D') {
agent any
steps {
script {
docker.withRegistry('https://index.docker.io/v1/', 'dockerlogin') {
def commitHash = env.GIT_COMMIT.take(7)
def dockerImage = docker.build("pprahas/sysfoo:${commitHash}", "./")
dockerImage.push()
dockerImage.push("latest")
dockerImage.push("dev")
}
}

}
}

}
}

}
tools {
maven 'Maven 3.8.8'
}
}
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ The Sysfoo application is designed as a learning tool to demonstrate various asp

This application is ideal for individuals learning about Spring Boot, RESTful services, and simple frontend interactions with JavaScript. This is also useful for anyone who would like to implement Devops Practices with this App.

![Sysfoo Architecture](./docs/h2.jpg)

As part of devops learning you could take this app and

* Containerize it by writing a Dockerfile
* Setup a dev environment with Docker Compose
* Build a CI Pipeline with Jenkins, Docker, Git
* Deploy using Kubernetes
* Setup Automated Devployments with ArgoCD
* Setup DevSecOps workflows
* Deploy it on Cloud and automate that with Terraform

These are just a few ideas you could try and then build so much on top of this.

## Building the Application

To build and run the Sysfoo application, follow these steps:
Expand Down Expand Up @@ -78,14 +92,17 @@ You may have to replace `localhost` with the actual hostname or IP address based

Following is how the front page looks like

![Sysfoo Web](./sysfoo-web.png)
![Sysfoo Web](./docs/sysfoo-web.png)



## Switching to PostgreSQL Database

This application usesa embded, in memory database called H2 by default. To use PostgreSQL as the database for the Sysfoo application, you need to configure both the application properties and set up the environment appropriately. Here’s how you can switch from the default H2 database to PostgreSQL.

![Sysfoo Architecture](./docs/not_h2.jpg)
![Sysfoo Architecture with Postgres](./docs/postgres.jpg)

### Prerequisites

- PostgreSQL installed on your development machine or access to a PostgreSQL server.
Expand Down
Binary file added docs/h2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/not_h2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/postgres.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
1 change: 1 addition & 0 deletions test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dded change 1 after protection rule