support the "provenance" option in the "builder" config
This commit is contained in:
@@ -6,7 +6,7 @@ class Kamal::Commands::Builder::Base < Kamal::Commands::Base
|
|||||||
delegate :argumentize, to: Kamal::Utils
|
delegate :argumentize, to: Kamal::Utils
|
||||||
delegate \
|
delegate \
|
||||||
:args, :secrets, :dockerfile, :target, :arches, :local_arches, :remote_arches, :remote,
|
:args, :secrets, :dockerfile, :target, :arches, :local_arches, :remote_arches, :remote,
|
||||||
:cache_from, :cache_to, :ssh, :driver, :docker_driver?,
|
:cache_from, :cache_to, :ssh, :provenance, :driver, :docker_driver?,
|
||||||
to: :builder_config
|
to: :builder_config
|
||||||
|
|
||||||
def clean
|
def clean
|
||||||
@@ -37,7 +37,7 @@ class Kamal::Commands::Builder::Base < Kamal::Commands::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def build_options
|
def build_options
|
||||||
[ *build_tags, *build_cache, *build_labels, *build_args, *build_secrets, *build_dockerfile, *build_target, *build_ssh ]
|
[ *build_tags, *build_cache, *build_labels, *build_args, *build_secrets, *build_dockerfile, *build_target, *build_ssh, *builder_provenance ]
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_context
|
def build_context
|
||||||
@@ -97,6 +97,10 @@ class Kamal::Commands::Builder::Base < Kamal::Commands::Base
|
|||||||
argumentize "--ssh", ssh if ssh.present?
|
argumentize "--ssh", ssh if ssh.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def builder_provenance
|
||||||
|
argumentize "--provenance", provenance unless provenance.nil?
|
||||||
|
end
|
||||||
|
|
||||||
def builder_config
|
def builder_config
|
||||||
config.builder
|
config.builder
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -111,6 +111,10 @@ class Kamal::Configuration::Builder
|
|||||||
builder_config["ssh"]
|
builder_config["ssh"]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def provenance
|
||||||
|
builder_config["provenance"]
|
||||||
|
end
|
||||||
|
|
||||||
def git_clone?
|
def git_clone?
|
||||||
Kamal::Git.used? && builder_config["context"].nil?
|
Kamal::Git.used? && builder_config["context"].nil?
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -104,3 +104,9 @@ builder:
|
|||||||
#
|
#
|
||||||
# The build driver to use, defaults to `docker-container`
|
# The build driver to use, defaults to `docker-container`
|
||||||
driver: docker
|
driver: docker
|
||||||
|
|
||||||
|
# Provenance
|
||||||
|
#
|
||||||
|
# It is used to configure provenance attestations for the build result.
|
||||||
|
# The value can also be a boolean to enable or disable provenance attestations.
|
||||||
|
provenance: mode=max
|
||||||
|
|||||||
Reference in New Issue
Block a user