mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-12 15:14:13 +00:00
nixos/buildkite-agent: change option meta-data into tags attrset
This is called tags in the buildkite 3.
This commit is contained in:
parent
e1ad9d1685
commit
63c310c07e
@ -74,13 +74,12 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
meta-data = mkOption {
|
tags = mkOption {
|
||||||
type = types.str;
|
type = types.attrsOf types.str;
|
||||||
default = "";
|
default = {};
|
||||||
example = "queue=default,docker=true,ruby2=true";
|
example = { queue = "default"; docker = "true"; ruby2 ="true"; };
|
||||||
description = ''
|
description = ''
|
||||||
Meta data for the agent. This is a comma-separated list of
|
Tags for the agent.
|
||||||
<code>key=value</code> pairs.
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -211,9 +210,7 @@ in
|
|||||||
## don't end up in the Nix store.
|
## don't end up in the Nix store.
|
||||||
preStart = let
|
preStart = let
|
||||||
sshDir = "${cfg.dataDir}/.ssh";
|
sshDir = "${cfg.dataDir}/.ssh";
|
||||||
metaData = if cfg.meta-data == ""
|
tagStr = lib.concatStringsSep "," (lib.mapAttrsToList (name: value: "${name}=${value}") cfg.tags);
|
||||||
then ""
|
|
||||||
else "meta-data=${cfg.meta-data}";
|
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
mkdir -m 0700 -p "${sshDir}"
|
mkdir -m 0700 -p "${sshDir}"
|
||||||
@ -223,8 +220,8 @@ in
|
|||||||
cat > "${cfg.dataDir}/buildkite-agent.cfg" <<EOF
|
cat > "${cfg.dataDir}/buildkite-agent.cfg" <<EOF
|
||||||
token="$(cat ${toString cfg.tokenPath})"
|
token="$(cat ${toString cfg.tokenPath})"
|
||||||
name="${cfg.name}"
|
name="${cfg.name}"
|
||||||
${metaData}
|
|
||||||
shell="${cfg.shell}"
|
shell="${cfg.shell}"
|
||||||
|
tags="${tagStr}"
|
||||||
build-path="${cfg.dataDir}/builds"
|
build-path="${cfg.dataDir}/builds"
|
||||||
hooks-path="${cfg.hooksPath}"
|
hooks-path="${cfg.hooksPath}"
|
||||||
${cfg.extraConfig}
|
${cfg.extraConfig}
|
||||||
@ -258,5 +255,6 @@ in
|
|||||||
(mkRenamedOptionModule [ "services" "buildkite-agent" "openssh" "privateKeyPath" ] [ "services" "buildkite-agent" "privateSshKeyPath" ])
|
(mkRenamedOptionModule [ "services" "buildkite-agent" "openssh" "privateKeyPath" ] [ "services" "buildkite-agent" "privateSshKeyPath" ])
|
||||||
(mkRemovedOptionModule [ "services" "buildkite-agent" "openssh" "publicKey" ] "SSH public keys aren't necessary to clone private repos.")
|
(mkRemovedOptionModule [ "services" "buildkite-agent" "openssh" "publicKey" ] "SSH public keys aren't necessary to clone private repos.")
|
||||||
(mkRemovedOptionModule [ "services" "buildkite-agent" "openssh" "publicKeyPath" ] "SSH public keys aren't necessary to clone private repos.")
|
(mkRemovedOptionModule [ "services" "buildkite-agent" "openssh" "publicKeyPath" ] "SSH public keys aren't necessary to clone private repos.")
|
||||||
|
(mkRenamedOptionModule [ "services" "buildkite-agent" "meta-data"] [ "services" "buildkite-agent" "tags" ])
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user