Initial commit: Hello Devops CI/CD

This commit is contained in:
2025-12-31 19:20:52 +07:00
commit 7afe6a20dd
3 changed files with 35 additions and 0 deletions

4
Dockerfile Normal file
View File

@@ -0,0 +1,4 @@
FROM nginx:alpine
COPY index.html /usr/share/nginx/html/index.html

22
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,22 @@
pipeline {
agent any
stages {
stage('Build Docker Image') {
steps {
sh 'docker build -t hello-devops .'
}
}
stage('Deploy Container') {
steps {
sh '''
docker stop hello-devops || true
docker rm hello-devops || true
docker run -d --name hello-devops -p 5000:80 hello-devops
'''
}
}
}
}

9
index.html Normal file
View File

@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>DevOps Demo</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>