aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-02-08 23:49:37 +0530
committerArun Isaac2022-02-09 00:06:19 +0530
commitc1837714c0dd2cf12d914d1236083e6f04aa0012 (patch)
tree7362c3ab794f4d81e0df5a4fdef591c166720254
parent2d52e570a86096366cd09700be21d29c1fc42655 (diff)
downloadguix-forge-c1837714c0dd2cf12d914d1236083e6f04aa0012.tar.gz
guix-forge-c1837714c0dd2cf12d914d1236083e6f04aa0012.tar.lz
guix-forge-c1837714c0dd2cf12d914d1236083e6f04aa0012.zip
forge: Rename post-receive-hook to ci-jobs-trigger-script.
ci-jobs-trigger is a more generic term, and better reflects its use not only as a post-receive hook, but also as a cron job. Later, ci-jobs-trigger will also be used as a webhook command. * forge/forge.scm (post-receive-hook): Rename to ci-jobs-trigger-script. (forge-activation, forge-service-type): Invoke ci-jobs-trigger-script instead of post-receive-hook.
-rw-r--r--forge/forge.scm15
1 files changed, 8 insertions, 7 deletions
diff --git a/forge/forge.scm b/forge/forge.scm
index 95f9894..b182c6d 100644
--- a/forge/forge.scm
+++ b/forge/forge.scm
@@ -105,9 +105,10 @@ described by <forge-derivation-job> objects, transform them to
job))
(forge-project-configuration-ci-jobs project)))
-(define (post-receive-hook project-name ci-jobs)
- "Return a git post-receive-hook that triggers CI-JOBS."
- (program-file (string-append project-name "-post-receive-hook")
+(define (ci-jobs-trigger-script project-name ci-jobs)
+ "Return a script, a file-like object, that triggers CI-JOBS of
+PROJECT-NAME."
+ (program-file (string-append project-name "-ci-jobs-trigger")
(with-imported-modules '((guix build utils))
#~(begin
(use-modules (guix build utils))
@@ -125,7 +126,7 @@ described by <forge-derivation-job> objects, transform them to
(forge-project-configuration-repository project)
(forge-project-configuration-description project)
(forge-project-configuration-website-directory project)
- (post-receive-hook
+ (ci-jobs-trigger-script
(forge-project-configuration-name project)
(map forge-laminar-job-name
(forge-project-configuration-laminar-jobs project config)))))
@@ -142,7 +143,7 @@ described by <forge-derivation-job> objects, transform them to
#:directories? #t))
(for-each (match-lambda
- ((username repository description website-directory post-receive-hook)
+ ((username repository description website-directory ci-jobs-trigger)
;; For local repositories only
(when (string-prefix? "/" repository)
;; Set description.
@@ -153,7 +154,7 @@ described by <forge-derivation-job> objects, transform them to
(let ((hook-link (string-append repository "/hooks/post-receive")))
(when (file-exists? hook-link)
(delete-file hook-link))
- (symlink post-receive-hook hook-link))
+ (symlink ci-jobs-trigger hook-link))
;; Set ownership of repository files.
(for-each (lambda (file)
(let ((user (getpw username)))
@@ -248,7 +249,7 @@ derivation to run."
(and (not (string-prefix?
"/" (forge-project-configuration-repository project)))
#~(job '(next-day)
- #$(post-receive-hook
+ #$(ci-jobs-trigger-script
(forge-project-configuration-name project)
(map forge-laminar-job-name
(forge-project-configuration-laminar-jobs project config)))