diff --git a/internal/config/baketarget.go b/internal/config/baketarget.go index debde07..83cbc47 100644 --- a/internal/config/baketarget.go +++ b/internal/config/baketarget.go @@ -8,26 +8,26 @@ type BakeTarget struct { Context string `json:"context,omitempty" yaml:"context,omitempty" hcl:"context,optional"` Contexts map[string]string `json:"contexts,omitempty" yaml:"contexts,omitempty" hcl:"contexts,optional"` Dockerfile string `json:"dockerfile,omitempty" yaml:"dockerfile,omitempty" hcl:"dockerfile,optional"` - DockerfileInline string `json:"dockerfile-inline,omitempty" yaml:"dockerfile-inline,omitempty" hcl:"dockerfile-inline,optional"` + DockerfileInline string `json:"dockerfileInline,omitempty" yaml:"dockerfileInline,omitempty" hcl:"dockerfile-inline,optional"` Args map[string]string `json:"args,omitempty" yaml:"args,omitempty" hcl:"args,optional"` Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty" hcl:"labels,optional"` Tags []string `json:"tags,omitempty" yaml:"tags,omitempty" hcl:"tags,optional"` - CacheFrom []map[string]string `json:"cache-from,omitempty" yaml:"cache-from,omitempty" hcl:"cache-from,optional"` - CacheTo []map[string]string `json:"cache-to,omitempty" yaml:"cache-to,omitempty" hcl:"cache-to,optional"` + CacheFrom []map[string]string `json:"cacheFrom,omitempty" yaml:"cacheFrom,omitempty" hcl:"cache-from,optional"` + CacheTo []map[string]string `json:"cacheTo,omitempty" yaml:"cacheTo,omitempty" hcl:"cache-to,optional"` Target string `json:"target,omitempty" yaml:"target,omitempty" hcl:"target,optional"` Secrets []map[string]any `json:"secret,omitempty" yaml:"secret,omitempty" hcl:"secret,label,optional"` SSH []map[string]any `json:"ssh,omitempty" yaml:"ssh,omitempty" hcl:"ssh,optional"` Platforms []string `json:"platforms,omitempty" yaml:"platforms,omitempty" hcl:"platforms,optional"` Outputs []map[string]any `json:"output,omitempty" yaml:"output,omitempty" hcl:"output,optional"` Pull bool `json:"pull,omitempty" yaml:"pull,omitempty" hcl:"pull,optional"` - NoCache bool `json:"no-cache,omitempty" yaml:"no-cache,omitempty" hcl:"no-cache,optional"` + NoCache bool `json:"noCache,omitempty" yaml:"noCache,omitempty" hcl:"no-cache,optional"` NetworkMode string `json:"network,omitempty" yaml:"network,omitempty" hcl:"network,optional"` - NoCacheFilter []string `json:"no-cache-filter,omitempty" yaml:"no-cache-filter,omitempty" hcl:"no-cache-filter,optional"` - ShmSize string `json:"shm-size,omitempty" yaml:"shm-size,omitempty" hcl:"shm-size,optional"` + NoCacheFilter []string `json:"noCacheFilter,omitempty" yaml:"noCacheFilter,omitempty" hcl:"no-cache-filter,optional"` + ShmSize string `json:"shmSize,omitempty" yaml:"shmSize,omitempty" hcl:"shm-size,optional"` Ulimits []string `json:"ulimits,omitempty" yaml:"ulimits,omitempty" hcl:"ulimits,optional"` Call string `json:"call,omitempty" yaml:"call,omitempty" hcl:"call,optional"` Entitlements []string `json:"entitlements,omitempty" yaml:"entitlements,omitempty" hcl:"entitlements,optional"` - ExtraHosts map[string]string `json:"extra-hosts,omitempty" yaml:"extra-hosts,omitempty" hcl:"extra-hosts,optional"` + ExtraHosts map[string]string `json:"extraHosts,omitempty" yaml:"extraHosts,omitempty" hcl:"extra-hosts,optional"` // Inherits is the only field that cannot be overridden with --set Inherits []string `json:"inherits,omitempty" yaml:"inherits,omitempty" hcl:"inherits,optional"` // NOTE: use typed once it can be rendered as slice diff --git a/internal/config/build.go b/internal/config/build.go index af53ebe..be59621 100644 --- a/internal/config/build.go +++ b/internal/config/build.go @@ -17,7 +17,7 @@ type Build struct { Dependencies []string `json:"dependencies,omitempty" yaml:"dependencies,omitempty"` // AddHost add a custom host-to-IP mapping (format: "host:ip") - AddHost []string `json:"add_host,omitempty" yaml:"add_host,omitempty"` + AddHost []string `json:"addHost,omitempty" yaml:"addHost,omitempty"` // Allow extra privileged entitlement (e.g., "network.host", "security.insecure") Allow []string `json:"allow,omitempty" yaml:"allow,omitempty"` // Add annotation to the image @@ -25,19 +25,19 @@ type Build struct { // Attest parameters (format: "type=sbom,generator=image") Attest []string `json:"attest,omitempty" yaml:"attest,omitempty"` // BuildArg set build-time variables - BuildArg []string `json:"build_arg,omitempty" yaml:"build_arg,omitempty"` + BuildArg []string `json:"buildArg,omitempty" yaml:"buildArg,omitempty"` // BuildContext additional build contexts (e.g., name=path) - BuildContext []string `json:"build_context,omitempty" yaml:"build_context,omitempty"` + BuildContext []string `json:"buildContext,omitempty" yaml:"buildContext,omitempty"` // Builder override the configured builder instance Builder string `json:"builder,omitempty" yaml:"builder,omitempty"` // CacheFrom external cache sources (e.g., "user/app:cache", "type=local,src=path/to/dir") - CacheFrom []string `json:"cache_from,omitempty" yaml:"cache_from,omitempty"` + CacheFrom []string `json:"cacheFrom,omitempty" yaml:"cacheFrom,omitempty"` // CacheTo cache export destinations (e.g., "user/app:cache", "type=local,dest=path/to/dir") - CacheTo []string `json:"cache_to,omitempty" yaml:"cache_to,omitempty"` + CacheTo []string `json:"cacheTo,omitempty" yaml:"cacheTo,omitempty"` // Set method for evaluating build ("check", "outline", "targets") (default "build") Call string `json:"call,omitempty" yaml:"call,omitempty"` // CGroupParent optional parent cgroup for the container - CGroupParent string `json:"cgroup_parent,omitempty" yaml:"cgroup_parent,omitempty"` + CGroupParent string `json:"cGroupParent,omitempty" yaml:"cGroupParent,omitempty"` // Shorthand for "--call=check" Check bool `json:"check,omitempty" yaml:"check,omitempty"` // Enable debug logging @@ -51,13 +51,13 @@ type Build struct { // Load shorthand for "--output=type=docker" Load bool `json:"load,omitempty" yaml:"load,omitempty"` // MetadataFile write build result metadata to the file - MetadataFile string `json:"metadata_file,omitempty" yaml:"metadata_file,omitempty"` + MetadataFile string `json:"metadataFile,omitempty" yaml:"metadataFile,omitempty"` // Network set the networking mode for the "RUN" instructions during build (default "default") Network string `json:"network,omitempty" yaml:"network,omitempty"` // NoCache do not use cache when building the image - NoCache bool `json:"no_cache,omitempty" yaml:"no_cache,omitempty"` + NoCache bool `json:"noCache,omitempty" yaml:"noCache,omitempty"` // NoCacheFilter do not cache specified stages - NoCacheFilter []string `json:"no_cache_filter,omitempty" yaml:"no_cache_filter,omitempty"` + NoCacheFilter []string `json:"noCacheFilter,omitempty" yaml:"noCacheFilter,omitempty"` // Output destination (format: "type=local,dest=path") Output []string `json:"output,omitempty" yaml:"output,omitempty"` // Platform set target platform for build @@ -77,7 +77,7 @@ type Build struct { // Secret to expose to the build (format: "id=mysecret[,src=/local/secret]") Secret []string `json:"secret,omitempty" yaml:"secret,omitempty"` // ShmSize size of "/dev/shm" - ShmSize string `json:"shm_size,omitempty" yaml:"shm_size,omitempty"` + ShmSize string `json:"shmSize,omitempty" yaml:"shmSize,omitempty"` // SSH agent socket or keys to expose to the build (format: "default|[=|[,]]") SSH []string `json:"ssh,omitempty" yaml:"ssh,omitempty"` // Tag name and optionally a tag (format: "name:tag") diff --git a/squadron.schema.json b/squadron.schema.json index b36ac23..29ea59c 100644 --- a/squadron.schema.json +++ b/squadron.schema.json @@ -32,7 +32,7 @@ "dockerfile": { "type": "string" }, - "dockerfile-inline": { + "dockerfileInline": { "type": "string" }, "args": { @@ -53,7 +53,7 @@ }, "type": "array" }, - "cache-from": { + "cacheFrom": { "items": { "additionalProperties": { "type": "string" @@ -62,7 +62,7 @@ }, "type": "array" }, - "cache-to": { + "cacheTo": { "items": { "additionalProperties": { "type": "string" @@ -101,19 +101,19 @@ "pull": { "type": "boolean" }, - "no-cache": { + "noCache": { "type": "boolean" }, "network": { "type": "string" }, - "no-cache-filter": { + "noCacheFilter": { "items": { "type": "string" }, "type": "array" }, - "shm-size": { + "shmSize": { "type": "string" }, "ulimits": { @@ -131,7 +131,7 @@ }, "type": "array" }, - "extra-hosts": { + "extraHosts": { "additionalProperties": { "type": "string" }, @@ -161,7 +161,7 @@ "type": "array", "description": "Dependencies list of build names defined in the squadron configuration" }, - "add_host": { + "addHost": { "items": { "type": "string" }, @@ -189,14 +189,14 @@ "type": "array", "description": "Attest parameters (format: \"type=sbom,generator=image\")" }, - "build_arg": { + "buildArg": { "items": { "type": "string" }, "type": "array", "description": "BuildArg set build-time variables" }, - "build_context": { + "buildContext": { "items": { "type": "string" }, @@ -207,14 +207,14 @@ "type": "string", "description": "Builder override the configured builder instance" }, - "cache_from": { + "cacheFrom": { "items": { "type": "string" }, "type": "array", "description": "CacheFrom external cache sources (e.g., \"user/app:cache\", \"type=local,src=path/to/dir\")" }, - "cache_to": { + "cacheTo": { "items": { "type": "string" }, @@ -225,7 +225,7 @@ "type": "string", "description": "Set method for evaluating build (\"check\", \"outline\", \"targets\") (default \"build\")" }, - "cgroup_parent": { + "cGroupParent": { "type": "string", "description": "CGroupParent optional parent cgroup for the container" }, @@ -256,7 +256,7 @@ "type": "boolean", "description": "Load shorthand for \"--output=type=docker\"" }, - "metadata_file": { + "metadataFile": { "type": "string", "description": "MetadataFile write build result metadata to the file" }, @@ -264,11 +264,11 @@ "type": "string", "description": "Network set the networking mode for the \"RUN\" instructions during build (default \"default\")" }, - "no_cache": { + "noCache": { "type": "boolean", "description": "NoCache do not use cache when building the image" }, - "no_cache_filter": { + "noCacheFilter": { "items": { "type": "string" }, @@ -320,7 +320,7 @@ "type": "array", "description": "Secret to expose to the build (format: \"id=mysecret[,src=/local/secret]\")" }, - "shm_size": { + "shmSize": { "type": "string", "description": "ShmSize size of \"/dev/shm\"" }, diff --git a/testdata/bake/snapshop-bakefile.hcl b/testdata/bake/snapshop-bakefile.hcl index c3b90a6..44cdc0d 100644 --- a/testdata/bake/snapshop-bakefile.hcl +++ b/testdata/bake/snapshop-bakefile.hcl @@ -17,5 +17,6 @@ target "squadron-storefinder-backend-default" { # test # test } - tags = ["storefinder/backend:${TAG}"] + tags = ["storefinder/backend:${TAG}"] + no-cache-filter = ["nocache"] } diff --git a/testdata/bake/snapshop-config-norender.yaml b/testdata/bake/snapshop-config-norender.yaml index f504c9e..3c1e7a8 100644 --- a/testdata/bake/snapshop-config-norender.yaml +++ b/testdata/bake/snapshop-config-norender.yaml @@ -16,3 +16,5 @@ squadron: default: tags: - storefinder/backend:${TAG} + noCacheFilter: + - nocache diff --git a/testdata/bake/snapshop-config.yaml b/testdata/bake/snapshop-config.yaml index eea9269..b977ffb 100644 --- a/testdata/bake/snapshop-config.yaml +++ b/testdata/bake/snapshop-config.yaml @@ -16,3 +16,5 @@ squadron: default: tags: - storefinder/backend:${TAG} + noCacheFilter: + - nocache diff --git a/testdata/bake/squadron.yaml b/testdata/bake/squadron.yaml index b7800a5..30029a9 100644 --- a/testdata/bake/squadron.yaml +++ b/testdata/bake/squadron.yaml @@ -14,4 +14,5 @@ squadron: bakes: default: tags: [ 'storefinder/backend:${TAG}' ] + noCacheFilter: [ nocache ] diff --git a/testdata/override/snapshop-config-norender.yaml b/testdata/override/snapshop-config-norender.yaml index 434a9b3..a3ec675 100644 --- a/testdata/override/snapshop-config-norender.yaml +++ b/testdata/override/snapshop-config-norender.yaml @@ -8,7 +8,7 @@ squadron: version: 0.0.1 builds: default: - build_arg: + buildArg: - foo=foo - bar=bar - bar=baz diff --git a/testdata/override/snapshop-config.yaml b/testdata/override/snapshop-config.yaml index 155a995..023fbab 100644 --- a/testdata/override/snapshop-config.yaml +++ b/testdata/override/snapshop-config.yaml @@ -8,7 +8,7 @@ squadron: version: 0.0.1 builds: default: - build_arg: + buildArg: - foo=foo - bar=bar - bar=baz diff --git a/testdata/override/squadron.override.yaml b/testdata/override/squadron.override.yaml index a5a3f63..6d7209e 100644 --- a/testdata/override/squadron.override.yaml +++ b/testdata/override/squadron.override.yaml @@ -6,7 +6,7 @@ squadron: builds: default: # append new element to array - build_arg: + buildArg: - "bar=baz" - "baz=baz" # override backend diff --git a/testdata/override/squadron.yaml b/testdata/override/squadron.yaml index 7dd9480..7202ff4 100644 --- a/testdata/override/squadron.yaml +++ b/testdata/override/squadron.yaml @@ -8,7 +8,7 @@ squadron: default: tag: [ storefinder/frontend:latest ] file: Dockerfile - build_arg: + buildArg: - "foo=foo" - "bar=bar" values: @@ -21,7 +21,7 @@ squadron: default: tag: [ storefinder/backend:latest ] file: Dockerfile - build_arg: + buildArg: - "foo=foo" - "bar=bar" values: