From db5921f163c59673ae0307088cd14bdda836c6d8 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 6 Sep 2018 22:34:33 +0200 Subject: repo-sync: announcemnaster --- krebs/2configs/repo-sync.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/krebs/2configs/repo-sync.nix b/krebs/2configs/repo-sync.nix index 7c3b2c90e..0f3d3326f 100644 --- a/krebs/2configs/repo-sync.nix +++ b/krebs/2configs/repo-sync.nix @@ -20,7 +20,10 @@ let verbose = false; channel = "#xxx"; server = "irc.r"; - branches = [ "newest" ]; + branches = [ + "master" + "newest" + ]; }; }; }; -- cgit v1.2.3 From aa04423e3a313271fca4d951d8717459e7969d60 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 6 Sep 2018 23:02:56 +0200 Subject: irc-announce: whitelist refs instead of branches --- krebs/2configs/repo-sync.nix | 12 ++++++------ krebs/5pkgs/simple/git-hooks/default.nix | 15 ++++++++------- lass/2configs/git.nix | 13 +++++++++---- lass/2configs/repo-sync.nix | 6 ++++-- 4 files changed, 27 insertions(+), 19 deletions(-) diff --git a/krebs/2configs/repo-sync.nix b/krebs/2configs/repo-sync.nix index 0f3d3326f..1ae6d6c11 100644 --- a/krebs/2configs/repo-sync.nix +++ b/krebs/2configs/repo-sync.nix @@ -16,14 +16,14 @@ let cgit.section = section; hooks = mkDefault { post-receive = pkgs.git-hooks.irc-announce { - nick = config.networking.hostName; - verbose = false; channel = "#xxx"; - server = "irc.r"; - branches = [ - "master" - "newest" + refs = [ + "refs/heads/master" + "refs/heads/newest" ]; + nick = config.networking.hostName; + server = "irc.r"; + verbose = false; }; }; }; diff --git a/krebs/5pkgs/simple/git-hooks/default.nix b/krebs/5pkgs/simple/git-hooks/default.nix index 1930c7f14..0a2c84410 100644 --- a/krebs/5pkgs/simple/git-hooks/default.nix +++ b/krebs/5pkgs/simple/git-hooks/default.nix @@ -6,11 +6,11 @@ with import ; # TODO irc-announce should return a derivation # but it cannot because krebs.git.repos.*.hooks :: attrsOf str irc-announce = - { branches ? [] - , cgit_endpoint ? "http://cgit.${nick}.r" + { cgit_endpoint ? "http://cgit.${nick}.r" , channel , nick , port ? 6667 + , refs ? [] , server , verbose ? false }: /* sh */ '' @@ -57,14 +57,15 @@ with import ; receive_mode=non-fast-forward fi - h=$(echo $ref | sed 's:^refs/heads/::') - - ${optionalString (branches != []) '' - if ! (echo "$h" | grep -qE "${concatStringsSep "|" branches}"); then - echo "we are not serving this branch: $h" + ${optionalString (refs != []) '' + if ! { echo "$ref" | grep -qE "${concatStringsSep "|" refs}"; }; then + echo "we are not announcing this ref: $h" exit 0 fi ''} + + h=$(echo $ref | sed 's:^refs/heads/::') + # empty_tree=$(git hash-object -t tree /dev/null) empty_tree=4b825dc6 diff --git a/lass/2configs/git.nix b/lass/2configs/git.nix index 829e62269..011c6022c 100644 --- a/lass/2configs/git.nix +++ b/lass/2configs/git.nix @@ -100,10 +100,12 @@ let # TODO make nick = config.krebs.build.host.name the default nick = config.krebs.build.host.name; channel = "#xxx"; + # TODO define refs in some kind of option per repo + refs = [ + "refs/heads/master" + ]; server = "irc.r"; verbose = config.krebs.build.host.name == "prism"; - # TODO define branches in some kind of option per repo - branches = [ "master" ]; }; }; }; @@ -121,10 +123,13 @@ let # TODO make nick = config.krebs.build.host.name the default nick = config.krebs.build.host.name; channel = "#xxx"; + # TODO define refs in some kind of option per repo + refs = [ + "refs/heads/master" + "refs/heads/staging*" + ]; server = "irc.r"; verbose = false; - # TODO define branches in some kind of option per repo - branches = [ "master" "staging*" ]; }; } // hooks; }; diff --git a/lass/2configs/repo-sync.nix b/lass/2configs/repo-sync.nix index 6a07172fe..8b7d0db71 100644 --- a/lass/2configs/repo-sync.nix +++ b/lass/2configs/repo-sync.nix @@ -14,10 +14,12 @@ let hooks = mkIf announce (mkDefault { post-receive = pkgs.git-hooks.irc-announce { nick = config.networking.hostName; - verbose = false; channel = "#xxx"; + refs = [ + "refs/heads/newest" + ]; server = "irc.r"; - branches = [ "newest" ]; + verbose = false; }; }); }; -- cgit v1.2.3 From 86466154f11748365cdab50b6ac113bdfd5542be Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 6 Sep 2018 23:04:24 +0200 Subject: repo-sync: announce tags --- krebs/2configs/repo-sync.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/krebs/2configs/repo-sync.nix b/krebs/2configs/repo-sync.nix index 1ae6d6c11..13e1217a4 100644 --- a/krebs/2configs/repo-sync.nix +++ b/krebs/2configs/repo-sync.nix @@ -20,6 +20,7 @@ let refs = [ "refs/heads/master" "refs/heads/newest" + "refs/tags/*" ]; nick = config.networking.hostName; server = "irc.r"; -- cgit v1.2.3 From 29e5989265bf2f1f8df3dd83706abf791fc63712 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 7 Sep 2018 00:04:24 +0200 Subject: jeschli git: fix irc-announce call --- jeschli/2configs/git.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jeschli/2configs/git.nix b/jeschli/2configs/git.nix index 77602e0f1..181ad8dc1 100644 --- a/jeschli/2configs/git.nix +++ b/jeschli/2configs/git.nix @@ -42,11 +42,13 @@ let public = true; hooks = { post-receive = pkgs.git-hooks.irc-announce { - nick = config.krebs.build.host.name; channel = "#xxx"; + nick = config.krebs.build.host.name; + refs = [ + "refs/heads/master" + ]; server = "irc.r"; - verbose = true; - branches = [ "master" ]; + verbose = true; }; }; }; -- cgit v1.2.3