aboutsummaryrefslogtreecommitdiff
path: root/nixops/modules/buildbot
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-03-24 23:59:04 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-03-24 23:59:04 +0100
commitcaa08508100ce2307a4c64ff047241572ff85b45 (patch)
tree0a7ceca1aa776d8fa7332b2d3536abcdbdcbf31d /nixops/modules/buildbot
parent2368a4b7e827b985c3758ad0bfe13e4a08d27c36 (diff)
downloadNix-caa08508100ce2307a4c64ff047241572ff85b45.tar.gz
Nix-caa08508100ce2307a4c64ff047241572ff85b45.tar.zst
Nix-caa08508100ce2307a4c64ff047241572ff85b45.zip
Upgrade mysql and postgresql
Diffstat (limited to 'nixops/modules/buildbot')
-rw-r--r--nixops/modules/buildbot/default.nix40
1 files changed, 21 insertions, 19 deletions
diff --git a/nixops/modules/buildbot/default.nix b/nixops/modules/buildbot/default.nix
index 9b661f1..3962e65 100644
--- a/nixops/modules/buildbot/default.nix
+++ b/nixops/modules/buildbot/default.nix
@@ -1,21 +1,23 @@
1{ lib, pkgs, pkgsNext, config, myconfig, mylibs, ... }: 1{ lib, pkgs, pkgsNext, config, myconfig, mylibs, ... }:
2let 2let
3 pkgs = pkgsNext.appendOverlays config.nixpkgs.overlays;
4
3 varDir = "/var/lib/buildbot"; 5 varDir = "/var/lib/buildbot";
4 buildslist_src = mylibs.fetchedGitPrivate ./buildslist.json; 6 buildslist_src = mylibs.fetchedGitPrivate ./buildslist.json;
5 buildslist_yarn = pkgsNext.yarn2nix.mkYarnModules { 7 buildslist_yarn = pkgs.yarn2nix.mkYarnModules {
6 name = "buildslist-yarn-modules"; 8 name = "buildslist-yarn-modules";
7 packageJSON = "${buildslist_src.src}/package.json"; 9 packageJSON = "${buildslist_src.src}/package.json";
8 yarnLock = "${buildslist_src.src}/yarn.lock"; 10 yarnLock = "${buildslist_src.src}/yarn.lock";
9 }; 11 };
10 buildslist_bower = pkgsNext.buildBowerComponents { 12 buildslist_bower = pkgs.buildBowerComponents {
11 name = "buildslist"; 13 name = "buildslist";
12 generated = ./bower.nix; 14 generated = ./bower.nix;
13 src = "${buildslist_src.src}/guanlecoja/"; 15 src = "${buildslist_src.src}/guanlecoja/";
14 }; 16 };
15 17
16 buildslist = pkgsNext.python3Packages.buildPythonPackage rec { 18 buildslist = pkgs.python3Packages.buildPythonPackage rec {
17 pname = "buildbot-buildslist"; 19 pname = "buildbot-buildslist";
18 inherit (pkgsNext.buildbot-pkg) version; 20 inherit (pkgs.buildbot-pkg) version;
19 21
20 preConfigure = '' 22 preConfigure = ''
21 export HOME=$PWD 23 export HOME=$PWD
@@ -24,26 +26,26 @@ let
24 cp -a ${buildslist_bower}/bower_components ./libs 26 cp -a ${buildslist_bower}/bower_components ./libs
25 chmod -R u+w libs 27 chmod -R u+w libs
26 ''; 28 '';
27 propagatedBuildInputs = with pkgsNext.python3Packages; [ 29 propagatedBuildInputs = with pkgs.python3Packages; [
28 (klein.overridePythonAttrs(old: { checkPhase = ""; })) 30 (klein.overridePythonAttrs(old: { checkPhase = ""; }))
29 buildbot-pkg 31 buildbot-pkg
30 ]; 32 ];
31 nativeBuildInputs = with pkgsNext; [ yarn nodejs ]; 33 nativeBuildInputs = with pkgs; [ yarn nodejs ];
32 buildInputs = [ buildslist_yarn buildslist_bower ]; 34 buildInputs = [ buildslist_yarn buildslist_bower ];
33 35
34 doCheck = false; 36 doCheck = false;
35 src = buildslist_src.src; 37 src = buildslist_src.src;
36 }; 38 };
37 buildbot_common = pkgsNext.python3Packages.buildPythonPackage rec { 39 buildbot_common = pkgs.python3Packages.buildPythonPackage rec {
38 name = "buildbot_common"; 40 name = "buildbot_common";
39 src = ./common; 41 src = ./common;
40 format = "other"; 42 format = "other";
41 installPhase = '' 43 installPhase = ''
42 mkdir -p $out/${pkgsNext.python3.pythonForBuild.sitePackages} 44 mkdir -p $out/${pkgs.python3.pythonForBuild.sitePackages}
43 cp -a $src $out/${pkgsNext.python3.pythonForBuild.sitePackages}/buildbot_common 45 cp -a $src $out/${pkgs.python3.pythonForBuild.sitePackages}/buildbot_common
44 ''; 46 '';
45 }; 47 };
46 buildbot = pkgsNext.python3Packages.buildbot-full.withPlugins ([ buildslist ]); 48 buildbot = pkgs.python3Packages.buildbot-full.withPlugins ([ buildslist ]);
47in 49in
48{ 50{
49 options = { 51 options = {
@@ -90,7 +92,7 @@ in
90 system.activationScripts = lib.attrsets.mapAttrs' (k: project: lib.attrsets.nameValuePair "buildbot-${project.name}" { 92 system.activationScripts = lib.attrsets.mapAttrs' (k: project: lib.attrsets.nameValuePair "buildbot-${project.name}" {
91 deps = [ "users" "wrappers" ]; 93 deps = [ "users" "wrappers" ];
92 text = let 94 text = let
93 master-cfg = "${buildbot_common}/${pkgsNext.python3.pythonForBuild.sitePackages}/buildbot_common/master.cfg"; 95 master-cfg = "${buildbot_common}/${pkgs.python3.pythonForBuild.sitePackages}/buildbot_common/master.cfg";
94 buildbot_key = pkgs.writeText "buildbot_key" (builtins.readFile "${myconfig.privateFiles}/buildbot_ssh_key"); 96 buildbot_key = pkgs.writeText "buildbot_key" (builtins.readFile "${myconfig.privateFiles}/buildbot_ssh_key");
95 tac_file = pkgs.writeText "buildbot.tac" '' 97 tac_file = pkgs.writeText "buildbot.tac" ''
96 import os 98 import os
@@ -151,24 +153,24 @@ in
151 description = "Buildbot Continuous Integration Server ${project.name}."; 153 description = "Buildbot Continuous Integration Server ${project.name}.";
152 after = [ "network-online.target" ]; 154 after = [ "network-online.target" ];
153 wantedBy = [ "multi-user.target" ]; 155 wantedBy = [ "multi-user.target" ];
154 path = project.packages pkgs ++ (project.pythonPackages buildbot.pythonModule pkgsNext); 156 path = project.packages pkgs ++ (project.pythonPackages buildbot.pythonModule pkgs);
155 environment = let 157 environment = let
156 project_env = lib.attrsets.mapAttrs' (k: v: lib.attrsets.nameValuePair "BUILDBOT_${k}" v) project.environment; 158 project_env = lib.attrsets.mapAttrs' (k: v: lib.attrsets.nameValuePair "BUILDBOT_${k}" v) project.environment;
157 buildbot_config = pkgsNext.python3Packages.buildPythonPackage (rec { 159 buildbot_config = pkgs.python3Packages.buildPythonPackage (rec {
158 name = "buildbot_config-${project.name}"; 160 name = "buildbot_config-${project.name}";
159 src = ./projects + "/${project.name}"; 161 src = ./projects + "/${project.name}";
160 format = "other"; 162 format = "other";
161 installPhase = '' 163 installPhase = ''
162 mkdir -p $out/${pkgsNext.python3.pythonForBuild.sitePackages} 164 mkdir -p $out/${pkgs.python3.pythonForBuild.sitePackages}
163 cp -a $src $out/${pkgsNext.python3.pythonForBuild.sitePackages}/buildbot_config 165 cp -a $src $out/${pkgs.python3.pythonForBuild.sitePackages}/buildbot_config
164 ''; 166 '';
165 }); 167 });
166 HOME = "${varDir}/${project.name}"; 168 HOME = "${varDir}/${project.name}";
167 PYTHONPATH = "${buildbot.pythonModule.withPackages (self: project.pythonPackages self pkgsNext ++ [ 169 PYTHONPATH = "${buildbot.pythonModule.withPackages (self: project.pythonPackages self pkgs ++ [
168 pkgsNext.python3Packages.treq pkgsNext.python3Packages.ldap3 buildbot 170 pkgs.python3Packages.treq pkgs.python3Packages.ldap3 buildbot
169 pkgsNext.python3Packages.buildbot-worker 171 pkgs.python3Packages.buildbot-worker
170 buildbot_common buildbot_config 172 buildbot_common buildbot_config
171 ])}/${buildbot.pythonModule.sitePackages}${if project.pythonPathHome then ":${varDir}/${project.name}/.local/${pkgsNext.python3.pythonForBuild.sitePackages}" else ""}"; 173 ])}/${buildbot.pythonModule.sitePackages}${if project.pythonPathHome then ":${varDir}/${project.name}/.local/${pkgs.python3.pythonForBuild.sitePackages}" else ""}";
172 in project_env // { inherit PYTHONPATH HOME; }; 174 in project_env // { inherit PYTHONPATH HOME; };
173 175
174 serviceConfig = { 176 serviceConfig = {