From 0786fefc5145c9e81b85d5eaccd2e3206e8bbe6a Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 9 Feb 2024 15:18:45 +0100 Subject: [PATCH 01/26] add mount option --- cmd/docker-buildx/config.go | 6 ++++++ plugin/docker.go | 3 +++ plugin/impl.go | 1 + 3 files changed, 10 insertions(+) diff --git a/cmd/docker-buildx/config.go b/cmd/docker-buildx/config.go index 05705f3..a8d13b2 100644 --- a/cmd/docker-buildx/config.go +++ b/cmd/docker-buildx/config.go @@ -183,6 +183,12 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag { Usage: "forwards environment variables as custom arguments to the build", Destination: &settings.Build.ArgsEnv, }, + &cli.StringSliceFlag{ + Name: "mount", + EnvVars: []string{"PLUGIN_MOUNT"}, + Usage: "sets custom mount argument for the build", + Destination: &settings.Build.Mount, + }, &cli.BoolFlag{ Name: "quiet", EnvVars: []string{"PLUGIN_QUIET"}, diff --git a/plugin/docker.go b/plugin/docker.go index e966b37..3b1282c 100644 --- a/plugin/docker.go +++ b/plugin/docker.go @@ -94,6 +94,9 @@ func commandBuild(build Build, dryrun bool) *exec.Cmd { for _, arg := range append(defaultBuildArgs, build.Args.Value()...) { args = append(args, "--build-arg", arg) } + if build.Mount != "" { + args = append(args, "--mount", build.Mount) + } for _, host := range build.AddHost.Value() { args = append(args, "--add-host", host) } diff --git a/plugin/impl.go b/plugin/impl.go index 563d03d..a0f8902 100644 --- a/plugin/impl.go +++ b/plugin/impl.go @@ -69,6 +69,7 @@ type Build struct { Platforms cli.StringSlice // Docker build target platforms Args cli.StringSlice // Docker build args ArgsEnv cli.StringSlice // Docker build args from env + Mount string // Docker build mount Target string // Docker build target Output string // Docker build output Pull bool // Docker build pull From 97bb56fa4ac5e98be8e8d99e08a73a835b969a71 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 9 Feb 2024 15:20:34 +0100 Subject: [PATCH 02/26] add documentation for mount option --- docs.md | 87 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/docs.md b/docs.md index 3f8ce32..e68ec32 100644 --- a/docs.md +++ b/docs.md @@ -92,50 +92,51 @@ docker-build: ## Advanced Settings -| Settings Name | Default | Description | +| Settings Name | Default | Description | | ------------------------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -| `mirror` | _none_ | sets a registry mirror to pull images | -| `storage_driver` | _none_ | sets the docker daemon storage driver | -| `storage_path` | `/var/lib/docker` | sets the docker daemon storage path | -| `bip` | _none_ | allows the docker daemon to bride ip address | -| `mtu` | _none_ | sets docker daemon custom mtu setting | -| `custom_dns` | _none_ | sets custom docker daemon dns server | -| `custom_dns_search` | _none_ | sets custom docker daemon dns search domain | -| `insecure` | `false` | allows the docker daemon to use insecure registries | -| `ipv6` | `false` | enables docker daemon IPv6 support | -| `experimental` | `false` | enables docker daemon experimental mode | -| `debug` | `false` | enables verbose debug mode for the docker daemon | -| `daemon_off` | `false` | disables the startup of the docker daemon | -| `buildkit_debug` | `false` | enables debug output of buildkit | -| `buildkit_config` | _none_ | sets content of the docker[buildkit TOML config](https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md) | -| `buildkit_driveropt` | _none_ | adds one or multiple`--driver-opt` buildx arguments for the default buildkit builder instance | -| `tags_file` | _none_ | overrides the`tags` option with values in a file named `.tags`; multiple tags can be specified separated by a newline | -| `context` | `.` | sets the path of the build context to use | -| `auto_tag` | `false` | generates tag names automatically based on git branch and git tag, tags supplied via`tags` are additionally added to the auto_tags without suffix | -| `default_suffix"`/`auto_tag_suffix` | _none_ | generates tag names with the given suffix | -| `default_tag` | `latest` | overrides the default tag name used when generating with`auto_tag` enabled | -| `label`/`labels` | _none_ | sets labels to use for the image in format`=` | -| `default_labels`/`auto_labels` | `true` | sets docker image labels based on git information | -| `build_args` | _none_ | sets custom build arguments for the build | -| `build_args_from_env` | _none_ | forwards environment variables as custom arguments to the build | -| `quiet` | `false` | enables suppression of the build output | -| `target` | _none_ | sets the build target to use | -| `cache_from` | _none_ | sets configuration for cache source | -| `cache_to` | _none_ | sets configuration for cache export | -| `cache_images` | _none_ | a list of images to use as cache. | -| `pull_image` | `true` | enforces to pull base image at build time | -| `compress` | `false` | enables compression of the build context using gzip | -| `config` | _none_ | sets content of the docker daemon json config | -| `purge` | `true` | enables cleanup of the docker environment at the end of a build | -| `no_cache` | `false` | disables the usage of cached intermediate containers | -| `add_host` | _none_ | sets additional host:ip mapping | -| `output` | _none_ | sets build output in format`type=[,=]` | -| `logins` | _none_ | option to log into multiple registries | -| `env_file` | _none_ | load env vars from specified file | -| `ecr_create_repository` | `false` | creates the ECR repository if it does not exist | -| `ecr_lifecycle_policy` | _none_ | AWS ECR lifecycle policy | -| `ecr_repository_policy` | _none_ | AWS ECR repository policy | -| `ecr_scan_on_push` | _none_ | AWS: whether to enable image scanning on push | +| `mirror` | _none_ | sets a registry mirror to pull images | +| `storage_driver` | _none_ | sets the docker daemon storage driver | +| `storage_path` | `/var/lib/docker` | sets the docker daemon storage path | +| `bip` | _none_ | allows the docker daemon to bride ip address | +| `mtu` | _none_ | sets docker daemon custom mtu setting | +| `custom_dns` | _none_ | sets custom docker daemon dns server | +| `custom_dns_search` | _none_ | sets custom docker daemon dns search domain | +| `insecure` | `false` | allows the docker daemon to use insecure registries | +| `ipv6` | `false` | enables docker daemon IPv6 support | +| `experimental` | `false` | enables docker daemon experimental mode | +| `debug` | `false` | enables verbose debug mode for the docker daemon | +| `daemon_off` | `false` | disables the startup of the docker daemon | +| `buildkit_debug` | `false` | enables debug output of buildkit | +| `buildkit_config` | _none_ | sets content of the docker[buildkit TOML config](https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md) | +| `buildkit_driveropt` | _none_ | adds one or multiple`--driver-opt` buildx arguments for the default buildkit builder instance | +| `tags_file` | _none_ | overrides the`tags` option with values in a file named `.tags`; multiple tags can be specified separated by a newline | +| `context` | `.` | sets the path of the build context to use | +| `auto_tag` | `false` | generates tag names automatically based on git branch and git tag, tags supplied via`tags` are additionally added to the auto_tags without suffix | +| `default_suffix"`/`auto_tag_suffix` | _none_ | generates tag names with the given suffix | +| `default_tag` | `latest` | overrides the default tag name used when generating with`auto_tag` enabled | +| `label`/`labels` | _none_ | sets labels to use for the image in format`=` | +| `default_labels`/`auto_labels` | `true` | sets docker image labels based on git information | +| `build_args` | _none_ | sets custom build arguments for the build | +| `build_args_from_env` | _none_ | forwards environment variables as custom arguments to the build | +| `mount` | _none_ | Sets the build mount to user | +| `quiet` | `false` | enables suppression of the build output | +| `target` | _none_ | sets the build target to use | +| `cache_from` | _none_ | sets configuration for cache source | +| `cache_to` | _none_ | sets configuration for cache export | +| `cache_images` | _none_ | a list of images to use as cache. | +| `pull_image` | `true` | enforces to pull base image at build time | +| `compress` | `false` | enables compression of the build context using gzip | +| `config` | _none_ | sets content of the docker daemon json config | +| `purge` | `true` | enables cleanup of the docker environment at the end of a build | +| `no_cache` | `false` | disables the usage of cached intermediate containers | +| `add_host` | _none_ | sets additional host:ip mapping | +| `output` | _none_ | sets build output in format`type=[,=]` | +| `logins` | _none_ | option to log into multiple registries | +| `env_file` | _none_ | load env vars from specified file | +| `ecr_create_repository` | `false` | creates the ECR repository if it does not exist | +| `ecr_lifecycle_policy` | _none_ | AWS ECR lifecycle policy | +| `ecr_repository_policy` | _none_ | AWS ECR repository policy | +| `ecr_scan_on_push` | _none_ | AWS: whether to enable image scanning on push | ## Multi registry push example From 6c8e0f6671d74bbcc4851016ee166b9482a80cc3 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 9 Feb 2024 15:29:16 +0100 Subject: [PATCH 03/26] add ci --- .woodpecker.yml | 40 ++++------------------------------------ 1 file changed, 4 insertions(+), 36 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index ee4b55f..def4fa8 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -12,20 +12,13 @@ variables: platforms: "linux/amd64,linux/arm64" dockerfile: Dockerfile.multiarch auto_tag: true - repo: woodpeckerci/plugin-docker-buildx,codeberg.org/woodpecker-plugins/docker-buildx + repo: deblan/docker-buildx - &login_setting - # Default DockerHub login - - registry: https://index.docker.io/v1/ + - registry: https://gitnet.fr username: - from_secret: docker_username + from_secret: registry_user password: - from_secret: docker_password - # Additional Codeberg login - - registry: https://codeberg.org - username: - from_secret: cb_username - password: - from_secret: cb_password + from_secret: registry_password steps: vendor: @@ -73,28 +66,3 @@ steps: when: event: [push, tag, cron] branch: ${CI_REPO_DEFAULT_BRANCH} - - publish_pr_image: - image: *build_plugin - depends_on: test - settings: - <<: *base_buildx_settings - tag: pull_${CI_COMMIT_PULL_REQUEST} - logins: *login_setting - when: - evaluate: 'CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images"' - event: pull_request - - # TODO: replace by plugin-ready-release-go once it supports gitea - gitea-release: - image: "woodpeckerci/plugin-gitea-release:0.3.1" - depends_on: test - settings: - base_url: https://codeberg.org - title: ${CI_COMMIT_TAG} - api_key: - from_secret: gitea_token - target: main - when: - event: [tag] - branch: ${CI_REPO_DEFAULT_BRANCH} From 4d0e047b2b14330e03fe46786ff0ab4b3ab1cda8 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 9 Feb 2024 15:30:01 +0100 Subject: [PATCH 04/26] add ci --- .woodpecker.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index def4fa8..ab135b7 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,9 +1,9 @@ -when: - - event: [pull_request, tag, cron] - - event: push - branch: - - ${CI_REPO_DEFAULT_BRANCH} - - renovate/* +# when: +# - event: [pull_request, tag, cron] +# - event: push +# branch: +# - ${CI_REPO_DEFAULT_BRANCH} +# - renovate/* variables: - &golang "golang:1.22" From 2880d7f6a368add132917d52bfda6f96eadbdea8 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 9 Feb 2024 15:30:38 +0100 Subject: [PATCH 05/26] add ci --- .woodpecker.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index ab135b7..ac14d3c 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -65,4 +65,3 @@ steps: logins: *login_setting when: event: [push, tag, cron] - branch: ${CI_REPO_DEFAULT_BRANCH} From fc60a79bc377194725ba863d69b1b6b2bb3dc0f9 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 9 Feb 2024 15:34:45 +0100 Subject: [PATCH 06/26] rename mount with secret --- cmd/docker-buildx/config.go | 6 +++--- docs.md | 2 +- plugin/impl.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/docker-buildx/config.go b/cmd/docker-buildx/config.go index a8d13b2..ebcb719 100644 --- a/cmd/docker-buildx/config.go +++ b/cmd/docker-buildx/config.go @@ -185,9 +185,9 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag { }, &cli.StringSliceFlag{ Name: "mount", - EnvVars: []string{"PLUGIN_MOUNT"}, - Usage: "sets custom mount argument for the build", - Destination: &settings.Build.Mount, + EnvVars: []string{"PLUGIN_SECRET"}, + Usage: "sets custom secret argument for the build", + Destination: &settings.Build.Secret, }, &cli.BoolFlag{ Name: "quiet", diff --git a/docs.md b/docs.md index e68ec32..ea8b7fa 100644 --- a/docs.md +++ b/docs.md @@ -118,7 +118,7 @@ docker-build: | `default_labels`/`auto_labels` | `true` | sets docker image labels based on git information | | `build_args` | _none_ | sets custom build arguments for the build | | `build_args_from_env` | _none_ | forwards environment variables as custom arguments to the build | -| `mount` | _none_ | Sets the build mount to user | +| `secret` | _none_ | Sets the build secret for the build | | `quiet` | `false` | enables suppression of the build output | | `target` | _none_ | sets the build target to use | | `cache_from` | _none_ | sets configuration for cache source | diff --git a/plugin/impl.go b/plugin/impl.go index a0f8902..5d77abf 100644 --- a/plugin/impl.go +++ b/plugin/impl.go @@ -70,7 +70,7 @@ type Build struct { Args cli.StringSlice // Docker build args ArgsEnv cli.StringSlice // Docker build args from env Mount string // Docker build mount - Target string // Docker build target + Secret string // Docker build secret Output string // Docker build output Pull bool // Docker build pull CacheFrom string // Docker build cache-from From edc13f23fc1b2fa0dcbdf156eb4999cdb5a5f54f Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 9 Feb 2024 15:37:03 +0100 Subject: [PATCH 07/26] fix bad substitution --- plugin/impl.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/impl.go b/plugin/impl.go index 5d77abf..9546e0a 100644 --- a/plugin/impl.go +++ b/plugin/impl.go @@ -69,8 +69,8 @@ type Build struct { Platforms cli.StringSlice // Docker build target platforms Args cli.StringSlice // Docker build args ArgsEnv cli.StringSlice // Docker build args from env - Mount string // Docker build mount Secret string // Docker build secret + Target string // Docker build target Output string // Docker build output Pull bool // Docker build pull CacheFrom string // Docker build cache-from From e8fe46f336036f88405de0233b42f00cc6953e2b Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 9 Feb 2024 15:41:17 +0100 Subject: [PATCH 08/26] fix bad substitution --- cmd/docker-buildx/config.go | 2 +- plugin/docker.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/docker-buildx/config.go b/cmd/docker-buildx/config.go index ebcb719..87046d0 100644 --- a/cmd/docker-buildx/config.go +++ b/cmd/docker-buildx/config.go @@ -184,7 +184,7 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag { Destination: &settings.Build.ArgsEnv, }, &cli.StringSliceFlag{ - Name: "mount", + Name: "secret", EnvVars: []string{"PLUGIN_SECRET"}, Usage: "sets custom secret argument for the build", Destination: &settings.Build.Secret, diff --git a/plugin/docker.go b/plugin/docker.go index 3b1282c..43ea8d7 100644 --- a/plugin/docker.go +++ b/plugin/docker.go @@ -94,8 +94,8 @@ func commandBuild(build Build, dryrun bool) *exec.Cmd { for _, arg := range append(defaultBuildArgs, build.Args.Value()...) { args = append(args, "--build-arg", arg) } - if build.Mount != "" { - args = append(args, "--mount", build.Mount) + if build.Secret != "" { + args = append(args, "--secret", build.Secret) } for _, host := range build.AddHost.Value() { args = append(args, "--add-host", host) From 22e4afcef3b235997921264e6dc016dd493fba26 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 9 Feb 2024 15:47:30 +0100 Subject: [PATCH 09/26] set secret ad cli.StringFlag --- cmd/docker-buildx/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/docker-buildx/config.go b/cmd/docker-buildx/config.go index 87046d0..7c7b219 100644 --- a/cmd/docker-buildx/config.go +++ b/cmd/docker-buildx/config.go @@ -183,7 +183,7 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag { Usage: "forwards environment variables as custom arguments to the build", Destination: &settings.Build.ArgsEnv, }, - &cli.StringSliceFlag{ + &cli.StringFlag{ Name: "secret", EnvVars: []string{"PLUGIN_SECRET"}, Usage: "sets custom secret argument for the build", From 7c5f14a957effe809f155f2e8e5898111e241de3 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 9 Feb 2024 15:18:45 +0100 Subject: [PATCH 10/26] add secret option add documentation --- cmd/docker-buildx/config.go | 6 +++ docs.md | 87 +++++++++++++++++++------------------ plugin/docker.go | 3 ++ plugin/impl.go | 1 + 4 files changed, 54 insertions(+), 43 deletions(-) diff --git a/cmd/docker-buildx/config.go b/cmd/docker-buildx/config.go index 05705f3..7c7b219 100644 --- a/cmd/docker-buildx/config.go +++ b/cmd/docker-buildx/config.go @@ -183,6 +183,12 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag { Usage: "forwards environment variables as custom arguments to the build", Destination: &settings.Build.ArgsEnv, }, + &cli.StringFlag{ + Name: "secret", + EnvVars: []string{"PLUGIN_SECRET"}, + Usage: "sets custom secret argument for the build", + Destination: &settings.Build.Secret, + }, &cli.BoolFlag{ Name: "quiet", EnvVars: []string{"PLUGIN_QUIET"}, diff --git a/docs.md b/docs.md index 3f8ce32..ea8b7fa 100644 --- a/docs.md +++ b/docs.md @@ -92,50 +92,51 @@ docker-build: ## Advanced Settings -| Settings Name | Default | Description | +| Settings Name | Default | Description | | ------------------------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -| `mirror` | _none_ | sets a registry mirror to pull images | -| `storage_driver` | _none_ | sets the docker daemon storage driver | -| `storage_path` | `/var/lib/docker` | sets the docker daemon storage path | -| `bip` | _none_ | allows the docker daemon to bride ip address | -| `mtu` | _none_ | sets docker daemon custom mtu setting | -| `custom_dns` | _none_ | sets custom docker daemon dns server | -| `custom_dns_search` | _none_ | sets custom docker daemon dns search domain | -| `insecure` | `false` | allows the docker daemon to use insecure registries | -| `ipv6` | `false` | enables docker daemon IPv6 support | -| `experimental` | `false` | enables docker daemon experimental mode | -| `debug` | `false` | enables verbose debug mode for the docker daemon | -| `daemon_off` | `false` | disables the startup of the docker daemon | -| `buildkit_debug` | `false` | enables debug output of buildkit | -| `buildkit_config` | _none_ | sets content of the docker[buildkit TOML config](https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md) | -| `buildkit_driveropt` | _none_ | adds one or multiple`--driver-opt` buildx arguments for the default buildkit builder instance | -| `tags_file` | _none_ | overrides the`tags` option with values in a file named `.tags`; multiple tags can be specified separated by a newline | -| `context` | `.` | sets the path of the build context to use | -| `auto_tag` | `false` | generates tag names automatically based on git branch and git tag, tags supplied via`tags` are additionally added to the auto_tags without suffix | -| `default_suffix"`/`auto_tag_suffix` | _none_ | generates tag names with the given suffix | -| `default_tag` | `latest` | overrides the default tag name used when generating with`auto_tag` enabled | -| `label`/`labels` | _none_ | sets labels to use for the image in format`=` | -| `default_labels`/`auto_labels` | `true` | sets docker image labels based on git information | -| `build_args` | _none_ | sets custom build arguments for the build | -| `build_args_from_env` | _none_ | forwards environment variables as custom arguments to the build | -| `quiet` | `false` | enables suppression of the build output | -| `target` | _none_ | sets the build target to use | -| `cache_from` | _none_ | sets configuration for cache source | -| `cache_to` | _none_ | sets configuration for cache export | -| `cache_images` | _none_ | a list of images to use as cache. | -| `pull_image` | `true` | enforces to pull base image at build time | -| `compress` | `false` | enables compression of the build context using gzip | -| `config` | _none_ | sets content of the docker daemon json config | -| `purge` | `true` | enables cleanup of the docker environment at the end of a build | -| `no_cache` | `false` | disables the usage of cached intermediate containers | -| `add_host` | _none_ | sets additional host:ip mapping | -| `output` | _none_ | sets build output in format`type=[,=]` | -| `logins` | _none_ | option to log into multiple registries | -| `env_file` | _none_ | load env vars from specified file | -| `ecr_create_repository` | `false` | creates the ECR repository if it does not exist | -| `ecr_lifecycle_policy` | _none_ | AWS ECR lifecycle policy | -| `ecr_repository_policy` | _none_ | AWS ECR repository policy | -| `ecr_scan_on_push` | _none_ | AWS: whether to enable image scanning on push | +| `mirror` | _none_ | sets a registry mirror to pull images | +| `storage_driver` | _none_ | sets the docker daemon storage driver | +| `storage_path` | `/var/lib/docker` | sets the docker daemon storage path | +| `bip` | _none_ | allows the docker daemon to bride ip address | +| `mtu` | _none_ | sets docker daemon custom mtu setting | +| `custom_dns` | _none_ | sets custom docker daemon dns server | +| `custom_dns_search` | _none_ | sets custom docker daemon dns search domain | +| `insecure` | `false` | allows the docker daemon to use insecure registries | +| `ipv6` | `false` | enables docker daemon IPv6 support | +| `experimental` | `false` | enables docker daemon experimental mode | +| `debug` | `false` | enables verbose debug mode for the docker daemon | +| `daemon_off` | `false` | disables the startup of the docker daemon | +| `buildkit_debug` | `false` | enables debug output of buildkit | +| `buildkit_config` | _none_ | sets content of the docker[buildkit TOML config](https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md) | +| `buildkit_driveropt` | _none_ | adds one or multiple`--driver-opt` buildx arguments for the default buildkit builder instance | +| `tags_file` | _none_ | overrides the`tags` option with values in a file named `.tags`; multiple tags can be specified separated by a newline | +| `context` | `.` | sets the path of the build context to use | +| `auto_tag` | `false` | generates tag names automatically based on git branch and git tag, tags supplied via`tags` are additionally added to the auto_tags without suffix | +| `default_suffix"`/`auto_tag_suffix` | _none_ | generates tag names with the given suffix | +| `default_tag` | `latest` | overrides the default tag name used when generating with`auto_tag` enabled | +| `label`/`labels` | _none_ | sets labels to use for the image in format`=` | +| `default_labels`/`auto_labels` | `true` | sets docker image labels based on git information | +| `build_args` | _none_ | sets custom build arguments for the build | +| `build_args_from_env` | _none_ | forwards environment variables as custom arguments to the build | +| `secret` | _none_ | Sets the build secret for the build | +| `quiet` | `false` | enables suppression of the build output | +| `target` | _none_ | sets the build target to use | +| `cache_from` | _none_ | sets configuration for cache source | +| `cache_to` | _none_ | sets configuration for cache export | +| `cache_images` | _none_ | a list of images to use as cache. | +| `pull_image` | `true` | enforces to pull base image at build time | +| `compress` | `false` | enables compression of the build context using gzip | +| `config` | _none_ | sets content of the docker daemon json config | +| `purge` | `true` | enables cleanup of the docker environment at the end of a build | +| `no_cache` | `false` | disables the usage of cached intermediate containers | +| `add_host` | _none_ | sets additional host:ip mapping | +| `output` | _none_ | sets build output in format`type=[,=]` | +| `logins` | _none_ | option to log into multiple registries | +| `env_file` | _none_ | load env vars from specified file | +| `ecr_create_repository` | `false` | creates the ECR repository if it does not exist | +| `ecr_lifecycle_policy` | _none_ | AWS ECR lifecycle policy | +| `ecr_repository_policy` | _none_ | AWS ECR repository policy | +| `ecr_scan_on_push` | _none_ | AWS: whether to enable image scanning on push | ## Multi registry push example diff --git a/plugin/docker.go b/plugin/docker.go index e966b37..43ea8d7 100644 --- a/plugin/docker.go +++ b/plugin/docker.go @@ -94,6 +94,9 @@ func commandBuild(build Build, dryrun bool) *exec.Cmd { for _, arg := range append(defaultBuildArgs, build.Args.Value()...) { args = append(args, "--build-arg", arg) } + if build.Secret != "" { + args = append(args, "--secret", build.Secret) + } for _, host := range build.AddHost.Value() { args = append(args, "--add-host", host) } diff --git a/plugin/impl.go b/plugin/impl.go index 563d03d..9546e0a 100644 --- a/plugin/impl.go +++ b/plugin/impl.go @@ -69,6 +69,7 @@ type Build struct { Platforms cli.StringSlice // Docker build target platforms Args cli.StringSlice // Docker build args ArgsEnv cli.StringSlice // Docker build args from env + Secret string // Docker build secret Target string // Docker build target Output string // Docker build output Pull bool // Docker build pull From 9094ae8de4544cc7753acda4dbabd24c7a2855db Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 9 Feb 2024 15:57:50 +0100 Subject: [PATCH 11/26] fix ci --- .woodpecker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index ac14d3c..0320dd3 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -12,7 +12,7 @@ variables: platforms: "linux/amd64,linux/arm64" dockerfile: Dockerfile.multiarch auto_tag: true - repo: deblan/docker-buildx + repo: gitnet.fr/deblan/docker-buildx - &login_setting - registry: https://gitnet.fr username: From 3520077c231ac5ee6cd782cdaecdcfd058af0bf9 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 9 Feb 2024 16:26:56 +0100 Subject: [PATCH 12/26] fix ci --- docs.md | 92 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/docs.md b/docs.md index ea8b7fa..bf3c8ba 100644 --- a/docs.md +++ b/docs.md @@ -29,7 +29,7 @@ It will automatically generate buildkit configuration to use custom CA certifica | Settings Name | Default | Description | -| ------------------------- | ------------------------------- | ---------------------------------------------------- | +| --- | --- | --- | | `dry-run` | `false` | disables docker push | | `repo` | _none_ | sets repository name for the image (can be a list) | | `username` | _none_ | sets username to authenticates with | @@ -92,51 +92,51 @@ docker-build: ## Advanced Settings -| Settings Name | Default | Description | -| ------------------------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -| `mirror` | _none_ | sets a registry mirror to pull images | -| `storage_driver` | _none_ | sets the docker daemon storage driver | -| `storage_path` | `/var/lib/docker` | sets the docker daemon storage path | -| `bip` | _none_ | allows the docker daemon to bride ip address | -| `mtu` | _none_ | sets docker daemon custom mtu setting | -| `custom_dns` | _none_ | sets custom docker daemon dns server | -| `custom_dns_search` | _none_ | sets custom docker daemon dns search domain | -| `insecure` | `false` | allows the docker daemon to use insecure registries | -| `ipv6` | `false` | enables docker daemon IPv6 support | -| `experimental` | `false` | enables docker daemon experimental mode | -| `debug` | `false` | enables verbose debug mode for the docker daemon | -| `daemon_off` | `false` | disables the startup of the docker daemon | -| `buildkit_debug` | `false` | enables debug output of buildkit | -| `buildkit_config` | _none_ | sets content of the docker[buildkit TOML config](https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md) | -| `buildkit_driveropt` | _none_ | adds one or multiple`--driver-opt` buildx arguments for the default buildkit builder instance | -| `tags_file` | _none_ | overrides the`tags` option with values in a file named `.tags`; multiple tags can be specified separated by a newline | -| `context` | `.` | sets the path of the build context to use | -| `auto_tag` | `false` | generates tag names automatically based on git branch and git tag, tags supplied via`tags` are additionally added to the auto_tags without suffix | -| `default_suffix"`/`auto_tag_suffix` | _none_ | generates tag names with the given suffix | -| `default_tag` | `latest` | overrides the default tag name used when generating with`auto_tag` enabled | -| `label`/`labels` | _none_ | sets labels to use for the image in format`=` | -| `default_labels`/`auto_labels` | `true` | sets docker image labels based on git information | -| `build_args` | _none_ | sets custom build arguments for the build | -| `build_args_from_env` | _none_ | forwards environment variables as custom arguments to the build | -| `secret` | _none_ | Sets the build secret for the build | -| `quiet` | `false` | enables suppression of the build output | -| `target` | _none_ | sets the build target to use | -| `cache_from` | _none_ | sets configuration for cache source | -| `cache_to` | _none_ | sets configuration for cache export | -| `cache_images` | _none_ | a list of images to use as cache. | -| `pull_image` | `true` | enforces to pull base image at build time | -| `compress` | `false` | enables compression of the build context using gzip | -| `config` | _none_ | sets content of the docker daemon json config | -| `purge` | `true` | enables cleanup of the docker environment at the end of a build | -| `no_cache` | `false` | disables the usage of cached intermediate containers | -| `add_host` | _none_ | sets additional host:ip mapping | -| `output` | _none_ | sets build output in format`type=[,=]` | -| `logins` | _none_ | option to log into multiple registries | -| `env_file` | _none_ | load env vars from specified file | -| `ecr_create_repository` | `false` | creates the ECR repository if it does not exist | -| `ecr_lifecycle_policy` | _none_ | AWS ECR lifecycle policy | -| `ecr_repository_policy` | _none_ | AWS ECR repository policy | -| `ecr_scan_on_push` | _none_ | AWS: whether to enable image scanning on push | +| Settings Name | Default | Description | +| --- | --- | --- | +| `mirror` | _none_ | sets a registry mirror to pull images | +| `storage_driver` | _none_ | sets the docker daemon storage driver | +| `storage_path` | `/var/lib/docker` | sets the docker daemon storage path | +| `bip` | _none_ | allows the docker daemon to bride ip address | +| `mtu` | _none_ | sets docker daemon custom mtu setting | +| `custom_dns` | _none_ | sets custom docker daemon dns server | +| `custom_dns_search` | _none_ | sets custom docker daemon dns search domain | +| `insecure` | `false` | allows the docker daemon to use insecure registries | +| `ipv6` | `false` | enables docker daemon IPv6 support | +| `experimental` | `false` | enables docker daemon experimental mode | +| `debug` | `false` | enables verbose debug mode for the docker daemon | +| `daemon_off` | `false` | disables the startup of the docker daemon | +| `buildkit_debug` | `false` | enables debug output of buildkit | +| `buildkit_config` | _none_ | sets content of the docker[buildkit TOML config](https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md) | +| `buildkit_driveropt` | _none_ | adds one or multiple`--driver-opt` buildx arguments for the default buildkit builder instance | +| `tags_file` | _none_ | overrides the`tags` option with values in a file named `.tags`; multiple tags can be specified separated by a newline | +| `context` | `.` | sets the path of the build context to use | +| `auto_tag` | `false` | generates tag names automatically based on git branch and git tag, tags supplied via`tags` are additionally added to the auto_tags without suffix | +| `default_suffix"`/`auto_tag_suffix` | _none_ | generates tag names with the given suffix | +| `default_tag` | `latest` | overrides the default tag name used when generating with`auto_tag` enabled | +| `label`/`labels` | _none_ | sets labels to use for the image in format`=` | +| `default_labels`/`auto_labels` | `true` | sets docker image labels based on git information | +| `build_args` | _none_ | sets custom build arguments for the build | +| `build_args_from_env` | _none_ | forwards environment variables as custom arguments to the build | +| `secret` | _none_ | Sets the build secret for the build | +| `quiet` | `false` | enables suppression of the build output | +| `target` | _none_ | sets the build target to use | +| `cache_from` | _none_ | sets configuration for cache source | +| `cache_to` | _none_ | sets configuration for cache export | +| `cache_images` | _none_ | a list of images to use as cache. | +| `pull_image` | `true` | enforces to pull base image at build time | +| `compress` | `false` | enables compression of the build context using gzip | +| `config` | _none_ | sets content of the docker daemon json config | +| `purge` | `true` | enables cleanup of the docker environment at the end of a build | +| `no_cache` | `false` | disables the usage of cached intermediate containers | +| `add_host` | _none_ | sets additional host:ip mapping | +| `output` | _none_ | sets build output in format`type=[,=]` | +| `logins` | _none_ | option to log into multiple registries | +| `env_file` | _none_ | load env vars from specified file | +| `ecr_create_repository` | `false` | creates the ECR repository if it does not exist | +| `ecr_lifecycle_policy` | _none_ | AWS ECR lifecycle policy | +| `ecr_repository_policy` | _none_ | AWS ECR repository policy | +| `ecr_scan_on_push` | _none_ | AWS: whether to enable image scanning on push | ## Multi registry push example From 139c3f063bac433b877404e20e5ca9f779a639cd Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 14 Feb 2024 17:59:30 +0100 Subject: [PATCH 13/26] transform secret from string to slice --- cmd/docker-buildx/config.go | 2 +- plugin/docker.go | 4 ++-- plugin/impl.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/docker-buildx/config.go b/cmd/docker-buildx/config.go index 7c7b219..87046d0 100644 --- a/cmd/docker-buildx/config.go +++ b/cmd/docker-buildx/config.go @@ -183,7 +183,7 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag { Usage: "forwards environment variables as custom arguments to the build", Destination: &settings.Build.ArgsEnv, }, - &cli.StringFlag{ + &cli.StringSliceFlag{ Name: "secret", EnvVars: []string{"PLUGIN_SECRET"}, Usage: "sets custom secret argument for the build", diff --git a/plugin/docker.go b/plugin/docker.go index 43ea8d7..25e7202 100644 --- a/plugin/docker.go +++ b/plugin/docker.go @@ -94,8 +94,8 @@ func commandBuild(build Build, dryrun bool) *exec.Cmd { for _, arg := range append(defaultBuildArgs, build.Args.Value()...) { args = append(args, "--build-arg", arg) } - if build.Secret != "" { - args = append(args, "--secret", build.Secret) + for _, secret := range build.Secret.Value() { + args = append(args, "--secret", secret) } for _, host := range build.AddHost.Value() { args = append(args, "--add-host", host) diff --git a/plugin/impl.go b/plugin/impl.go index 9546e0a..5d6af2c 100644 --- a/plugin/impl.go +++ b/plugin/impl.go @@ -69,7 +69,7 @@ type Build struct { Platforms cli.StringSlice // Docker build target platforms Args cli.StringSlice // Docker build args ArgsEnv cli.StringSlice // Docker build args from env - Secret string // Docker build secret + Secret cli.StringSlice // Docker build secret Target string // Docker build target Output string // Docker build output Pull bool // Docker build pull From 7870618a196e8f18e47598cd4d837b920cf650d2 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 14 Feb 2024 18:01:21 +0100 Subject: [PATCH 14/26] update ci --- .woodpecker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 0320dd3..775619f 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -33,14 +33,14 @@ steps: lint-editorconfig: image: docker.io/mstruebing/editorconfig-checker:2.7.2 when: - event: pull_request + event: push lint-format: image: *golang depends_on: vendor commands: make formatcheck when: - event: pull_request + event: push publish-dryrun: image: *build_plugin From 16cb6908e74146dffe22b752c9135469c40faf1f Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 14 Feb 2024 18:07:16 +0100 Subject: [PATCH 15/26] rename "secret" with "secrets" --- cmd/docker-buildx/config.go | 8 ++++---- plugin/docker.go | 4 ++-- plugin/impl.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/docker-buildx/config.go b/cmd/docker-buildx/config.go index 87046d0..9e56a4e 100644 --- a/cmd/docker-buildx/config.go +++ b/cmd/docker-buildx/config.go @@ -184,10 +184,10 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag { Destination: &settings.Build.ArgsEnv, }, &cli.StringSliceFlag{ - Name: "secret", - EnvVars: []string{"PLUGIN_SECRET"}, - Usage: "sets custom secret argument for the build", - Destination: &settings.Build.Secret, + Name: "secrets", + EnvVars: []string{"PLUGIN_SECRETS"}, + Usage: "sets custom secret arguments for the build", + Destination: &settings.Build.Secrets, }, &cli.BoolFlag{ Name: "quiet", diff --git a/plugin/docker.go b/plugin/docker.go index 25e7202..527e9c2 100644 --- a/plugin/docker.go +++ b/plugin/docker.go @@ -94,8 +94,8 @@ func commandBuild(build Build, dryrun bool) *exec.Cmd { for _, arg := range append(defaultBuildArgs, build.Args.Value()...) { args = append(args, "--build-arg", arg) } - for _, secret := range build.Secret.Value() { - args = append(args, "--secret", secret) + for _, secret := range build.Secrets.Value() { + args = append(args, "--secrets", secret) } for _, host := range build.AddHost.Value() { args = append(args, "--add-host", host) diff --git a/plugin/impl.go b/plugin/impl.go index 5d6af2c..55708bf 100644 --- a/plugin/impl.go +++ b/plugin/impl.go @@ -69,7 +69,7 @@ type Build struct { Platforms cli.StringSlice // Docker build target platforms Args cli.StringSlice // Docker build args ArgsEnv cli.StringSlice // Docker build args from env - Secret cli.StringSlice // Docker build secret + Secrets cli.StringSlice // Docker build secret Target string // Docker build target Output string // Docker build output Pull bool // Docker build pull From 8926c8918396d17ecd7053d74de1746f76046cbf Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 14 Feb 2024 18:07:27 +0100 Subject: [PATCH 16/26] update secret documentation --- docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs.md b/docs.md index ea8b7fa..6f882ae 100644 --- a/docs.md +++ b/docs.md @@ -118,7 +118,7 @@ docker-build: | `default_labels`/`auto_labels` | `true` | sets docker image labels based on git information | | `build_args` | _none_ | sets custom build arguments for the build | | `build_args_from_env` | _none_ | forwards environment variables as custom arguments to the build | -| `secret` | _none_ | Sets the build secret for the build | +| `secrets` | _none_ | Sets the build secrets for the build | | `quiet` | `false` | enables suppression of the build output | | `target` | _none_ | sets the build target to use | | `cache_from` | _none_ | sets configuration for cache source | From 0e85f92bb276b68ab6a6ad17583fd8d238f87461 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 14 Feb 2024 18:10:20 +0100 Subject: [PATCH 17/26] add foo --- .woodpecker.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index 775619f..76a16b7 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -65,3 +65,13 @@ steps: logins: *login_setting when: event: [push, tag, cron] + + foo: + when: [deploy] + image: gitnet.fr/deblan/docker-buildx + settings: + <<: *base_buildx_settings + dry-run: true + secrets: + - foo + - bar From cbda0a36ff1a7ce5dfcdb2d0eaee0e5a545ebd44 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 14 Feb 2024 18:10:51 +0100 Subject: [PATCH 18/26] add foo --- .woodpecker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 76a16b7..9092ee6 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -67,8 +67,9 @@ steps: event: [push, tag, cron] foo: - when: [deploy] image: gitnet.fr/deblan/docker-buildx + when: + event: [deploy] settings: <<: *base_buildx_settings dry-run: true From 6c624621c49244f9d75cb607d6d2734596845a4c Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 14 Feb 2024 18:17:32 +0100 Subject: [PATCH 19/26] add test --- .woodpecker.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 9092ee6..b3a52fc 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -21,6 +21,14 @@ variables: from_secret: registry_password steps: + foo: + image: gitnet.fr/deblan/docker-buildx + settings: + <<: *base_buildx_settings + dry-run: true + secrets: + - foo + - bar vendor: image: *golang commands: go mod vendor @@ -65,14 +73,3 @@ steps: logins: *login_setting when: event: [push, tag, cron] - - foo: - image: gitnet.fr/deblan/docker-buildx - when: - event: [deploy] - settings: - <<: *base_buildx_settings - dry-run: true - secrets: - - foo - - bar From b5d5f6a9a852c4728c1641a9e336fd17b7f028ab Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 14 Feb 2024 18:20:20 +0100 Subject: [PATCH 20/26] update foo --- .woodpecker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index b3a52fc..e7cf6a9 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -23,6 +23,8 @@ variables: steps: foo: image: gitnet.fr/deblan/docker-buildx + volumes: + - /var/run/docker.sock:/var/run/docker.sock settings: <<: *base_buildx_settings dry-run: true From 18b7a2a2fc49e44f7d20ef697f29b68f7d5c9ce8 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 14 Feb 2024 18:21:30 +0100 Subject: [PATCH 21/26] update foo --- .woodpecker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index e7cf6a9..8e97d14 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -31,6 +31,7 @@ steps: secrets: - foo - bar + vendor: image: *golang commands: go mod vendor From 571bdce941915a2afe7cdd1472c985f6ed09c035 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 14 Feb 2024 17:59:30 +0100 Subject: [PATCH 22/26] transform secret from string to slice --- cmd/docker-buildx/config.go | 10 +++++----- docs.md | 2 +- plugin/docker.go | 4 ++-- plugin/impl.go | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/docker-buildx/config.go b/cmd/docker-buildx/config.go index 7c7b219..9e56a4e 100644 --- a/cmd/docker-buildx/config.go +++ b/cmd/docker-buildx/config.go @@ -183,11 +183,11 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag { Usage: "forwards environment variables as custom arguments to the build", Destination: &settings.Build.ArgsEnv, }, - &cli.StringFlag{ - Name: "secret", - EnvVars: []string{"PLUGIN_SECRET"}, - Usage: "sets custom secret argument for the build", - Destination: &settings.Build.Secret, + &cli.StringSliceFlag{ + Name: "secrets", + EnvVars: []string{"PLUGIN_SECRETS"}, + Usage: "sets custom secret arguments for the build", + Destination: &settings.Build.Secrets, }, &cli.BoolFlag{ Name: "quiet", diff --git a/docs.md b/docs.md index ea8b7fa..6f882ae 100644 --- a/docs.md +++ b/docs.md @@ -118,7 +118,7 @@ docker-build: | `default_labels`/`auto_labels` | `true` | sets docker image labels based on git information | | `build_args` | _none_ | sets custom build arguments for the build | | `build_args_from_env` | _none_ | forwards environment variables as custom arguments to the build | -| `secret` | _none_ | Sets the build secret for the build | +| `secrets` | _none_ | Sets the build secrets for the build | | `quiet` | `false` | enables suppression of the build output | | `target` | _none_ | sets the build target to use | | `cache_from` | _none_ | sets configuration for cache source | diff --git a/plugin/docker.go b/plugin/docker.go index 43ea8d7..4b82743 100644 --- a/plugin/docker.go +++ b/plugin/docker.go @@ -94,8 +94,8 @@ func commandBuild(build Build, dryrun bool) *exec.Cmd { for _, arg := range append(defaultBuildArgs, build.Args.Value()...) { args = append(args, "--build-arg", arg) } - if build.Secret != "" { - args = append(args, "--secret", build.Secret) + for _, secret := range build.Secrets.Value() { + args = append(args, "--secret", secret) } for _, host := range build.AddHost.Value() { args = append(args, "--add-host", host) diff --git a/plugin/impl.go b/plugin/impl.go index 9546e0a..55708bf 100644 --- a/plugin/impl.go +++ b/plugin/impl.go @@ -69,7 +69,7 @@ type Build struct { Platforms cli.StringSlice // Docker build target platforms Args cli.StringSlice // Docker build args ArgsEnv cli.StringSlice // Docker build args from env - Secret string // Docker build secret + Secrets cli.StringSlice // Docker build secret Target string // Docker build target Output string // Docker build output Pull bool // Docker build pull From 981efe747b907a3cb16b3e5aaafaa4afee8543df Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 14 Feb 2024 18:28:39 +0100 Subject: [PATCH 23/26] ci --- .woodpecker.yml | 90 ++++++++++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 8e97d14..036bc6c 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -21,6 +21,51 @@ variables: from_secret: registry_password steps: + # vendor: + # image: *golang + # commands: go mod vendor + # + # test: + # image: *golang + # depends_on: vendor + # commands: go test -cover ./... + # + # lint-editorconfig: + # image: docker.io/mstruebing/editorconfig-checker:2.7.2 + # when: + # event: push + # + # lint-format: + # image: *golang + # depends_on: vendor + # commands: make formatcheck + # when: + # event: push + # + # publish-dryrun: + # image: *build_plugin + # depends_on: test + # pull: true + # settings: + # <<: *base_buildx_settings + # repo: test + # dry-run: true + # when: + # evaluate: 'not (CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images")' + # event: pull_request + # branch: + # - ${CI_REPO_DEFAULT_BRANCH} + # - renovate/* + + publish: + image: *build_plugin + depends_on: test + settings: + <<: *base_buildx_settings + logins: *login_setting + when: + event: [push, tag, cron] + foo: image: gitnet.fr/deblan/docker-buildx volumes: @@ -31,48 +76,3 @@ steps: secrets: - foo - bar - - vendor: - image: *golang - commands: go mod vendor - - test: - image: *golang - depends_on: vendor - commands: go test -cover ./... - - lint-editorconfig: - image: docker.io/mstruebing/editorconfig-checker:2.7.2 - when: - event: push - - lint-format: - image: *golang - depends_on: vendor - commands: make formatcheck - when: - event: push - - publish-dryrun: - image: *build_plugin - depends_on: test - pull: true - settings: - <<: *base_buildx_settings - repo: test - dry-run: true - when: - evaluate: 'not (CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images")' - event: pull_request - branch: - - ${CI_REPO_DEFAULT_BRANCH} - - renovate/* - - publish: - image: *build_plugin - depends_on: test - settings: - <<: *base_buildx_settings - logins: *login_setting - when: - event: [push, tag, cron] From 70cff8c55ef43f5dbf4d26217a45ea51c43cf6d1 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 14 Feb 2024 18:29:19 +0100 Subject: [PATCH 24/26] ci --- .woodpecker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.woodpecker.yml b/.woodpecker.yml index 036bc6c..3c13485 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -66,6 +66,7 @@ steps: when: event: [push, tag, cron] + foo: image: gitnet.fr/deblan/docker-buildx volumes: From 5f39f80b6bdfd4858f01606ff3b9ba7da334a5d7 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 14 Feb 2024 18:29:32 +0100 Subject: [PATCH 25/26] ci --- .woodpecker.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 3c13485..e402388 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -59,14 +59,12 @@ steps: publish: image: *build_plugin - depends_on: test settings: <<: *base_buildx_settings logins: *login_setting when: event: [push, tag, cron] - foo: image: gitnet.fr/deblan/docker-buildx volumes: From 6984af910d855b6a3dd054647d09290f9931a366 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 14 Feb 2024 18:33:32 +0100 Subject: [PATCH 26/26] update ci --- .woodpecker.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index e402388..1bb4c06 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -57,16 +57,17 @@ steps: # - ${CI_REPO_DEFAULT_BRANCH} # - renovate/* - publish: - image: *build_plugin - settings: - <<: *base_buildx_settings - logins: *login_setting - when: - event: [push, tag, cron] + # publish: + # image: *build_plugin + # settings: + # <<: *base_buildx_settings + # logins: *login_setting + # when: + # event: [push, tag, cron] foo: image: gitnet.fr/deblan/docker-buildx + pull: true volumes: - /var/run/docker.sock:/var/run/docker.sock settings: