[jenkinscat-docs] master: Added common module used by various renderers. (52dd06e)
by Pete Travis
Repository : http://git.fedorahosted.org/cgit/jenkinscat-docs.git
On branch : master
>---------------------------------------------------------------
commit 52dd06eecec56df3720346a1f171fef3ef0265d6
Author: Pavel Tisnovsky <ptisnovs(a)redhat.com>
Date: Tue Dec 9 13:49:48 2014 +0100
Added common module used by various renderers.
>---------------------------------------------------------------
ChangeLog | 5 ++++
.../{books.clj => renderers/page_header.clj} | 23 +++++++++++++-------
2 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9f77b45..0b56904 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2014-12-09 Pavel Tisnovsky <ptisnovs(a)redhat.com>
+ * src/jenkinscat/renderers/page_header.clj:
+ Added common module used by various renderers.
+
+2014-12-09 Pavel Tisnovsky <ptisnovs(a)redhat.com>
+
* src/jenkinscat/renderers/statistics_page.clj:
Added 3rd renderer: the one for statistic page.
diff --git a/src/jenkinscat/books.clj b/src/jenkinscat/renderers/page_header.clj
similarity index 73%
copy from src/jenkinscat/books.clj
copy to src/jenkinscat/renderers/page_header.clj
index 21fa655..dcfd047 100644
--- a/src/jenkinscat/books.clj
+++ b/src/jenkinscat/renderers/page_header.clj
@@ -29,14 +29,21 @@
-(ns jenkinscat.books)
+(ns jenkinscat.renderers.page-header)
-(require '[clojure.edn :as edn])
+(require '[hiccup.core :as hiccup])
+(require '[hiccup.page :as page])
+(require '[hiccup.form :as form])
-(defn read-books
- []
- (println "*** Reading all books... ***")
- (def books
- (edn/read-string (slurp "books.clj")))
- (println "Read " (count books) " books"))
+(defn page-header
+ [subtitle]
+ [:head
+ [:title (str "Jenkinscat - " subtitle)]
+ [:meta {:name "Author" :content "Pavel Tisnovsky"}]
+ [:meta {:name "Generator" :content "Clojure"}]
+ [:meta {:http-equiv "Content-type" :content "text/html; charset=utf-8"}]
+ (page/include-css "css/bootstrap.min.css")
+ (page/include-css "css/Jenkinscat.css")
+ (page/include-js "js/bootstrap.min.js")
+ ])
9 years, 2 months
[jenkinscat-docs] master: Added 3rd renderer: the one for statistic page. (38a40f2)
by Pete Travis
Repository : http://git.fedorahosted.org/cgit/jenkinscat-docs.git
On branch : master
>---------------------------------------------------------------
commit 38a40f2ef069e5de660ab10f006a72b662f192f3
Author: Pavel Tisnovsky <ptisnovs(a)redhat.com>
Date: Tue Dec 9 13:48:22 2014 +0100
Added 3rd renderer: the one for statistic page.
>---------------------------------------------------------------
ChangeLog | 5 +
src/jenkinscat/renderers/statistics_page.clj | 128 ++++++++++++++++++++++++++
2 files changed, 133 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fdd1bf4..9f77b45 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-09 Pavel Tisnovsky <ptisnovs(a)redhat.com>
+
+ * src/jenkinscat/renderers/statistics_page.clj:
+ Added 3rd renderer: the one for statistic page.
+
2014-12-08 Pavel Tisnovsky <ptisnovs(a)redhat.com>
* src/jenkinscat/renderers/add_book_step_2_page.clj:
diff --git a/src/jenkinscat/renderers/statistics_page.clj b/src/jenkinscat/renderers/statistics_page.clj
new file mode 100644
index 0000000..7066066
--- /dev/null
+++ b/src/jenkinscat/renderers/statistics_page.clj
@@ -0,0 +1,128 @@
+;;;
+;;; Jenkinscat HTTP server that handles all requests send from clients/browsers.
+;;;
+;;; Copyright (c) 2014 Pavel Tisnovsky, Red Hat
+;;; All rights reserved.
+;;;
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions are met:
+;;; * Redistributions of source code must retain the above copyright
+;;; notice, this list of conditions and the following disclaimer.
+;;; * Redistributions in binary form must reproduce the above copyright
+;;; notice, this list of conditions and the following disclaimer in the
+;;; documentation and/or other materials provided with the distribution.
+;;; * Neither the name of the Red Hat nor the
+;;; names of its contributors may be used to endorse or promote products
+;;; derived from this software without specific prior written permission.
+;;;
+;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+;;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+;;; DISCLAIMED. IN NO EVENT SHALL Pavel Tisnovsky BE LIABLE FOR ANY
+;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+;;; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+;;; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+;;; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+;;;
+
+
+
+(ns jenkinscat.renderers.statistics-page)
+
+(require '[hiccup.core :as hiccup])
+(require '[hiccup.page :as page])
+(require '[hiccup.form :as form])
+
+(require '[jenkinscat.renderers.page-header :as page-header-renderer])
+(require '[jenkinscat.renderers.navigation-bar :as navigation-bar-renderer])
+
+(defn- third
+ [coll]
+ (nth coll 2))
+
+(defn render-statistics-page
+ "Render page with various statistics."
+ [statistics]
+ (page/xhtml
+ (page-header-renderer/page-header "statistics")
+ [:body
+ (navigation-bar-renderer/navigation-bar "Statistics")
+ [:table {:class "table table-striped table-condensed table-hover table-borderer" :style "width:900px"}
+ [:tr
+ [:th {:width "45%"} "Summary"]
+ [:th {:width "20%"} ""]
+ [:th ""]
+ [:th {:width "20%"} ""]
+ ]
+ [:tr
+ [:td "Products:"]
+ [:td (:product-count statistics)]
+ [:th ""]
+ [:th ""]
+ ]
+ [:tr
+ [:td "Books:"]
+ [:td (:book-count statistics)]
+ [:th ""]
+ [:th ""]
+ ]
+ [:tr
+ [:td "Jobs:"]
+ [:td (:job-count statistics)]
+ [:th ""]
+ [:th ""]
+ ]
+ [:tr [:td " "] [:td " "] [:td " "] [:td " "]]
+ [:tr
+ [:th "Overall pages statistics"]
+ [:th ""]
+ [:th ""]
+ [:th ""]
+ ]
+ [:tr
+ [:td "Total pages:"]
+ [:td (:total-pages statistics)]
+ [:th ""]
+ [:th ""]
+ ]
+ [:tr
+ [:td "Average pages:"]
+ [:td (int (/ (:total-pages statistics) (:book-count statistics))) " per book"]
+ [:th ""]
+ [:th ""]
+ ]
+ [:tr
+ [:td "Book with max pages"]
+ [:td (:max-pages statistics)]
+ [:td {:colspan 2} (:max-pages-book-name statistics)]
+ ]
+ [:tr
+ [:td "Book with min pages"]
+ [:td (:min-pages statistics)]
+ [:td {:colspan 2} (:min-pages-book-name statistics)]
+ ]
+ [:tr [:td " "] [:td " "] [:td " "] [:td " "]]
+ [:tr
+ [:th "Statistics per product:"]
+ [:th ""]
+ [:th ""]
+ [:th ""]
+ ]
+ [:tr
+ [:th "Product name"]
+ [:th "Books"]
+ [:th "Total pages"]
+ [:th "Average"]
+ ]
+ (for [stats-for-product (:stats-for-products statistics)]
+ [:tr
+ [:td (first stats-for-product)]
+ [:td (second stats-for-product)]
+ [:td (third stats-for-product)]
+ [:td (if (= 0 (second stats-for-product)) "?" (int (/ (third stats-for-product)(second stats-for-product))))]
+ ])
+
+]]))
+
9 years, 2 months
[jenkinscat-docs] master: Added 2nd renderer: dialog to add new book/job. (62899ac)
by Pete Travis
Repository : http://git.fedorahosted.org/cgit/jenkinscat-docs.git
On branch : master
>---------------------------------------------------------------
commit 62899ac1becb49f8baec183550b5e590b94c1da0
Author: Pavel Tisnovsky <ptisnovs(a)redhat.com>
Date: Mon Dec 8 12:08:45 2014 +0100
Added 2nd renderer: dialog to add new book/job.
>---------------------------------------------------------------
ChangeLog | 7 +-
src/jenkinscat/renderers/add_book_step_2_page.clj | 181 +++++++++++++++++++++
2 files changed, 187 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b067736..fdd1bf4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,13 @@
2014-12-08 Pavel Tisnovsky <ptisnovs(a)redhat.com>
- * src/jenkinscat/renderers/add_book_step_2_error_pages.clj:
+ * src/jenkinscat/renderers/add_book_step_2_page.clj:
Added 2nd renderer: dialog to add new book/job.
+2014-12-08 Pavel Tisnovsky <ptisnovs(a)redhat.com>
+
+ * src/jenkinscat/renderers/add_book_step_2_error_pages.clj:
+ Added 2nd renderer: dialog to add new book/job (error handlers).
+
2014-12-05 Pavel Tisnovsky <ptisnovs(a)redhat.com>
* src/jenkinscat/renderers/add_book_step_1_page.clj:
diff --git a/src/jenkinscat/renderers/add_book_step_2_page.clj b/src/jenkinscat/renderers/add_book_step_2_page.clj
new file mode 100644
index 0000000..262719f
--- /dev/null
+++ b/src/jenkinscat/renderers/add_book_step_2_page.clj
@@ -0,0 +1,181 @@
+;;;
+;;; Jenkinscat HTTP server that handles all requests send from clients/browsers.
+;;;
+;;; Copyright (c) 2014 Pavel Tisnovsky, Red Hat
+;;; All rights reserved.
+;;;
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions are met:
+;;; * Redistributions of source code must retain the above copyright
+;;; notice, this list of conditions and the following disclaimer.
+;;; * Redistributions in binary form must reproduce the above copyright
+;;; notice, this list of conditions and the following disclaimer in the
+;;; documentation and/or other materials provided with the distribution.
+;;; * Neither the name of the Red Hat nor the
+;;; names of its contributors may be used to endorse or promote products
+;;; derived from this software without specific prior written permission.
+;;;
+;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+;;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+;;; DISCLAIMED. IN NO EVENT SHALL Pavel Tisnovsky BE LIABLE FOR ANY
+;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+;;; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+;;; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+;;; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+;;;
+
+
+
+(ns jenkinscat.renderers.add-book-step-2-page)
+
+(require '[hiccup.core :as hiccup])
+(require '[hiccup.page :as page])
+(require '[hiccup.form :as form])
+
+(require '[jenkinscat.renderers.page-header :as page-header-renderer])
+(require '[jenkinscat.renderers.navigation-bar :as navigation-bar-renderer])
+
+(defn get-item-from-map
+ [the-map key]
+ (if the-map
+ (get the-map key "")
+ ""))
+
+(defn danger-style-for-missing-info
+ [the-map key]
+ (if the-map
+ (if (get the-map key)
+ ""
+ {:class "danger"})
+ ""))
+
+(defn warning-style-for-missing-info
+ [the-map key]
+ (if the-map
+ (if (get the-map key)
+ ""
+ {:class "warning"})
+ ""))
+
+(defn render-add-book-step-2
+ "Render page on which user can change/enter all metainformations about the book."
+ [repository-type repository-name repository-url book-info devel-version message]
+ (page/xhtml
+ (page-header-renderer/page-header "add book, step 2")
+ [:body
+ (navigation-bar-renderer/navigation-bar "Add book")
+ (form/form-to [:post "/add-book-step-3"]
+ [:div {:class "col-md-10"}
+ [:h2 "Add book, step 2/3"]
+ [:table {:class "table table-condensed table-hover table-borderer"}
+ [:tr
+ [:td {:colspan "3"} message]
+ ]
+ [:tr (danger-style-for-missing-info book-info :document-title)
+ [:td {:width "30%"} "Book name:"]
+ [:td (form/text-field {:size "40" :class "-form-control" :style "border-width:1px;border-color:red"} "document-title" (get-item-from-map book-info :document-title))]
+ [:td "(this field is required)"]
+ ]
+ [:tr [:td " "] [:td " "] [:td " "]]
+ [:tr (danger-style-for-missing-info book-info :product-name)
+ [:td "Product name:"]
+ [:td (form/text-field {:size "40" :class "-form-control"} "product-name" (get-item-from-map book-info :product-name))]
+ [:td "(this field is required)"]
+ ]
+ [:tr (danger-style-for-missing-info book-info :product-number)
+ [:td "Product number"]
+ [:td (form/text-field {:size "20" :class "-form-control"} "product-number" (get-item-from-map book-info :product-number))]
+ [:td "(this field is required)"]
+ ]
+ [:tr [:td " "] [:td " "] [:td " "]]
+ [:tr (warning-style-for-missing-info book-info :component-name)
+ [:td "Bugzilla component name:"]
+ [:td (form/text-field {:size "40" :class "-form-control"} "component-name" (get-item-from-map book-info :component-name))]
+ [:td " "]
+ ]
+ [:tr (warning-style-for-missing-info book-info :component-product)
+ [:td "Bugzilla product name for given component:"]
+ [:td (form/text-field {:size "40" :class "-form-control"} "component-product" (get-item-from-map book-info :component-product))]
+ [:td " "]
+ ]
+ [:tr [:td " "] [:td " "] [:td " "]]
+ [:tr
+ [:td "Repository: (not editable)"]
+ [:td " "]
+ [:td " "]
+ ]
+ [:tr
+ [:td "Repository type:"]
+ [:td (form/text-field {:size "20" :class "-form-control" :readonly "readonly"} "repository-type" repository-type)]
+ [:td " "]
+ ]
+ [:tr
+ [:td "Repository name:"]
+ [:td (form/text-field {:size "70" :class "-form-control" :readonly "readonly"} "repository-name" repository-name)]
+ [:td " "]
+ ]
+ [:tr
+ [:td "Repository URL"]
+ [:td (form/text-field {:size "100" :class "-form-control" :readonly "readonly"} "repository-url" repository-url)]
+ [:td " "]
+ ]
+ [:tr [:td " "] [:td " "] [:td " "]]
+ [:tr
+ [:td " "]
+ [:td (form/submit-button {:class "btn btn-primary"} "Continue")]
+ [:td " "]
+ ]
+ ]]
+ )
+ (if devel-version
+ [:div {:class "col-md-10"}
+ "<a href='/add-book-step-3?repository-url=git://git.app.eng.bos.redhat.com/doc-Red_Hat_Developer_Toolset-1-Release_Notes.git&document-title=1.1%20Release%20Notes&product-name=Red%20Hat%20Developer%20Toolset&product-number=1.1&repository-name=doc-Red_Hat_Developer_Toolset-1-Release_Notes.git&repository-type=Gerrit%20(internal%20GIT)&component-product=Red%20Hat%20Developer%20Toolset&component-name=doc-Release_Notes&'>All info</a>"
+ ]
+ )
+ (if devel-version
+ [:div {:class "col-md-10"}
+ "<a href='/add-book-step-3?repository-url=git://git.app.eng.bos.redhat.com/doc-Red_Hat_Developer_Toolset-1-Release_Notes.git&product-name=Red%20Hat%20Developer%20Toolset&product-number=1.1&repository-name=doc-Red_Hat_Developer_Toolset-1-Release_Notes.git&repository-type=Gerrit%20(internal%20GIT)&component-product=Red%20Hat%20Developer%20Toolset&component-name=doc-Release_Notes&'>Missing book name"
+ ]
+ )
+ (if devel-version
+ [:div {:class "col-md-10"}
+ "<a href='/add-book-step-3?repository-url=git://git.app.eng.bos.redhat.com/doc-Red_Hat_Developer_Toolset-1-Release_Notes.git&document-title=1.1%20Release%20Notes&product-number=1.1&repository-name=doc-Red_Hat_Developer_Toolset-1-Release_Notes.git&repository-type=Gerrit%20(internal%20GIT)&component-product=Red%20Hat%20Developer%20Toolset&component-name=doc-Release_Notes&'>Missing product name</a>"
+ ]
+ )
+ (if devel-version
+ [:div {:class "col-md-10"}
+ "<a href='/add-book-step-3?repository-url=git://git.app.eng.bos.redhat.com/doc-Red_Hat_Developer_Toolset-1-Release_Notes.git&document-title=1.1%20Release%20Notes&product-name=Red%20Hat%20Developer%20Toolset&repository-name=doc-Red_Hat_Developer_Toolset-1-Release_Notes.git&repository-type=Gerrit%20(internal%20GIT)&component-product=Red%20Hat%20Developer%20Toolset&component-name=doc-Release_Notes&'>Missing product version</a>"
+ ]
+ )
+ (if devel-version
+ [:div {:class "col-md-10"}
+ "<a href='/add-book-step-3?repository-url=git://git.app.eng.bos.redhat.com/doc-Red_Hat_Developer_Toolset-1-Release_Notes.git&document-title=1.1%20Release%20Notes&product-name=Red%20Hat%20Developer%20Toolset&product-number=1.1&repository-name=doc-Red_Hat_Developer_Toolset-1-Release_Notes.git&component-product=Red%20Hat%20Developer%20Toolset&component-name=doc-Release_Notes&'>Missing repository type</a>"
+ ]
+ )
+ (if devel-version
+ [:div {:class "col-md-10"}
+ "<a href='/add-book-step-3?repository-url=git://git.app.eng.bos.redhat.com/doc-Red_Hat_Developer_Toolset-1-Release_Notes.git&document-title=1.1%20Release%20Notes&product-name=Red%20Hat%20Developer%20Toolset&product-number=1.1&repository-type=Gerrit%20(internal%20GIT)&component-product=Red%20Hat%20Developer%20Toolset&component-name=doc-Release_Notes&'>Missing repository name</a>"
+ ]
+ )
+ (if devel-version
+ [:div {:class "col-md-10"}
+ "<a href='/add-book-step-3?document-title=1.1%20Release%20Notes&product-name=Red%20Hat%20Developer%20Toolset&product-number=1.1&repository-name=doc-Red_Hat_Developer_Toolset-1-Release_Notes.git&repository-type=Gerrit%20(internal%20GIT)&component-product=Red%20Hat%20Developer%20Toolset&component-name=doc-Release_Notes&'>Missing repository URL</a>"
+ ]
+ )
+]))
+
+(defn render-add-book-step-2-already-have-bookinfo
+ "Render page with a message that book info can be read."
+ [repository-type repository-name repository-url book-info devel-version]
+ (render-add-book-step-2 repository-type repository-name repository-url book-info devel-version
+ "The following metainformations have been read from the book repository. Please check them and update properly."))
+
+(defn render-add-book-step-2-enter-some-bookinfo
+ "Render page with a message that book info can't be read and it needs to be filled."
+ [repository-type repository-name repository-url book-info devel-version]
+ (render-add-book-step-2 repository-type repository-name repository-url book-info devel-version
+ "Not all metainformations could be read from the book repository, please fill in the following entries"))
+
9 years, 2 months
[jenkinscat-docs] master: Added 2nd renderer: dialog to add new book/job (error handlers). (d5512b9)
by Pete Travis
Repository : http://git.fedorahosted.org/cgit/jenkinscat-docs.git
On branch : master
>---------------------------------------------------------------
commit d5512b9f571dcc924a867c1d4f95c61a3d665be8
Author: Pavel Tisnovsky <ptisnovs(a)redhat.com>
Date: Mon Dec 8 12:07:28 2014 +0100
Added 2nd renderer: dialog to add new book/job (error handlers).
>---------------------------------------------------------------
ChangeLog | 7 ++-
...r_pages.clj => add_book_step_2_error_pages.clj} | 55 ++++++++++++++------
2 files changed, 44 insertions(+), 18 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 099034a..b067736 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-08 Pavel Tisnovsky <ptisnovs(a)redhat.com>
+
+ * src/jenkinscat/renderers/add_book_step_2_error_pages.clj:
+ Added 2nd renderer: dialog to add new book/job.
+
2014-12-05 Pavel Tisnovsky <ptisnovs(a)redhat.com>
* src/jenkinscat/renderers/add_book_step_1_page.clj:
@@ -6,7 +11,7 @@
2014-12-05 Pavel Tisnovsky <ptisnovs(a)redhat.com>
* src/jenkinscat/renderers/add_book_step_1_error_pages.clj:
- Added 1st renderer: dialog to add new book/job.
+ Added 1st renderer: dialog to add new book/job (error handlers).
2014-12-04 Pavel Tisnovsky <ptisnovs(a)redhat.com>
diff --git a/src/jenkinscat/renderers/add_book_step_1_error_pages.clj b/src/jenkinscat/renderers/add_book_step_2_error_pages.clj
similarity index 54%
copy from src/jenkinscat/renderers/add_book_step_1_error_pages.clj
copy to src/jenkinscat/renderers/add_book_step_2_error_pages.clj
index 49dbcbb..8a88aad 100644
--- a/src/jenkinscat/renderers/add_book_step_1_error_pages.clj
+++ b/src/jenkinscat/renderers/add_book_step_2_error_pages.clj
@@ -29,28 +29,49 @@
-(ns jenkinscat.renderers.add-book-step-1-error-pages)
+(ns jenkinscat.renderers.add-book-step-2-error-pages)
(require '[jenkinscat.renderers.error-page :as error-page-renderer])
-(defn render-add-book-step-1-wrong-repotype
- "Render page with error message when wrong repository type is entered."
+(defn render-add-book-step-2-missing-repository-type
+ ""
[]
- (error-page-renderer/render-error-page "wrong repository type"
- "Oops! repository type was not selected"
+ (error-page-renderer/render-error-page "missing repository type"
+ "Oops! repository type is missing"
"Please make sure you have selected correct repository type"))
-(defn render-add-book-step-1-empty-reponame
- "Render page with error message when repository name is empty."
+(defn render-add-book-step-2-missing-repository-name
+ ""
[]
- (error-page-renderer/render-error-page "empty repository-name"
- "Oops! repository name is not specified"
- "You need to fill in repository name"))
-
-(defn render-add-book-step-1-wrong-reponame
- "Render page with error message when repository name is not correct."
- [repository-name]
- (error-page-renderer/render-error-page "wrong repository name"
- "Oops! improper repository name"
- (str "The given repository name '" repository-name "' is not valid.")))
+ (error-page-renderer/render-error-page "missing repository name"
+ "Oops! repository name is missing"
+ "Please make sure you have selected correct repository name"))
+
+(defn render-add-book-step-2-missing-repository-url
+ ""
+ []
+ (error-page-renderer/render-error-page "missing repository URL"
+ "Oops! repository URL is missing"
+ "Please make sure you have selected correct repository URL"))
+
+(defn render-add-book-step-2-missing-document-title
+ ""
+ []
+ (error-page-renderer/render-error-page "missing repository type"
+ "Oops! book name is missing"
+ "Please make sure you have selected correct book name"))
+
+(defn render-add-book-step-2-missing-product-name
+ ""
+ []
+ (error-page-renderer/render-error-page "missing product name"
+ "Oops! product name is missing"
+ "Please make sure you have selected correct product number"))
+
+(defn render-add-book-step-2-missing-product-number
+ ""
+ []
+ (error-page-renderer/render-error-page "missing product number"
+ "Oops! product number (version) is missing"
+ "Please make sure you have selected correct product number"))
9 years, 2 months
[jenkinscat-docs] master: Added 1st renderer: dialog to add new book/job. (ad8e905)
by Pete Travis
Repository : http://git.fedorahosted.org/cgit/jenkinscat-docs.git
On branch : master
>---------------------------------------------------------------
commit ad8e90559ad54aac7de40c59b2f42d26499d82b4
Author: Pavel Tisnovsky <ptisnovs(a)redhat.com>
Date: Fri Dec 5 13:40:40 2014 +0100
Added 1st renderer: dialog to add new book/job.
>---------------------------------------------------------------
ChangeLog | 5 +
src/jenkinscat/renderers/add_book_step_1_page.clj | 118 +++++++++++++++++++++
2 files changed, 123 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4524041..099034a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2014-12-05 Pavel Tisnovsky <ptisnovs(a)redhat.com>
+ * src/jenkinscat/renderers/add_book_step_1_page.clj:
+ Added 1st renderer: dialog to add new book/job.
+
+2014-12-05 Pavel Tisnovsky <ptisnovs(a)redhat.com>
+
* src/jenkinscat/renderers/add_book_step_1_error_pages.clj:
Added 1st renderer: dialog to add new book/job.
diff --git a/src/jenkinscat/renderers/add_book_step_1_page.clj b/src/jenkinscat/renderers/add_book_step_1_page.clj
new file mode 100644
index 0000000..10f2a3a
--- /dev/null
+++ b/src/jenkinscat/renderers/add_book_step_1_page.clj
@@ -0,0 +1,118 @@
+;;;
+;;; Jenkinscat HTTP server that handles all requests send from clients/browsers.
+;;;
+;;; Copyright (c) 2014 Pavel Tisnovsky, Red Hat
+;;; All rights reserved.
+;;;
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions are met:
+;;; * Redistributions of source code must retain the above copyright
+;;; notice, this list of conditions and the following disclaimer.
+;;; * Redistributions in binary form must reproduce the above copyright
+;;; notice, this list of conditions and the following disclaimer in the
+;;; documentation and/or other materials provided with the distribution.
+;;; * Neither the name of the Red Hat nor the
+;;; names of its contributors may be used to endorse or promote products
+;;; derived from this software without specific prior written permission.
+;;;
+;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+;;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+;;; DISCLAIMED. IN NO EVENT SHALL Pavel Tisnovsky BE LIABLE FOR ANY
+;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+;;; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+;;; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+;;; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+;;;
+
+
+
+(ns jenkinscat.renderers.add-book-step-1-page)
+
+(require '[hiccup.core :as hiccup])
+(require '[hiccup.page :as page])
+(require '[hiccup.form :as form])
+
+(require '[jenkinscat.renderers.page-header :as page-header-renderer])
+(require '[jenkinscat.renderers.navigation-bar :as navigation-bar-renderer])
+
+(defn render-add-book-step-1-page
+ "Render page with the 'add book' dialog."
+ [product-list devel-version]
+ (page/xhtml
+ (page-header-renderer/page-header "add book")
+ [:body
+ [:script "
+ function updateRepositoryPrefix()
+ {
+ var repoPrefixElement = document.getElementById('repo-prefix');
+ var repoType = document.getElementById('repository-type').value;
+ var repoPrefix = ''
+ if (repoType == 'GitHub')
+ repoPrefix = 'https://github.com/';
+ if (repoType == 'SVN (internal)')
+ repoPrefix = 'https://svn.devel.redhat.com/repos/'
+ if (repoType == 'Gerrit (internal GIT)')
+ repoPrefix = 'git://git.app.eng.bos.redhat.com/';
+ if (repoType == 'Fedora GIT')
+ repoPrefix = 'git://git.fedorahosted.org/git/docs/';
+ repoPrefixElement.innerText = repoPrefix;
+ }
+ "]
+ (navigation-bar-renderer/navigation-bar "Add book")
+ (form/form-to [:post "/add-book-step-2"]
+ [:div {:class "col-md-10"}
+ [:h2 "Add book, step 1/3"]
+ [:table {:class "table table-condensed table-hover table-borderer"}
+ [:tr
+ [:td {:style "width:20%"} "Repository type:"]
+ [:td {:style "width:20%"} (form/drop-down {:onChange "updateRepositoryPrefix()"} "repository-type" ["Please select repository type" "Gerrit (internal GIT)" "GitHub" "Fedora GIT" "SVN (internal)",])]
+ [:td " "]
+ ]
+ [:tr
+ [:td "Repository name"]
+ [:td [:div {:id "repo-prefix"} " "]]
+ [:td (form/text-field {:size "60" :class "-form-control"} "repository-url")]
+ ]
+ ; [:tr
+ ; [:td "Book type/build configuration:"]
+ ; [:td (form/drop-down "build-configuration"
+ ; ["DocBook (Publican)"
+ ; "AsciiDoc (asciidoctor and Publican)"
+ ; "Markdown (pandoc)"
+ ; "Mallard (yelp-build)"
+ ; ])]
+ ; [:td [:button {:class "btn btn-info" :onclick "window.open('build-configuration-help');" :type "button"} "Help"]]
+ ; ]
+ ; [:tr [:td " "] [:td " "] [:td " "]]
+ [:tr
+ [:td " "]
+ [:td (form/submit-button {:class "btn btn-primary"} "Continue")]
+ [:td " "]
+ ]
+ ]]
+ )
+ (if devel-version
+ [:div {:class "col-md-10"}
+ "<a href='/add-book-step-2?repository-type=Gerrit (internal GIT)&repo-prefix=git://git.app.eng.bos.redhat.com/&repository-url=doc-Red...'>Gerrit + .edn file</a>"
+ ]
+ )
+ (if devel-version
+ [:div {:class "col-md-10"}
+ "<a href='/add-book-step-2?repository-type=Gerrit (internal GIT)&repo-prefix=git://git.app.eng.bos.redhat.com/&repository-url=doc-Red...'>Gerrit - .edn file</a>"
+ ]
+ )
+ (if devel-version
+ [:div {:class "col-md-10"}
+ "<a href='/add-book-step-2?repository-type=Gerrit (internal GIT)&repo-prefix=git://git.app.eng.bos.redhat.com/&repository-url=dtc.git'>Gerrit - no DocBook</a>"
+ ]
+ )
+ (if devel-version
+ [:div {:class "col-md-10"}
+ "<a href='/add-book-step-2?repository-type=Gerrit (internal GIT)&repo-prefix=git://git.app.eng.bos.redhat.com/&repository-url=---.git'>Bad repo</a>"
+ ]
+ )
+ ]))
+
9 years, 2 months
[jenkinscat-docs] master: Added 1st renderer: dialog to add new book/job. (568a929)
by Pete Travis
Repository : http://git.fedorahosted.org/cgit/jenkinscat-docs.git
On branch : master
>---------------------------------------------------------------
commit 568a929d3e97a04542efaf20d1167de7457627cc
Author: Pavel Tisnovsky <ptisnovs(a)redhat.com>
Date: Fri Dec 5 13:39:42 2014 +0100
Added 1st renderer: dialog to add new book/job.
>---------------------------------------------------------------
ChangeLog | 5 ++
.../add_book_step_1_error_pages.clj} | 53 +++++++++-----------
2 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3d7ebdc..4524041 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-05 Pavel Tisnovsky <ptisnovs(a)redhat.com>
+
+ * src/jenkinscat/renderers/add_book_step_1_error_pages.clj:
+ Added 1st renderer: dialog to add new book/job.
+
2014-12-04 Pavel Tisnovsky <ptisnovs(a)redhat.com>
* src/jenkinscat/books.clj:
diff --git a/src/jenkinscat/config.clj b/src/jenkinscat/renderers/add_book_step_1_error_pages.clj
similarity index 57%
copy from src/jenkinscat/config.clj
copy to src/jenkinscat/renderers/add_book_step_1_error_pages.clj
index eced421..49dbcbb 100644
--- a/src/jenkinscat/config.clj
+++ b/src/jenkinscat/renderers/add_book_step_1_error_pages.clj
@@ -29,33 +29,28 @@
-(ns jenkinscat.config)
-
-(def hostname
- "Hostname of this computer"
- (.getHostName (java.net.InetAddress/getLocalHost)))
-
-(def jobs-dir-prefix
- "Path to the directory where are stored all Jenkins jobs."
- "/var/lib/jenkins/jobs/")
-
-(def jobs-href-prefix
- "URL prefix for all Jenkins jobs."
- (str "http://" hostname ":8080/job/"))
-
-(def json-url
- "URL prefix for all requests based on JSON."
- (str "http://" hostname ":8080/"))
-
-(def test-results-url-prefix
- "URL prefix for all tests (ie.test jobs)."
- (str "http://" hostname "/tests/"))
-
-(def test-results-prefix
- "Path where test results will be stored."
- "/var/www/html/tests/")
-
-(def devel-version
- "Whether devel mode should be on."
- true)
+(ns jenkinscat.renderers.add-book-step-1-error-pages)
+
+(require '[jenkinscat.renderers.error-page :as error-page-renderer])
+
+(defn render-add-book-step-1-wrong-repotype
+ "Render page with error message when wrong repository type is entered."
+ []
+ (error-page-renderer/render-error-page "wrong repository type"
+ "Oops! repository type was not selected"
+ "Please make sure you have selected correct repository type"))
+
+(defn render-add-book-step-1-empty-reponame
+ "Render page with error message when repository name is empty."
+ []
+ (error-page-renderer/render-error-page "empty repository-name"
+ "Oops! repository name is not specified"
+ "You need to fill in repository name"))
+
+(defn render-add-book-step-1-wrong-reponame
+ "Render page with error message when repository name is not correct."
+ [repository-name]
+ (error-page-renderer/render-error-page "wrong repository name"
+ "Oops! improper repository name"
+ (str "The given repository name '" repository-name "' is not valid.")))
9 years, 2 months
[jenkinscat-docs] master: Minor changes. (f5a374b)
by Pete Travis
Repository : http://git.fedorahosted.org/cgit/jenkinscat-docs.git
On branch : master
>---------------------------------------------------------------
commit f5a374b8721d689c8f8dff46db128ffe1bc7f00a
Author: Pavel Tisnovsky <ptisnovs(a)redhat.com>
Date: Thu Dec 4 10:51:44 2014 +0100
Minor changes.
>---------------------------------------------------------------
ChangeLog | 8 ++++++++
src/jenkinscat/books.clj | 6 ++++++
src/jenkinscat/config.clj | 10 ++++++++++
src/jenkinscat/core.clj | 6 ++++++
src/jenkinscat/server.clj | 44 +++++++++++++++++++++++---------------------
5 files changed, 53 insertions(+), 21 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c2821aa..3d7ebdc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2014-12-04 Pavel Tisnovsky <ptisnovs(a)redhat.com>
+ * src/jenkinscat/books.clj:
+ * src/jenkinscat/config.clj:
+ * src/jenkinscat/core.clj:
+ * src/jenkinscat/server.clj:
+ Minor changes.
+
+2014-12-04 Pavel Tisnovsky <ptisnovs(a)redhat.com>
+
* src/jenkinscat/file_handlers.clj:
Added - file handlers should be stored in a separate file and namespace.
* src/jenkinscat/fileutils.clj:
diff --git a/src/jenkinscat/books.clj b/src/jenkinscat/books.clj
index f0405d8..21fa655 100644
--- a/src/jenkinscat/books.clj
+++ b/src/jenkinscat/books.clj
@@ -1,3 +1,6 @@
+;;;
+;;; Jenkinscat HTTP server that handles all requests send from clients/browsers.
+;;;
;;; Copyright (c) 2014 Pavel Tisnovsky, Red Hat
;;; All rights reserved.
;;;
@@ -22,6 +25,9 @@
;;; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+;;;
+
+
(ns jenkinscat.books)
diff --git a/src/jenkinscat/config.clj b/src/jenkinscat/config.clj
index 8ad5fda..eced421 100644
--- a/src/jenkinscat/config.clj
+++ b/src/jenkinscat/config.clj
@@ -1,3 +1,6 @@
+;;;
+;;; Jenkinscat HTTP server that handles all requests send from clients/browsers.
+;;;
;;; Copyright (c) 2014 Pavel Tisnovsky, Red Hat
;;; All rights reserved.
;;;
@@ -22,6 +25,9 @@
;;; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+;;;
+
+
(ns jenkinscat.config)
@@ -49,3 +55,7 @@
"Path where test results will be stored."
"/var/www/html/tests/")
+(def devel-version
+ "Whether devel mode should be on."
+ true)
+
diff --git a/src/jenkinscat/core.clj b/src/jenkinscat/core.clj
index dde8d8c..ce821e5 100644
--- a/src/jenkinscat/core.clj
+++ b/src/jenkinscat/core.clj
@@ -1,3 +1,6 @@
+;;;
+;;; Jenkinscat HTTP server that handles all requests send from clients/browsers.
+;;;
;;; Copyright (c) 2014 Pavel Tisnovsky, Red Hat
;;; All rights reserved.
;;;
@@ -22,6 +25,9 @@
;;; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+;;;
+
+
(ns jenkinscat.core)
; enable in case you need to generate "uberjar"
diff --git a/src/jenkinscat/server.clj b/src/jenkinscat/server.clj
index e780b77..f061139 100644
--- a/src/jenkinscat/server.clj
+++ b/src/jenkinscat/server.clj
@@ -37,12 +37,14 @@
(require '[hiccup.page :as page])
(require '[hiccup.form :as form])
-(require '[ring.util.response :as http-response])
-(require '[clojure.data.json :as json])
-(require '[jenkinscat.books :as books])
-(require '[jenkinscat.fileutils :as fileutils])
-(require '[jenkinscat.config :as config])
-(require '[jenkinscat.exec :as exec])
+(require '[ring.util.response :as http-response])
+(require '[clojure.data.json :as json])
+(require '[jenkinscat.books :as books])
+(require '[jenkinscat.fileutils :as fileutils])
+(require '[jenkinscat.config :as config])
+(require '[jenkinscat.exec :as exec])
+(require '[jenkinscat.file-handlers :as file-handlers])
+
(require '[clojure.xml :as xml])
@@ -701,21 +703,21 @@
duration (if last-build-and-duration (second last-build-and-duration) nil)
path-to-log (get-path-to-log job-name book-key)]
(conj! books-for-product {
- "name" book-name
- "repo" book-repo
- "status" status
- "log" path-to-log
- "last-build" (compute-last-build last-build current-time)
- "duration" (compute-duration duration)
- "html-single-link" (get-path-to-html job-name)
- "pdf-link" (get-path-to-pdf job-name)
- "job-name" job-name
- "bugzilla-link" bugzilla-url
- "bugzilla_status" bugzilla-url-ok
- "component-name" bugzilla-component-name
- "product-name" book-product
- "show_overview" show-overview
- "book-product-name" book-product-name
+ "name" book-name
+ "repo" book-repo
+ "status" status
+ "log" path-to-log
+ "last-build" (compute-last-build last-build current-time)
+ "duration" (compute-duration duration)
+ "html-single-link" (get-path-to-html job-name)
+ "pdf-link" (get-path-to-pdf job-name)
+ "job-name" job-name
+ "bugzilla-link" bugzilla-url
+ "bugzilla_status" bugzilla-url-ok
+ "component-name" bugzilla-component-name
+ "product-name" book-product
+ "show_overview" show-overview
+ "book-product-name" book-product-name
}))
)
))
9 years, 2 months
[jenkinscat-docs] master: Added - file handlers should be stored in a separate file and namespace. (9ccfdc4)
by Pete Travis
Repository : http://git.fedorahosted.org/cgit/jenkinscat-docs.git
On branch : master
>---------------------------------------------------------------
commit 9ccfdc421e471919b9a07539a77c78d9e71c312d
Author: Pavel Tisnovsky <ptisnovs(a)redhat.com>
Date: Thu Dec 4 10:48:15 2014 +0100
Added - file handlers should be stored in a separate file and namespace.
>---------------------------------------------------------------
ChangeLog | 7 +++
src/jenkinscat/file_handlers.clj | 81 ++++++++++++++++++++++++++++++++++++++
src/jenkinscat/fileutils.clj | 3 +
3 files changed, 91 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f6f7c79..c2821aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-12-04 Pavel Tisnovsky <ptisnovs(a)redhat.com>
+
+ * src/jenkinscat/file_handlers.clj:
+ Added - file handlers should be stored in a separate file and namespace.
+ * src/jenkinscat/fileutils.clj:
+ Updated.
+
2014-12-03 Pavel Tisnovsky <ptisnovs(a)redhat.com>
* src/jenkinscat/server.clj:
diff --git a/src/jenkinscat/file_handlers.clj b/src/jenkinscat/file_handlers.clj
new file mode 100644
index 0000000..b7f7554
--- /dev/null
+++ b/src/jenkinscat/file_handlers.clj
@@ -0,0 +1,81 @@
+;;;
+;;; Jenkinscat HTTP server that handles all requests send from clients/browsers.
+;;;
+;;; Copyright (c) 2014 Pavel Tisnovsky, Red Hat
+;;; All rights reserved.
+;;;
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions are met:
+;;; * Redistributions of source code must retain the above copyright
+;;; notice, this list of conditions and the following disclaimer.
+;;; * Redistributions in binary form must reproduce the above copyright
+;;; notice, this list of conditions and the following disclaimer in the
+;;; documentation and/or other materials provided with the distribution.
+;;; * Neither the name of the Red Hat nor the
+;;; names of its contributors may be used to endorse or promote products
+;;; derived from this software without specific prior written permission.
+;;;
+;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+;;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+;;; DISCLAIMED. IN NO EVENT SHALL Pavel Tisnovsky BE LIABLE FOR ANY
+;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+;;; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+;;; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+;;; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+;;;
+
+
+
+(ns jenkinscat.file-handlers)
+
+(require '[ring.util.response :as http-response])
+(require '[jenkinscat.fileutils :as fileutils])
+
+(defn return-file
+ "Return given file with proper content type as a response to a HTTP request."
+ [file-name content-type]
+ (let [file (fileutils/new-file "www" file-name)]
+ (println "Returning file " (.getAbsolutePath file))
+ (println "")
+ (-> (http-response/response file)
+ (http-response/content-type content-type))))
+
+(def file-handlers
+ "Map of file handlers, ie. map of known files included from the generated HTML page."
+ {"/" '(jenkinscat.file-handlers/return-file "index.html" "text/html")
+ "/favicon.ico" '(jenkinscat.file-handlers/return-file "favicon.ico" "image/x-icon")
+ "/jenkinscat.gif" '(jenkinscat.file-handlers/return-file "jenkinscat.gif" "image/gif")
+ "/jenkinscat.png" '(jenkinscat.file-handlers/return-file "jenkinscat.png" "image/png")
+ "/stopwatch2.png" '(jenkinscat.file-handlers/return-file "stopwatch2.png" "image/png")
+ "/erase-l.gif" '(jenkinscat.file-handlers/return-file "erase-l.gif" "image/gif")
+ ; this one is there only for test purposes
+ ;"/data.json" '(jenkinscat.file-handlers/return-file "data.json" "application/json")
+
+ "/css/bootstrap.css" '(jenkinscat.file-handlers/return-file "/css/bootstrap.css" "text/css")
+ "/css/bootstrap.css.map" '(jenkinscat.file-handlers/return-file "/css/bootstrap.css.map" "text/css")
+ "/css/bootstrap.min.css" '(jenkinscat.file-handlers/return-file "/css/bootstrap.min.css" "text/css")
+ "/css/bootstrap-theme.css" '(jenkinscat.file-handlers/return-file "/css/bootstrap-theme.css" "text/css")
+ "/css/bootstrap-theme.css.map" '(jenkinscat.file-handlers/return-file "/css/bootstrap-theme.css.map" "text/css")
+ "/css/bootstrap-theme.min.css" '(jenkinscat.file-handlers/return-file "/css/bootstrap-theme.min.css" "text/css")
+ "/css/Jenkinscat.css" '(jenkinscat.file-handlers/return-file "/css/Jenkinscat.css" "text/css")
+
+ "/js/angular.min.js" '(jenkinscat.file-handlers/return-file "/js/angular.min.js" "application/javascript")
+ "/js/bootstrap.js" '(jenkinscat.file-handlers/return-file "/js/bootstrap.js" "application/javascript")
+ "/js/bootstrap.min.js" '(jenkinscat.file-handlers/return-file "/js/bootstrap.min.js" "application/javascript")
+ "/js/jenkinscat.js" '(jenkinscat.file-handlers/return-file "/js/jenkinscat.js" "application/javascript")
+ "/js/jquery.min.js" '(jenkinscat.file-handlers/return-file "/js/jquery.min.js" "application/javascript")
+
+ "/fonts/glyphicons-halflings-regular.eot" '(jenkinscat.file-handlers/return-file "/fonts/glyphicons-halflings-regular.eot" "application/vnd.ms-fontobject")
+ "/fonts/glyphicons-halflings-regular.svg" '(jenkinscat.file-handlers/return-file "/fonts/glyphicons-halflings-regular.svg" "image/svg+xml")
+ "/fonts/glyphicons-halflings-regular.ttf" '(jenkinscat.file-handlers/return-file "/fonts/glyphicons-halflings-regular.ttf" "application/x-font-ttf")
+ "/fonts/glyphicons-halflings-regular.woff" '(jenkinscat.file-handlers/return-file "/fonts/glyphicons-halflings-regular.woff" "application/font-woff")
+})
+
+(defn get-file-handler
+ "Return selected file handler or nil in case the handler is unknown."
+ [uri]
+ (get file-handlers uri nil))
+
diff --git a/src/jenkinscat/fileutils.clj b/src/jenkinscat/fileutils.clj
index b556a5a..cd9d4a1 100644
--- a/src/jenkinscat/fileutils.clj
+++ b/src/jenkinscat/fileutils.clj
@@ -1,3 +1,6 @@
+;;;
+;;; Jenkinscat HTTP server that handles all requests send from clients/browsers.
+;;;
;;; Copyright (c) 2014 Pavel Tisnovsky, Red Hat
;;; All rights reserved.
;;;
9 years, 2 months
[jenkinscat-docs] master: Updated to use exec and fileutils modules. (30b2c2d)
by Pete Travis
Repository : http://git.fedorahosted.org/cgit/jenkinscat-docs.git
On branch : master
>---------------------------------------------------------------
commit 30b2c2d1c5d6758287eb23900a38644bb9b77e68
Author: Pavel Tisnovsky <ptisnovs(a)redhat.com>
Date: Wed Dec 3 12:01:33 2014 +0100
Updated to use exec and fileutils modules.
>---------------------------------------------------------------
ChangeLog | 5 ++
src/jenkinscat/server.clj | 117 +++++++++++++++++++--------------------------
2 files changed, 54 insertions(+), 68 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6801b54..f6f7c79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2014-12-03 Pavel Tisnovsky <ptisnovs(a)redhat.com>
+ * src/jenkinscat/server.clj:
+ Updated to use exec and fileutils modules.
+
+2014-12-03 Pavel Tisnovsky <ptisnovs(a)redhat.com>
+
* src/jenkinscat/fileutils.clj:
File-related utils should be stored in separate file (and namespace).
diff --git a/src/jenkinscat/server.clj b/src/jenkinscat/server.clj
index 61b06f7..e780b77 100644
--- a/src/jenkinscat/server.clj
+++ b/src/jenkinscat/server.clj
@@ -33,19 +33,18 @@
(require 'clojure.string)
-(require '[hiccup.core :as hiccup])
-(require '[hiccup.page :as page])
-(require '[hiccup.form :as form])
-
-(require '[ring.util.response :as http-response])
-(require '[clojure.data.json :as json])
-(require '[jenkinscat.books :as books])
+(require '[hiccup.core :as hiccup])
+(require '[hiccup.page :as page])
+(require '[hiccup.form :as form])
+
+(require '[ring.util.response :as http-response])
+(require '[clojure.data.json :as json])
+(require '[jenkinscat.books :as books])
+(require '[jenkinscat.fileutils :as fileutils])
(require '[jenkinscat.config :as config])
+(require '[jenkinscat.exec :as exec])
-(require '[clojure.xml :as xml])
-
-(def test-results-prefix
- "/var/www/html/tests/")
+(require '[clojure.xml :as xml])
(def not-available-message
"<span style='color:red'>N/A</span>")
@@ -55,32 +54,14 @@
[coll]
(nth coll 2))
-(defn exec
- "Execute external command."
- ([command]
- (.waitFor (. (Runtime/getRuntime) exec command)))
- ([command param1]
- (.waitFor (. (Runtime/getRuntime) exec (str command " " param1))))
- ([command param1 param2]
- (.waitFor (. (Runtime/getRuntime) exec (str command " " param1 " " param2))))
- ([command param1 param2 param3]
- (.waitFor (. (Runtime/getRuntime) exec (str command " " param1 " " param2 " " param3))))
- ([command param1 param2 param3 param4]
- (.waitFor (. (Runtime/getRuntime) exec (str command " " param1 " " param2 " " param3 " " param4))))
- ([command param1 param2 param3 param4 param5]
- (.waitFor (. (Runtime/getRuntime) exec (str command " " param1 " " param2 " " param3 " " param4 " " param5)))))
-
(defn start-build
"Start a new build (add the request for a build to Jenkins queue)."
[job-name]
- (exec "./tools/start_builds.sh" job-name))
+ (exec/exec "./tools/start_builds.sh" job-name))
-(defn new-file
- "Just a shortcut for (new java.io.File filename)."
- ( [filename]
- (new java.io.File filename))
- ( [path filename]
- (new java.io.File path filename)))
+(defn empty-string-to-nil
+ [string]
+ (if (clojure.string/blank? string) nil string))
(defn gnome-job?
[job-name]
@@ -107,20 +88,20 @@
(defn href-to-pdf
"Return a proper href to a PDF document generated by Jenkins job."
[job-name file-name]
- (str jobs-href-prefix job-name "%20(PDF)/lastStableBuild/artifact/tmp/en-US/pdf/" file-name))
- ;(str "<a href='" jobs-href-prefix job-name "%20(PDF)/lastStableBuild/artifact/tmp/en-US/pdf/" file-name "'>link</a>"))
+ (str config/jobs-href-prefix job-name "%20(PDF)/lastStableBuild/artifact/tmp/en-US/pdf/" file-name))
+ ;(str "<a href='" config/jobs-href-prefix job-name "%20(PDF)/lastStableBuild/artifact/tmp/en-US/pdf/" file-name "'>link</a>"))
(defn href-to-single-html
"Return a proper href to a single-html page generated by Jenkins job."
[job-name]
- (cond (gnome-job? job-name) (str jobs-href-prefix job-name "%20(html)/lastStableBuild/artifact/gnome-help/C/index.html")
- (appinfra-job? job-name) (str jobs-href-prefix job-name "%20(html-single)/lastStableBuild/artifact/index.html")
- :else (str jobs-href-prefix job-name "%20(html-single)/lastStableBuild/artifact/tmp/en-US/html-single/index.html")))
- ;(str "<a href='" jobs-href-prefix job-name "%20(html-single)/lastStableBuild/artifact/tmp/en-US/html-single/index.html'>link</a>"))
+ (cond (gnome-job? job-name) (str config/jobs-href-prefix job-name "%20(html)/lastStableBuild/artifact/gnome-help/C/index.html")
+ (appinfra-job? job-name) (str config/jobs-href-prefix job-name "%20(html-single)/lastStableBuild/artifact/index.html")
+ :else (str config/jobs-href-prefix job-name "%20(html-single)/lastStableBuild/artifact/tmp/en-US/html-single/index.html")))
+ ;(str "<a href='" config/jobs-href-prefix job-name "%20(html-single)/lastStableBuild/artifact/tmp/en-US/html-single/index.html'>link</a>"))
(defn href-to-file-middleware
[job-name-prefix job-name-postfix extension]
- (str jobs-href-prefix job-name-prefix "/lastStableBuild/artifact/output/" job-name-postfix "/" job-name-postfix "." extension))
+ (str config/jobs-href-prefix job-name-prefix "/lastStableBuild/artifact/output/" job-name-postfix "/" job-name-postfix "." extension))
(defn href-to-pdf-middleware
[job-name-prefix job-name-postfix]
@@ -133,25 +114,25 @@
(defn pdf-exists?
"Test for existence of PDF file(s) generated by Jenkins."
[job-name]
- (let [directory (new-file (str jobs-dir-prefix job-name " (PDF)/lastStable/archive/tmp/en-US/pdf/"))
+ (let [directory (fileutils/new-file (str config/jobs-dir-prefix job-name " (PDF)/lastStable/archive/tmp/en-US/pdf/"))
filelist (.listFiles directory)]
(>= 1 (count filelist))))
(defn file-exists?
"Check of existence of given file."
[file-name]
- (let [file (new-file file-name)]
+ (let [file (fileutils/new-file file-name)]
(and (.exists file) (not (.isDirectory file)))))
(defn test-summary-exists?
"Test for existence of summary file generated by Emender."
[job-name]
- (file-exists? (str test-results-prefix job-name ".summary")))
+ (file-exists? (str config/test-results-prefix job-name ".summary")))
(defn test-results-exists?
"Test for existence of result file generated by Emender."
[job-name]
- (file-exists? (str test-results-prefix job-name ".html")))
+ (file-exists? (str config/test-results-prefix job-name ".html")))
(defn compute-percents
"Compute percentage of passed/failed tests."
@@ -168,7 +149,7 @@
(defn read-test-results
"Read test results generated by Emender."
[job-name]
- (let [summary-file-name (str test-results-prefix job-name ".summary")
+ (let [summary-file-name (str config/test-results-prefix job-name ".summary")
summary-as-string (slurp summary-file-name)
test-summary (clojure.string/split-lines summary-as-string)
total-tests (read-string (first test-summary))
@@ -182,7 +163,7 @@
[(str "Passed: " formatted-passed-percent " Failed: " formatted-failed-percent)
passed-percent
failed-percent
- (str test-results-url-prefix job-name ".html")]))
+ (str config/test-results-url-prefix job-name ".html")]))
(defn try-to-read-test-results
"Read test results generated by Emender, but only if results exist."
@@ -196,7 +177,7 @@
(defn get-path-to-pdf-publican-book
[job-name]
- (let [directory (new-file (str jobs-dir-prefix job-name " (PDF)/lastStable/archive/tmp/en-US/pdf/"))
+ (let [directory (fileutils/new-file (str config/jobs-dir-prefix job-name " (PDF)/lastStable/archive/tmp/en-US/pdf/"))
filelist (.listFiles directory)]
(if (<= 1 (count filelist))
(href-to-pdf job-name (.getName (first filelist)))
@@ -206,7 +187,7 @@
[job-name extension]
(let [job-name-prefix (get-job-name-prefix job-name)
job-name-postfix (get-job-name-postfix job-name)
- path-to-file (str jobs-dir-prefix job-name-prefix "/lastStable/archive/output/" job-name-postfix "/" job-name-postfix "." extension)]
+ path-to-file (str config/jobs-dir-prefix job-name-prefix "/lastStable/archive/output/" job-name-postfix "/" job-name-postfix "." extension)]
path-to-file))
(defn get-path-to-middleware-job-html
@@ -220,7 +201,7 @@
(defn pdf-exists-middleware-job?
[job-name]
(let [path-to-html (get-path-to-middleware-job-pdf job-name)
- file (new-file path-to-html)]
+ file (fileutils/new-file path-to-html)]
(.isFile file)))
(defn get-path-to-pdf-middleware-book
@@ -240,23 +221,23 @@
(defn html-exists-gnome-job?
[job-name]
- (let [file (new-file (str jobs-dir-prefix job-name " (html)/lastStable/archive/gnome-help/C/index.html"))]
+ (let [file (fileutils/new-file (str config/jobs-dir-prefix job-name " (html)/lastStable/archive/gnome-help/C/index.html"))]
(.isFile file)))
(defn html-exists-publican-job?
[job-name]
- (let [file (new-file (str jobs-dir-prefix job-name " (html-single)/lastStable/archive/tmp/en-US/html-single/index.html"))]
+ (let [file (fileutils/new-file (str config/jobs-dir-prefix job-name " (html-single)/lastStable/archive/tmp/en-US/html-single/index.html"))]
(.isFile file)))
(defn html-exists-middleware-job?
[job-name]
(let [path-to-html (get-path-to-middleware-job-html job-name)
- file (new-file path-to-html)]
+ file (fileutils/new-file path-to-html)]
(.isFile file)))
(defn html-exists-appinfra-job?
[job-name]
- (let [file (new-file (str jobs-dir-prefix job-name " (html-single)/lastStable/archive/index.html"))]
+ (let [file (fileutils/new-file (str config/jobs-dir-prefix job-name " (html-single)/lastStable/archive/index.html"))]
(.isFile file)))
(defn html-exists?
@@ -269,14 +250,14 @@
(defn get-path-to-html-publican-book
[job-name]
- (let [file (new-file (str jobs-dir-prefix job-name " (html-single)/lastStable/archive/tmp/en-US/html-single/index.html"))]
+ (let [file (fileutils/new-file (str config/jobs-dir-prefix job-name " (html-single)/lastStable/archive/tmp/en-US/html-single/index.html"))]
(if (.isFile file)
(href-to-single-html job-name)
nil)))
(defn get-path-to-html-appinfra-book
[job-name]
- (let [file (new-file (str jobs-dir-prefix job-name " (html-single)/lastStable/archive/index.html"))]
+ (let [file (fileutils/new-file (str config/jobs-dir-prefix job-name " (html-single)/lastStable/archive/index.html"))]
(if (.isFile file)
(href-to-single-html job-name)
nil)))
@@ -284,7 +265,7 @@
(defn get-path-to-html-gnome-book
[job-name]
;example http://localhost:8080/job/doc-FuseSource-ActiveMQDocs/lastStableBuild/art...
- (let [file (new-file (str jobs-dir-prefix job-name " (html)/lastStable/archive/gnome-help/C/index.html"))]
+ (let [file (fileutils/new-file (str config/jobs-dir-prefix job-name " (html)/lastStable/archive/gnome-help/C/index.html"))]
(if (.isFile file)
(href-to-single-html job-name)
nil)))
@@ -307,19 +288,19 @@
(defn get-path-to-log-publican-book
[job-name]
- (let [directory (new-file (str jobs-dir-prefix job-name " (html-single)/lastStable/archive/tmp/en-US/html-single"))
+ (let [directory (fileutils/new-file (str config/jobs-dir-prefix job-name " (html-single)/lastStable/archive/tmp/en-US/html-single"))
filelist (.listFiles directory)]
(if (<= 1 (count filelist))
- (str jobs-href-prefix job-name "%20(html-single)/lastSuccessfulBuild/consoleText")
- (str jobs-href-prefix job-name "%20(html-single)/lastFailedBuild/consoleText"))))
+ (str config/jobs-href-prefix job-name "%20(html-single)/lastSuccessfulBuild/consoleText")
+ (str config/jobs-href-prefix job-name "%20(html-single)/lastFailedBuild/consoleText"))))
(defn get-path-to-log-gnome-book
[job-name]
- (let [directory (new-file (str jobs-dir-prefix job-name " (html)/lastStable/archive/tmp/en-US/pdf/"))
+ (let [directory (fileutils/new-file (str config/jobs-dir-prefix job-name " (html)/lastStable/archive/tmp/en-US/pdf/"))
filelist (.listFiles directory)]
(if (<= 1 (count filelist))
- (str jobs-href-prefix job-name "%20(html)/lastSuccessfulBuild/consoleText")
- (str jobs-href-prefix job-name "%20(html)/lastFailedBuild/consoleText"))))
+ (str config/jobs-href-prefix job-name "%20(html)/lastSuccessfulBuild/consoleText")
+ (str config/jobs-href-prefix job-name "%20(html)/lastFailedBuild/consoleText"))))
(defn get-path-to-log
"Get path to status and/or console output for the given job."
@@ -576,7 +557,7 @@
(defn read-job-info-as-json
"Fetch the timestamp and duration of the last build from Jenkins server."
[job-name]
- (let [full-json-url (str json-url "job/" (.replace job-name " " "%20") "/lastBuild/api/json?pretty=true")
+ (let [full-json-url (str config/json-url "job/" (.replace job-name " " "%20") "/lastBuild/api/json?pretty=true")
inputstr (slurp full-json-url)]
(if inputstr
(let [parsed (json/read-str inputstr)]
@@ -688,7 +669,7 @@
(defn overview-exists?
[product-name component-name]
(let [path-to-html (str "/var/www/html/overview/" product-name "/" component-name "/index.html")
- file (new-file path-to-html)]
+ file (fileutils/new-file path-to-html)]
(if (.isFile file) "ok" "")))
(defn get-books-for-product
@@ -869,7 +850,7 @@
(defn read-job-configuration
[job-name]
(let [updated-job-name (update-job-name-for-reading-configuration job-name)
- config-as-xml (xml-seq (xml/parse (str json-url "job/" updated-job-name "/config.xml")))
+ config-as-xml (xml-seq (xml/parse (str config/json-url "job/" updated-job-name "/config.xml")))
config (get-job-config-from-xml updated-job-name config-as-xml)]
[job-name config]))
@@ -906,12 +887,12 @@
(defn read-page-count-for-pdf-book
[file-name]
- (exec "./tools/read_page_count.sh" (.toString file-name))
+ (exec/exec "./tools/read_page_count.sh" (.toString file-name))
(Integer/parseInt (.trim (slurp "./page_count.txt"))))
(defn try-to-read-page-count-for-pdf-book
[job-name]
- (let [directory (new-file (str jobs-dir-prefix job-name "/lastStable/archive/tmp/en-US/pdf/"))
+ (let [directory (fileutils/new-file (str config/jobs-dir-prefix job-name "/lastStable/archive/tmp/en-US/pdf/"))
filelist (.listFiles directory)]
(if (= (count filelist) 1)
(read-page-count-for-pdf-book (first filelist))
@@ -1093,7 +1074,7 @@
(defn get-file-handler
"Return selected file handler or nil in case the handler is unknown."
[uri]
- (get file-handlers uri nil))
+ (file-handlers/get-file-handler uri))
(defn get-action-handler
"Return selected action handler or nil in case the handler is unknown."
9 years, 2 months
[jenkinscat-docs] master: File-related utils should be stored in separate file (and namespace). (a465181)
by Pete Travis
Repository : http://git.fedorahosted.org/cgit/jenkinscat-docs.git
On branch : master
>---------------------------------------------------------------
commit a465181960cf69659f5ff46c88ed909b0e4f6e50
Author: Pavel Tisnovsky <ptisnovs(a)redhat.com>
Date: Wed Dec 3 11:16:35 2014 +0100
File-related utils should be stored in separate file (and namespace).
>---------------------------------------------------------------
ChangeLog | 5 +++
src/jenkinscat/fileutils.clj | 82 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 87 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9a644ff..6801b54 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-03 Pavel Tisnovsky <ptisnovs(a)redhat.com>
+
+ * src/jenkinscat/fileutils.clj:
+ File-related utils should be stored in separate file (and namespace).
+
2014-12-02 Pavel Tisnovsky <ptisnovs(a)redhat.com>
* src/jenkinscat/exec.clj:
diff --git a/src/jenkinscat/fileutils.clj b/src/jenkinscat/fileutils.clj
new file mode 100644
index 0000000..b556a5a
--- /dev/null
+++ b/src/jenkinscat/fileutils.clj
@@ -0,0 +1,82 @@
+;;; Copyright (c) 2014 Pavel Tisnovsky, Red Hat
+;;; All rights reserved.
+;;;
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions are met:
+;;; * Redistributions of source code must retain the above copyright
+;;; notice, this list of conditions and the following disclaimer.
+;;; * Redistributions in binary form must reproduce the above copyright
+;;; notice, this list of conditions and the following disclaimer in the
+;;; documentation and/or other materials provided with the distribution.
+;;; * Neither the name of the Red Hat nor the
+;;; names of its contributors may be used to endorse or promote products
+;;; derived from this software without specific prior written permission.
+;;;
+;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+;;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+;;; DISCLAIMED. IN NO EVENT SHALL Pavel Tisnovsky BE LIABLE FOR ANY
+;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+;;; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+;;; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+;;; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+(ns jenkinscat.fileutils)
+
+(require '[jenkinscat.exec :as exec])
+
+(defn print-slurp-exception
+ "Print warning message to the standard output."
+ ([filename]
+ (println "Warning: cannot read content of the following file: " filename))
+ ([directory filename]
+ (println "Warning: cannot read content of the following file: " directory "/" filename)))
+
+(defn slurp-
+ "Alternative (slurp) implementation that does not throw an exception, but returns nil instead."
+ ([filename]
+ (try
+ (slurp filename)
+ (catch Exception e (print-slurp-exception filename))))
+ ([directory filename]
+ (try
+ (slurp (str directory "/" filename))
+ (catch Exception e (print-slurp-exception directory filename)))))
+
+(defn new-file
+ "Just a shortcut for (new java.io.File filename)."
+ ( [filename]
+ (new java.io.File filename))
+ ( [path filename]
+ (new java.io.File path filename)))
+
+(defn make-temporary-directory
+ "Make temporary directory that would reside in /tmp (at least on Linux)."
+ []
+ (let [basedir-name (System/getProperty "java.io.tmpdir")
+ base-name (str "jenkinscat-" (System/currentTimeMillis))
+ temp-dir (new java.io.File basedir-name base-name)]
+ (.mkdir temp-dir)
+ temp-dir))
+
+(defn remove-temporary-directory
+ "Remove (delete) temporary directory that resides in /tmp (at least on Linux)."
+ [directory-name]
+ (let [file (new java.io.File directory-name)
+ abs-path (.getAbsolutePath file)]
+ ; make sure we are not going to remove wrong directory!
+ (if (.startsWith abs-path "/tmp")
+ (exec/exec "/bin/rm -rf" abs-path))))
+
+(defn make-temporary-directory-name
+ "Make temporary directory name that would reside in /tmp (at least on Linux)."
+ []
+ (let [basedir-name (System/getProperty "java.io.tmpdir")
+ base-name (str "jenkinscat-" (System/currentTimeMillis))
+ temp-dir (new java.io.File basedir-name base-name)]
+ (.getAbsolutePath temp-dir)))
+
9 years, 2 months