Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
639b436
made a few changes to the jenkins file
nivlapeter Nov 21, 2022
cf48efe
spell check
nivlapeter Nov 21, 2022
a21a835
Heroku credentials
nivlapeter Nov 21, 2022
f1d59f5
Add escape characters
nivlapeter Nov 21, 2022
6f66b47
credentials
nivlapeter Nov 22, 2022
9b808cc
credentials
nivlapeter Nov 22, 2022
0c8614a
credentials
nivlapeter Nov 22, 2022
7176702
add credentials
nivlapeter Nov 22, 2022
a9d5e99
add credentials
nivlapeter Nov 22, 2022
d4946dc
credentials
nivlapeter Nov 22, 2022
e50477b
credentials
nivlapeter Nov 22, 2022
078e525
credentials
nivlapeter Nov 22, 2022
5799bbd
proper defination of stage
nivlapeter Nov 22, 2022
e159d92
Update jenkinsfile
nivlapeter Dec 22, 2022
a3a7aac
Add jenkinsfile
nivlapeter Dec 22, 2022
b046f21
Merge branch 'jenkinsfile' of https://github.com/nivlapeter/java-todo…
nivlapeter Dec 22, 2022
07e1c32
Add jenkinsfile
nivlapeter Dec 22, 2022
060e5ab
update jenkinsfile
nivlapeter Dec 22, 2022
d0be6d5
update jenkinsfile
nivlapeter Dec 22, 2022
bffada0
update jenkinsfile
nivlapeter Dec 22, 2022
335bfb6
update jenkinsfile
nivlapeter Dec 22, 2022
6961603
Update jenkinsfile add Deploy Stage
nivlapeter Dec 22, 2022
f23539f
update jenkinsfile
nivlapeter Dec 22, 2022
0ef2606
Update READMe.md
nivlapeter Dec 22, 2022
bff4762
update Readme
nivlapeter Dec 22, 2022
5ccdaea
update README.md file
nivlapeter Dec 22, 2022
f204339
Update jenkinsfile
nivlapeter Dec 23, 2022
e28557a
Update README.md
nivlapeter Jan 1, 2023
202dfc7
Update README.md
nivlapeter Jan 1, 2023
dc14f41
Update README.md
nivlapeter Jan 1, 2023
3ab76c5
Update README.md
nivlapeter Jan 1, 2023
772ec65
Update jenkinsfile
nivlapeter Jan 1, 2023
751e17a
Update jenkinsfile
nivlapeter Jan 1, 2023
c3ff507
Update jenkinsfile
nivlapeter Jan 1, 2023
b2ef4ef
Update jenkinsfile
nivlapeter Jan 2, 2023
173879c
Update jenkinsfile
nivlapeter Jan 2, 2023
71c6f57
Update jenkinsfile
nivlapeter Jan 2, 2023
ea48c20
Update jenkinsfile
nivlapeter Jan 12, 2023
d27825f
Update jenkinsfile
nivlapeter Jan 12, 2023
be2aad4
Add changes
nivlapeter Feb 16, 2023
2b68475
Modified Jenkins file
nivlapeter Feb 16, 2023
db8eca2
modify jenkinsfile
nivlapeter Apr 5, 2023
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
64 changes: 28 additions & 36 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,46 +1,38 @@
pipeline {
agent any

tools {
gradle 'Gradle-6'
agent any
tools {
gradle 'Gradle-7'
}
stages {
stage('clone repository') {
steps {
git 'https://github.com/nivlapeter/java-todo.git'
}
}


environment {
VERSION_NUMBER = '1.0'
stage('Build Project') {
steps {
sh 'gradle build'
}
}

stages {
stage('Clone repository') {
steps {
echo 'Cloning repository'
git 'https://github.com/brianmarete/java-todo.git'
}
}
stage('Build ') {
steps {
echo "Build number ${BUILD_NUMBER}"
// withGradle() {
sh 'gradle build'
// }
}
}
stage('Test') {
steps {
echo 'Testing the project'
// withGradle() {
sh 'gradl test'
// }
}
stage('Testing_Stage') {
steps {
sh 'gradle test'
}
}
stage('Deploy to Heroku') {
steps {
withCredentials([usernameColonPassword(credentialsId: 'af7ffbc3-0cc5-4ff7-a50d-b0e970c8ffe3', variable: 'HEROKU_CREDENTIALS')]) {
sh 'git push https://${HEROKU_CREDENTIALS}@git.heroku.com/glacial-beyond-51734.git'
}
}
}
post {
}
post {
success {
slackSend color: "good", message: "Build #${BUILD_NUMBER} ran successfully"
slackSend color: 'good', message: "Successfull build for BUILD_ID:${BUILD_ID}"
}

failure {
slackSend color: "danger", message: "Build #${BUILD_NUMBER} failed"
slackSend color: 'danger', message: "Build_ID:${BUILD_ID} failed"
}
}
}
}
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Java-Week3-ToDo-List

Author: Brian Marete
Author: Mr. Alvin_Ndungu/

Official repo for the "To Do List" project using Java, Spark, Handlebars etc for week 3 of java unit.

Each branch contains a new "Step" of code. Please fork, then clone.

Date: 17 Nov 2022
CI/CD Pipeline

Date: 22 Dec 2022
Binary file added bin/main/public/images/rawpixel-com-296621.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions bin/main/templates/index.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{#partial "content"}}

<h1> List o' stuff to do!</h1>

{{#if tasks}}
{{#each tasks }}
<p>Current task:</p>
<p>{{ description }} <a href="/tasks/{{id}}">read more...</a></p>
{{/each}}
{{else}}
<p>No tasks!</p>
{{/if}}
{{/partial}}

{{> layout.hbs}}
35 changes: 35 additions & 0 deletions bin/main/templates/layout.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<title>{{#block "title"}} ToDoList {{/block}}</title>

<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css'>
</head>
<body>
<ul class="nav nav-tabs">
<li role="presentation" class="active"><a href="/">Home</a></li>
<li role="presentation"><a href="/tasks/new">Add a New Task</a></li>
</ul>
<div class="container">
<!--begin main template-->
<div class="page-header">
<img src="/images/rawpixel-com-296621.png" width="70%" alt="https://imgdb.net/images/6800.png">
<h1>Welcome to my To Do List. <small>Let's be organized, focused, and efficient.</small></h1>
</div>

<div class="col-md-12">
{{#block "content"}}
{{/block}}

</div>
</div>
<!--end main template-->
{{#block "footer"}}
<footer class="footer">
<div class="container">
<p class="text-muted"><a href="/tasks/delete">DELETE ALL TASKS</a></p>
</div>
</footer>
</body>
</html>
{{/block}}
22 changes: 22 additions & 0 deletions bin/main/templates/task-detail.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{#partial "content"}}

<p>Description:</p>

<p>{{ task.description }}</p>
<h5>Created At:</h5>
<p> {{ task.createdAt }}</p>
<h5>Task status:</h5>
<p>
{{#if task.published }}
<span class="glyphicon glyphicon-star" aria-hidden="true"></span> Completed
{{else}}
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> Open
{{/if}}

<a href="/tasks/{{task.id}}/update">Edit this task</a><br>
<a href="/tasks/{{task.id}}/delete">DELETE this task (no undo)</a>
</p>

{{/partial}}

{{> layout.hbs}}
21 changes: 21 additions & 0 deletions bin/main/templates/task-form.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{#partial "content"}}

{{#if editTask}}
<h1>Edit this Post!</h1>
<form action="/tasks/{{editTask.id}}" method="post">
<label for="description">Edit this task's description</label>
<input id="description" name="description" type="text" value="{{editTask.description}}">

{{else}}
<h1>Add a new Task!</h1>

<form action="/tasks" method="post">
<label for="description">Task Description</label>
<input id="description" name="description" type="text">

{{/if}}
<button type="submit" class="btn btn-default">Go!</button>
</form>
{{/partial}}

{{> layout.hbs}}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading