Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 30 additions & 27 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,47 @@
@Library("Shared") _
pipeline{

agent { label "vinod"}

stages{
@Library("shared-lib") _
pipeline {
agent { label "one" }

stages {

stage("Hello"){
stage('hello'){
steps{
script{
hello()
}
}
}
}
stage("Code"){
steps{
script{
clone("https://github.com/LondheShubham153/django-notes-app.git","main")
}

stage('Code') {
steps {
echo "Cloning the repository"
git url: "https://github.com/saaaad8/django-notes-app.git", branch: "main"
}
}
stage("Build"){
steps{
script{
docker_build("notes-app","latest","trainwithshubham")
}

stage('Build') {
steps {
echo "Building the Docker image"
sh "docker build -t saaddocker419/notes-app:latest ."
}
}
stage("Push to DockerHub"){
steps{
script{
docker_push("notes-app","latest","trainwithshubham")

stage('Push to Docker Hub') {
steps {
echo "Pushing the Docker image to Docker Hub"
script {
docker.withRegistry('https://index.docker.io/v1/', 'docker-jenkins') {
sh "docker push saaddocker419/notes-app:latest"
}
}
}
}
stage("Deploy"){
steps{
echo "This is deploying the code"
sh "docker compose down && docker compose up -d"

stage('Deploy') {
steps {
echo "Deploying the application"
sh "docker compose up -d"
}
}

}
}
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,4 @@ docker build -t notes-app .
docker run -d -p 8000:8000 notes-app:latest
```

## Nginx

Install Nginx reverse proxy to make this application available

`sudo apt-get update`
`sudo apt install nginx`
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version : "3.3"
services :
web :
image: "trainwithshubham/notes-app:latest"
image: "saaddocker419/notes-app:latest"
ports :
- "8000:8000"