diff --git a/Formula/coreos-ct.rb b/Formula/coreos-ct.rb new file mode 100644 index 0000000000..424b32640a --- /dev/null +++ b/Formula/coreos-ct.rb @@ -0,0 +1,25 @@ +class CoreosCt < Formula + desc "Convert a Container Linux Config into Ignition" + homepage "https://coreos.com/os/docs/latest/configuration.html" + url "https://github.com/coreos/container-linux-config-transpiler/archive/v0.6.1.tar.gz" + sha256 "57cafa9db08caa6bed0290612bebf5d1a763a96fdb21f23de1681fd266b0c3c3" + + depends_on "go" => :build + + def install + system "make", "all" + bin.install "./bin/ct" + end + + test do + (testpath/"input").write <<~EOS + passwd: + users: + - name: core + ssh_authorized_keys: + - ssh-rsa mykey + EOS + output = shell_output("#{bin}/ct -pretty -in-file #{testpath}/input") + assert_match /.*"sshAuthorizedKeys":\s*["ssh-rsa mykey"\s*].*/m, output.strip + end +end