aboutsummaryrefslogtreecommitdiff
path: root/forge/build
diff options
context:
space:
mode:
authorArun Isaac2022-02-10 00:00:37 +0530
committerArun Isaac2022-02-10 00:00:37 +0530
commit53a114dd456211364f729f74918775c9133cc67b (patch)
tree87e6c73c62ff6ff7e0bc9fde200a73395a6e5bb2 /forge/build
parent8bc27ffef8f6636aeb2ef9f58b2fe205d812ce7a (diff)
downloadguix-forge-53a114dd456211364f729f74918775c9133cc67b.tar.gz
guix-forge-53a114dd456211364f729f74918775c9133cc67b.tar.lz
guix-forge-53a114dd456211364f729f74918775c9133cc67b.zip
forge: Print current commit before running CI job.
This aids debugging especially when a job fails. * forge/build/git.scm (hline): New function. (download-git-to-store): Add #:show-commit? keyword argument. When show-commit? is #t, print current commit. * forge/forge.scm (gexp-producer->job-script): Pass #t as #:show-commit? to latest-git-checkout.
Diffstat (limited to 'forge/build')
-rw-r--r--forge/build/git.scm12
1 files changed, 11 insertions, 1 deletions
diff --git a/forge/build/git.scm b/forge/build/git.scm
index 2e3dc41..444e3d6 100644
--- a/forge/build/git.scm
+++ b/forge/build/git.scm
@@ -34,7 +34,13 @@
;;; Code:
-(define (download-git-to-store store name url branch)
+(define (hline)
+ "Print a horizontal line 50 '=' characters long."
+ (display (make-string 50 #\=))
+ (newline)
+ (force-output))
+
+(define* (download-git-to-store store name url branch #:key show-commit?)
"Download BRANCH of git repository from URL to STORE under NAME and
return store path. git and certificates should be in the environment."
(call-with-temporary-directory
@@ -48,6 +54,10 @@ return store path. git and certificates should be in the environment."
(invoke-error-exit-status condition))
(exit #f)))
(invoke "git" "clone" "--quiet" "--depth" "1" "--branch" branch url "."))
+ (when show-commit?
+ (hline)
+ (invoke "git" "--no-pager" "log")
+ (hline))
(delete-file-recursively ".git"))
(add-to-store store name #t "sha256" directory))))