diff --git a/apps/core/lib/core/schema/dependencies.ex b/apps/core/lib/core/schema/dependencies.ex index 9a70091ce..7d7ac74a2 100644 --- a/apps/core/lib/core/schema/dependencies.ex +++ b/apps/core/lib/core/schema/dependencies.ex @@ -69,13 +69,14 @@ defmodule Core.Schema.Dependencies do field :breaking, :boolean, default: false field :wait, :boolean, default: false field :provider_vsn, :string + field :cli_vsn, :string embeds_many :dependencies, Dependency, on_replace: :delete embeds_one :instructions, ChangeInstructions embeds_one :wirings, Wirings, on_replace: :update end - @valid ~w(providers provider_wirings application outputs secrets breaking provider_vsn wait)a + @valid ~w(providers provider_wirings application outputs secrets breaking provider_vsn cli_vsn wait)a def changeset(model, attrs \\ %{}) do model diff --git a/apps/core/lib/core/schema/version.ex b/apps/core/lib/core/schema/version.ex index f84c12d77..2de9b4cd4 100644 --- a/apps/core/lib/core/schema/version.ex +++ b/apps/core/lib/core/schema/version.ex @@ -11,7 +11,7 @@ defmodule Core.Schema.Version do PackageScan } - defenum TemplateType, gotemplate: 0, lua: 1 + defenum TemplateType, gotemplate: 0, lua: 1, javascript: 2 schema "versions" do field :version, :string diff --git a/apps/core/lib/core/services/charts.ex b/apps/core/lib/core/services/charts.ex index ccd73ce17..d06e8d5e4 100644 --- a/apps/core/lib/core/services/charts.ex +++ b/apps/core/lib/core/services/charts.ex @@ -308,10 +308,12 @@ defmodule Core.Services.Charts do end def find_template(result, chart) do - Enum.find_value([ - {:gotemplate, String.to_charlist("#{chart}/values.yaml.tpl")}, - {:lua, String.to_charlist("#{chart}/values.yaml.lua")} - ], fn {type, path} -> + Enum.map([ + {:gotemplate, "#{chart}/values.yaml.tpl"}, + {:lua, "#{chart}/values.yaml.lua"}, + {:javascript, "#{chart}/values.yaml.js"} + ], fn {type, path} -> {type, String.to_charlist(path)} end) + |> Enum.find_value(fn {type, path} -> case Enum.find(result, &elem(&1, 0) == path) do {_, contents} -> {type, contents} _ -> nil diff --git a/apps/graphql/lib/graphql/schema/version.ex b/apps/graphql/lib/graphql/schema/version.ex index 5215b7a0d..6736e8653 100644 --- a/apps/graphql/lib/graphql/schema/version.ex +++ b/apps/graphql/lib/graphql/schema/version.ex @@ -91,6 +91,7 @@ defmodule GraphQl.Schema.Version do field :providers, list_of(:provider) field :secrets, list_of(:string) field :provider_vsn, :string + field :cli_vsn, :string field :application, :boolean field :provider_wirings, :map field :outputs, :map