about summary refs log tree commit diff
path: root/nixos/modules/services/continuous-integration
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2016-08-10 15:47:29 -0400
committerGraham Christensen <graham@grahamc.com>2016-08-10 15:47:29 -0400
commitd969f3fa5110b458bbfe5d12774024a6329a6580 (patch)
tree9937ff6cc379cec2341c57b925b52bf70140938b /nixos/modules/services/continuous-integration
parent26d25774fae5b60c0c5ddbf37bae163c9569e4ff (diff)
downloadnixlib-d969f3fa5110b458bbfe5d12774024a6329a6580.tar
nixlib-d969f3fa5110b458bbfe5d12774024a6329a6580.tar.gz
nixlib-d969f3fa5110b458bbfe5d12774024a6329a6580.tar.bz2
nixlib-d969f3fa5110b458bbfe5d12774024a6329a6580.tar.lz
nixlib-d969f3fa5110b458bbfe5d12774024a6329a6580.tar.xz
nixlib-d969f3fa5110b458bbfe5d12774024a6329a6580.tar.zst
nixlib-d969f3fa5110b458bbfe5d12774024a6329a6580.zip
gocd-agent: 16.7.0 startup fixes + test improvements
 - Agent now takes a full URL to the Go.CD server
 - Instruct the agent to attempt restart every 30s upon failure
 - Test's Accept header did not match the server's expectation
 - Replace the tests' complex Awk matches with calls to `jq`
Diffstat (limited to 'nixos/modules/services/continuous-integration')
-rw-r--r--nixos/modules/services/continuous-integration/gocd-agent/default.nix23
1 files changed, 8 insertions, 15 deletions
diff --git a/nixos/modules/services/continuous-integration/gocd-agent/default.nix b/nixos/modules/services/continuous-integration/gocd-agent/default.nix
index bc6c6d5a2582..21f319f7fcf6 100644
--- a/nixos/modules/services/continuous-integration/gocd-agent/default.nix
+++ b/nixos/modules/services/continuous-integration/gocd-agent/default.nix
@@ -57,18 +57,10 @@ in {
       };
 
       goServer = mkOption {
-        default = "127.0.0.1";
+        default = "https://127.0.0.1:8154/go";
         type = types.str;
         description = ''
-          Address of GoCD Server to attach the Go.CD Agent to.
-        '';
-      };
-
-      goServerPort = mkOption {
-        default = 8153;
-        type = types.int;
-        description = ''
-          Port that Go.CD Server is Listening on.
+          URL of the GoCD Server to attach the Go.CD Agent to.
         '';
       };
 
@@ -112,8 +104,8 @@ in {
 
       extraOptions = mkOption {
         default = [ ];
-        example = [ 
-          "-X debug" 
+        example = [
+          "-X debug"
           "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5006"
           "-verbose:gc"
           "-Xloggc:go-agent-gc.log"
@@ -170,7 +162,7 @@ in {
               config.environment.sessionVariables;
         in
           selectedSessionVars //
-            { 
+            {
               NIX_REMOTE = "daemon";
               AGENT_WORK_DIR = cfg.workDir;
               AGENT_STARTUP_ARGS = ''${concatStringsSep " "  cfg.startupOptions}'';
@@ -199,13 +191,14 @@ in {
         ${pkgs.jre}/bin/java ${concatStringsSep " " cfg.startupOptions} \
                         ${concatStringsSep " " cfg.extraOptions} \
                               -jar ${pkgs.gocd-agent}/go-agent/agent-bootstrapper.jar \
-                              ${cfg.goServer} \
-                              ${toString cfg.goServerPort}
+                              -serverUrl ${cfg.goServer}
       '';
 
       serviceConfig = {
         User = cfg.user;
         WorkingDirectory = cfg.workDir;
+        RestartSec = 30;
+        Restart = "on-failure";
       };
     };
   };