diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..6dae219 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,29 @@ +pipeline { + agent { label "dev-agent" } + stages{ + stage("Clone Code"){ + steps{ + git url: "https://github.com/farzshamim/react_django_demo_app.git", branch: "main" + } + } + stage("Build and Test"){ + steps{ + sh "sudo docker build . -t react_django_demo_app" + } + } + stage("Push to Docker Hub"){ + steps{ + withCredentials([usernamePassword(credentialsId:"dockerHub",passwordVariable:"dockerHubPass",usernameVariable:"dockerHubUser")]){ + sh "sudo docker tag react_django_demo_app ${env.dockerHubUser}/react_django_demo_app:latest" + sh "sudo docker login -u ${env.dockerHubUser} -p ${env.dockerHubPass}" + sh "sudo docker push ${env.dockerHubUser}/react_django_demo_app:latest" + } + } + } + stage("Deploy"){ + steps{ + sh "sudo docker-compose down && sudo docker-compose up -d" + } + } + } +} diff --git a/README.md b/README.md index 05b2efc..6fab7bc 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,6 @@ A demo app for React and Django Deployment docker-compose down docker-compose up -d + + +#robust diff --git a/frontend/build/index.html b/frontend/build/index.html index d331cd5..cc5780a 100644 --- a/frontend/build/index.html +++ b/frontend/build/index.html @@ -1 +1 @@ -Shandaar APP
+My Django APP
diff --git a/mongo-config.yaml b/mongo-config.yaml new file mode 100644 index 0000000..e69de29 diff --git a/mongo-secret.yaml b/mongo-secret.yaml new file mode 100644 index 0000000..e69de29 diff --git a/mongo.yaml b/mongo.yaml new file mode 100644 index 0000000..e69de29 diff --git a/react-todo.yaml b/react-todo.yaml new file mode 100644 index 0000000..e69de29