blob: 89491b111e34a496d0ce208f3289b890dc9394e2 [file] [log] [blame]
# Copyright 2017 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//packages/package.gni")
package("developer-keys") {
deps = [
":all",
]
resources = [
{
path = rebase_path("$root_out_dir/ssh-keys/authorized_keys")
dest = "ssh/authorized_keys"
},
{
path = rebase_path("$root_out_dir/ssh-keys/ssh_host_ed25519_key")
dest = "ssh/ssh_host_ed25519_key"
},
{
path = rebase_path("$root_out_dir/ssh-keys/ssh_host_ed25519_key.pub")
dest = "ssh/ssh_host_ed25519_key.pub"
},
]
}
group("all") {
public_deps = [
":authorized_keys",
":host_key",
":id_key",
":ssh_config",
]
}
keys_dir = "${root_build_dir}/ssh-keys"
action("host_key") {
key_file = "${keys_dir}/ssh_host_ed25519_key"
script = "ssh-keygen-wrapper"
args = [
"ed25519",
rebase_path(key_file),
]
outputs = [
key_file,
key_file + ".pub",
]
}
action("id_key") {
key_file = "${keys_dir}/id_ed25519"
script = "ssh-keygen-wrapper"
args = [
"ed25519",
rebase_path(key_file),
]
outputs = [
key_file,
key_file + ".pub",
]
}
copy("authorized_keys") {
sources = [
"${keys_dir}/id_ed25519.pub",
]
outputs = [
"${keys_dir}/authorized_keys",
]
deps = [
":id_key",
]
}
action("ssh_config") {
config_file = "${keys_dir}/ssh_config"
script = "generate_ssh_config.sh"
args = [
rebase_path("${keys_dir}/id_ed25519"),
rebase_path(config_file),
]
outputs = [
config_file,
]
}