Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
1694382
Add initial Dockerfile for Nginx setup
ryanfitra Dec 20, 2025
de3502b
Refactor Dockerfile to use Node.js base image and set up application …
ryanfitra Dec 20, 2025
c6c6b02
Add initial application structure with HTML, CSS, tests, and Docker c…
ryanfitra Dec 20, 2025
95cc818
Update docker-compose.yaml to define application service and volume c…
ryanfitra Dec 20, 2025
5f95b8c
Rename application in docker-compose.yaml to simple-apps for clarity
ryanfitra Dec 20, 2025
318d1ac
Update index.html title to reflect application name
ryanfitra Dec 20, 2025
90711af
Refactor index.html to improve structure and update language attribute
ryanfitra Dec 20, 2025
c5a17b3
Refactor index.html to inline CSS styles and simplify markup
ryanfitra Dec 20, 2025
a6db6cc
Update container background color in index.html for improved visibility
ryanfitra Dec 20, 2025
2f8c55c
Update container background color in index.html for improved transpar…
ryanfitra Dec 20, 2025
6927cc8
Add Jenkinsfile for CI/CD pipeline setup
ryanfitra Dec 21, 2025
d45926a
Fix test coverage script to ensure forced exit during testing
ryanfitra Dec 21, 2025
04b165b
Update Docker image tag in docker-compose.yaml for consistency
ryanfitra Dec 21, 2025
fe53893
Add additional checkpoint card for Jenkins in index.html
ryanfitra Dec 21, 2025
be48751
Add unit test for /app3 endpoint to verify response status
ryanfitra Dec 21, 2025
7ad611c
Update Jenkins checkpoint label in index.html and remove unit test fo…
ryanfitra Dec 21, 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
57 changes: 57 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
pipeline {
agent { label 'server1-ryan' }

stages {
stage('Pull SCM') {
steps {
git branch: 'main', url: 'https://github.com/ryanfitra/simple-apps.git'
}
}

stage('Build') {
steps {
sh'''
cd app
npm install
'''
}
}

stage('Testing') {
steps {
sh'''
cd app
APP_PORT=5001 npm test
APP_PORT=5001 npm run test:coverage
'''
}
}

// stage('Code Review') {
// steps {
// sh'''
// cd app
// sonar-scanner \
// -Dsonar.projectKey=Simple-Apps \
// -Dsonar.sources=. \
// -Dsonar.host.url=http://172.23.x.x:9000 \
// -Dsonar.login=token-sonar
// '''
// }
// }

stage('Deploy') {
steps {
sh'''
docker compose up --build -d
'''
}
}

stage('Backup') {
steps {
sh 'docker compose push'
}
}
}
}
7 changes: 7 additions & 0 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:20-slim
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "start"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json → app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dev": "nodemon app",
"start": "node app",
"test": "jest --forceExit testing/",
"test:coverage": "jest --coverage testing/"
"test:coverage": "jest --coverage --forceExit testing/"
},
"author": "Moch Rafi Riadi",
"license": "ISC",
Expand Down
File renamed without changes
90 changes: 90 additions & 0 deletions app/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Training DevOps</title>

<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, sans-serif;
}

body {
min-height: 100vh;
background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
display: flex;
justify-content: center;
align-items: center;
color: #ffffff;
}

.container {
text-align: center;
background: rgba(228, 228, 228, 0.463);
padding: 40px;
border-radius: 16px;
width: 90%;
max-width: 420px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.logo {
width: 100px;
margin-bottom: 20px;
}

h1 {
font-size: 2rem;
margin-bottom: 8px;
}

h3 {
font-weight: 400;
margin-bottom: 12px;
}

.subtitle {
font-size: 0.95rem;
opacity: 0.85;
margin-bottom: 24px;
}

.card {
background: rgba(255, 255, 255, 0.18);
padding: 16px;
border-radius: 12px;
margin-bottom: 20px;
}

footer {
font-size: 0.8rem;
opacity: 0.7;
}
</style>
</head>

<body>
<div class="container">
<img class="logo" src="./images/idn-logo.png" alt="IDN Logo">

<h1>Belajar DevOps</h1>
<h3>Rian Fitra Perdana</h3>
<p class="subtitle">Training DevOps IDN</p>

<div class="card">
🚀 Check Point: <strong>Docker Compose</strong>
</div>
<div class="card">
🚀 Check Point: <strong>Jenkins 1</strong>
</div>

<footer>
© 2025 Training DevOps IDN
</footer>
</div>
</body>
</html>
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: simple-apps

services:
app:
image: ryanfitra19/simple-app
build: ./app
ports:
- "5000:3000"
volumes:
- vol-simple:/app/public/images/

volumes:
vol-simple:
14 changes: 0 additions & 14 deletions public/index.html

This file was deleted.