-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Update todo.ejs #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Update todo.ejs #291
Changes from all commits
65eb03a
439d20b
c517074
5bf629f
921c230
fb76f35
c1074c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| @Library('Shared-Liabrary') _ | ||
| pipeline{ | ||
| agent { label 'Shared-Liabrary' } | ||
| stages{ | ||
| stage('clone'){ | ||
| steps{ | ||
| code_clone('https://github.com/abhishek26w/node-todo-cicd.git','master') | ||
|
|
||
| } | ||
| } | ||
|
|
||
| stage('build'){ | ||
| steps{ | ||
| docker_build('node-apk','latest') | ||
| } | ||
| } | ||
|
|
||
| stage('Test'){ | ||
| steps{ | ||
| echo "Tested Successfully" | ||
| } | ||
| } | ||
|
Comment on lines
+18
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Implement actual testing or document as placeholder. The test stage only echoes a success message without running any actual tests. This defeats the purpose of having a test stage in a CI/CD pipeline. Consider implementing actual tests: stage('Test'){
steps{
- echo "Tested Successfully"
+ script {
+ // Run unit tests
+ sh 'npm test'
+ // Or if using Docker for testing
+ // sh 'docker run --rm node-apk:latest npm test'
+ }
}
}Alternatively, if this is intentionally a placeholder, add a comment to clarify: stage('Test'){
steps{
+ // TODO: Implement actual tests
echo "Tested Successfully"
}
}🤖 Prompt for AI Agents |
||
|
|
||
| stage('Push to DockerHUb'){ | ||
| steps{ | ||
| docker_push('DOCKER-USER','node-apk','latest') | ||
| } | ||
| } | ||
|
|
||
| stage('Deploy'){ | ||
| steps{ | ||
| docker_compose() | ||
|
|
||
| } | ||
| } | ||
|
Comment on lines
+30
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) LGTM - Consider adding deployment configuration clarity. The Docker Compose deployment stage is properly structured. Consider documenting which Docker Compose file is used and the deployment target if not obvious from the shared library implementation. 🤖 Prompt for AI Agents |
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,111 +1,125 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <title>Todo List APP test</title> | ||
| <style> | ||
| body { | ||
| font-family: Arial, sans-serif; | ||
| background-color: #f4f4f4; | ||
| color: #333; | ||
| margin: 0; | ||
| padding: 0; | ||
| } | ||
|
|
||
| h1 { | ||
| background-color: #4CAF50; | ||
| color: white; | ||
| margin: 0; | ||
| padding: 20px; | ||
| text-align: center; | ||
| } | ||
|
|
||
| ul { | ||
| list-style: none; | ||
| padding: 0; | ||
| } | ||
|
|
||
| ul li { | ||
| background: #fff; | ||
| border: 1px solid #ddd; | ||
| margin-bottom: 10px; | ||
| padding: 10px; | ||
| position: relative; | ||
| } | ||
|
|
||
| ul li a { | ||
| color: #333; | ||
| text-decoration: none; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| ul li a:hover { | ||
| color: #4CAF50; | ||
| } | ||
|
|
||
| .delete-btn { | ||
| color: red; | ||
| position: absolute; | ||
| right: 10px; | ||
| top: 10px; | ||
| } | ||
|
|
||
| .edit-btn { | ||
| color: #FFC107; | ||
| position: absolute; | ||
| right: 40px; | ||
| top: 10px; | ||
| } | ||
|
|
||
| form { | ||
| background: #fff; | ||
| padding: 20px; | ||
| margin-top: 20px; | ||
| } | ||
|
|
||
| label { | ||
| display: block; | ||
| margin-bottom: 10px; | ||
| } | ||
|
|
||
| input[type="text"] { | ||
| width: 100%; | ||
| padding: 10px; | ||
| margin-bottom: 10px; | ||
| border: 1px solid #ddd; | ||
| } | ||
|
|
||
| input[type="submit"] { | ||
| background-color: #4CAF50; | ||
| color: white; | ||
| border: none; | ||
| padding: 10px 20px; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| input[type="submit"]:hover { | ||
| background-color: #45a049; | ||
| } | ||
| </style> | ||
| </head> | ||
|
|
||
| <body> | ||
| <h1>Hello Junoon Batch 8 (Jenkins), Write your plan on Learning Jenkins</h1> | ||
| <ul> | ||
| <% todolist.forEach(function(todo, index) { %> | ||
| <li> | ||
| <a href="/todo/delete/<%= index %>" class="delete-btn">✘</a> | ||
| <a href="/todo/<%= index %>" class="edit-btn">✎</a> | ||
| <%- todo %> | ||
| </li> | ||
| <% }); %> | ||
| </ul> | ||
|
|
||
| <form action="/todo/add/" method="post"> | ||
| <p> | ||
| <label for="newtodo">What should I do?</label> | ||
| <input type="text" name="newtodo" id="newtodo" autofocus /> | ||
| <input type="submit" value="Add" /> | ||
| </p> | ||
| </form> | ||
| </body> | ||
| <head> | ||
| <title>Todo List APP - DevOps CI/CD</title> | ||
| <style> | ||
| body { | ||
| font-family: Arial, sans-serif; | ||
| background-color: #f4f4f4; | ||
| color: #333; | ||
| margin: 0; | ||
| padding: 0; | ||
| } | ||
|
|
||
| .header { | ||
| background-color: #4CAF50; | ||
| color: white; | ||
| padding: 20px; | ||
| text-align: center; | ||
| } | ||
|
|
||
| .header h1 { | ||
| margin: 0; | ||
| font-size: 32px; | ||
| } | ||
|
|
||
| .header p { | ||
| margin-top: 10px; | ||
| font-size: 18px; | ||
| } | ||
|
|
||
| ul { | ||
| list-style: none; | ||
| padding: 0; | ||
| } | ||
|
|
||
| ul li { | ||
| background: #fff; | ||
| border: 1px solid #ddd; | ||
| margin-bottom: 10px; | ||
| padding: 10px; | ||
| position: relative; | ||
| } | ||
|
|
||
| ul li a { | ||
| color: #333; | ||
| text-decoration: none; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| ul li a:hover { | ||
| color: #4CAF50; | ||
| } | ||
|
|
||
| .delete-btn { | ||
| color: red; | ||
| position: absolute; | ||
| right: 10px; | ||
| top: 10px; | ||
| } | ||
|
|
||
| .edit-btn { | ||
| color: #FFC107; | ||
| position: absolute; | ||
| right: 40px; | ||
| top: 10px; | ||
| } | ||
|
|
||
| form { | ||
| background: #fff; | ||
| padding: 20px; | ||
| margin-top: 20px; | ||
| } | ||
|
|
||
| label { | ||
| display: block; | ||
| margin-bottom: 10px; | ||
| } | ||
|
|
||
| input[type="text"] { | ||
| width: 100%; | ||
| padding: 10px; | ||
| margin-bottom: 10px; | ||
| border: 1px solid #ddd; | ||
| } | ||
|
|
||
| input[type="submit"] { | ||
| background-color: #4CAF50; | ||
| color: white; | ||
| border: none; | ||
| padding: 10px 20px; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| input[type="submit"]:hover { | ||
| background-color: #45a049; | ||
| } | ||
| </style> | ||
| </head> | ||
| <body> | ||
|
|
||
| <div class="header"> | ||
| <h1>🚀 Welcome to the DevOps CI/CD Pipeline Workshop</h1> | ||
| <p>Empowering Junoon Batch 8 to master automation using Jenkins!</p> | ||
| </div> | ||
|
|
||
| <ul> | ||
| <% todolist.forEach(function(todo, index) { %> | ||
| <li> | ||
| <a href="/todo/delete/<%= index %>" class="delete-btn">✘</a> | ||
| <a href="/todo/<%= index %>" class="edit-btn">✎</a> | ||
| <%- todo %> | ||
| </li> | ||
| <% }); %> | ||
| </ul> | ||
|
|
||
| <form action="/todo/add/" method="post"> | ||
| <p> | ||
| <label for="newtodo">What should I do?</label> | ||
| <input type="text" name="newtodo" id="newtodo" autofocus /> | ||
| <input type="submit" value="Add" /> | ||
| </p> | ||
| </form> | ||
|
|
||
| </body> | ||
| </html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the typo in the shared library name.
The library name "Shared-Liabrary" contains a typo - it should be "Shared-Library". This typo appears in both the library import and agent label, which will cause the pipeline to fail.
Apply this diff to fix the typo:
📝 Committable suggestion
🤖 Prompt for AI Agents