aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMunyoki Kilyungi2024-02-08 22:18:12 +0300
committerMunyoki Kilyungi2024-02-08 22:18:12 +0300
commit5133b894b2f3f8e817054421728bd16a9a5dcf03 (patch)
treea16469b9968132e635454cf553f69f986a37a224 /examples
parent29ddf26bf8367c1d76d85331ba5253835ff74bf7 (diff)
downloadgn-transform-databases-5133b894b2f3f8e817054421728bd16a9a5dcf03.tar.gz
Add method for commiting changes to the gn-docs git repo.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/dataset-metadata-git.scm21
1 files changed, 16 insertions, 5 deletions
diff --git a/examples/dataset-metadata-git.scm b/examples/dataset-metadata-git.scm
index 3be4cdb..371d844 100755
--- a/examples/dataset-metadata-git.scm
+++ b/examples/dataset-metadata-git.scm
@@ -6,8 +6,7 @@
(srfi srfi-26)
((ice-9 regex) #:select (regexp-substitute/global))
((transform strings) #:select (string-blank?))
- ((transform sql) #:select (call-with-target-database sql-for-each))
- ((transform triples) #:select (string->identifier)))
+ ((transform sql) #:select (call-with-target-database sql-for-each)))
(define (save-file file result)
(when result
@@ -57,6 +56,16 @@
("experiment-design.rtf" . ,experiment-design)
("acknowledgment.rtf" . ,acknowledgment)))))
+(define* (commit-changes
+ directory
+ #:optional (commit-message "Update dataset RTF Files."))
+ (chdir directory)
+ (system "git reset --hard origin")
+ (system "git pull")
+ (system "git add .")
+ (system (format #f "git commit -m ~s" commit-message))
+ (system "sudo git push /home/git/public/gn-docs"))
+
(let* ((option-spec
'((settings (single-char #\s) (value #t))))
(options (getopt-long (command-line) option-spec))
@@ -64,14 +73,16 @@
(query "SELECT InfoPageName, Datasets.Summary, Datasets.AboutTissue, InfoFiles.Specifics,
Datasets.AboutCases, Datasets.AboutPlatform, Datasets.AboutDataProcessing,
Datasets.Notes, Datasets.ExperimentDesign, Datasets.Acknowledgment
-FROM InfoFiles LEFT JOIN Datasets USING (DatasetId) LIMIT 2")
+FROM InfoFiles LEFT JOIN Datasets USING (DatasetId)")
(%connection-settings
(call-with-input-file settings
read)))
- ;; TODO
(call-with-target-database
%connection-settings
(lambda (db)
(sql-for-each infopages/sql->rtf
db
- query))))
+ query)
+ (commit-changes "/export/data/genenetwork/gn-docs/datasets/"))))
+
+