Compare commits

...

5 Commits

Author SHA1 Message Date
d3fb8f08bc READMEs and simmilar stuff
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-11-12 17:28:20 +01:00
de7793d3d6 Value vs direction
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-11-12 17:14:21 +01:00
d30c0c6e99 Also convert cacheto to workaround
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-11-12 17:08:59 +01:00
8a6a576334 typo
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-11-12 17:00:33 +01:00
796156d4ad Added missing registry
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2023-11-12 16:56:23 +01:00
8 changed files with 18 additions and 20 deletions

View File

@@ -37,6 +37,7 @@ steps:
image: *build_plugin image: *build_plugin
settings: settings:
<<: *base_buildx_settings <<: *base_buildx_settings
registry: registry.odit.services
username: username:
from_secret: odit-registry-builder-username from_secret: odit-registry-builder-username
password: password:

View File

@@ -3,7 +3,7 @@
## Security ## Security
If you think you have found a **security issue**, please do not mention it in this repository. If you think you have found a **security issue**, please do not mention it in this repository.
Instead, send an email to security@spacebear.ee with as many details as possible so it can be handled confidential. Instead, send an email to security@odit.services with as many details as possible so it can be handled confidential.
## Bug Reports and Feature Requests ## Bug Reports and Feature Requests

View File

@@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier same "printed page" as the copyright notice for easier
identification within third-party archives. identification within third-party archives.
Copyright 2021 Robert Kaussow <mail@thegeeklab.de> Copyright 2023 ODIT.Services <info@odit.services>
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@@ -1,17 +1,9 @@
# plugin-docker-buildx # plugin-docker-buildx
<a href="https://codeberg.org/woodpecker-plugins/plugin-docker-buildx">
<img alt="Get it on Codeberg" src="https://codeberg.org/Codeberg/GetItOnCodeberg/media/branch/main/get-it-on-neon-blue.png" height="60">
</a>
Woodpecker CI plugin to build multiarch Docker images with [buildx](https://duckduckgo.com/?q=docker+buildx&ia=web). Woodpecker CI plugin to build multiarch Docker images with [buildx](https://duckduckgo.com/?q=docker+buildx&ia=web).
This plugin was initially a fork of [thegeeklab/drone-docker-buildx](https://github.com/thegeeklab/drone-docker-buildx/) (now archived in favor of this plugin) which itself was a fork of [drone-plugins/drone-docker](https://github.com/drone-plugins/drone-docker). This plugin is a fork of [woodpecker-plugins/plugin-docker-buildx](https://codeberg.org/woodpecker-plugins/plugin-docker-buildx) which was initially a fork of [thegeeklab/drone-docker-buildx](https://github.com/thegeeklab/drone-docker-buildx/) (now archived in favor of this plugin) which itself was a fork of [drone-plugins/drone-docker](https://github.com/drone-plugins/drone-docker).
You can find the full documentation at [woodpecker-ci.org](https://woodpecker-ci.org/plugins/Docker%20Buildx) ([docs.md](./docs.md)). You can find the full documentation at [woodpecker-ci.org](https://woodpecker-ci.org/plugins/Docker%20Buildx) ([docs.md](./docs.md)).
## Images
Images are available on [Dockerhub](https://hub.docker.com/r/woodpeckerci/plugin-docker-buildx) and in the [Codeberg registry](https://codeberg.org/woodpecker-plugins/-/packages/container/docker-buildx/latest).
## License ## License
This project is licensed under the Apache-2.0 License - see the [LICENSE](https://codeberg.org/woodpecker-plugins/plugin-docker-buildx/src/branch/main/LICENSE) file for details. This project is licensed under the Apache-2.0 License - see the [LICENSE](https://git.odit.services/odit/docker-buildx/src/branch/main/LICENSE) file for details.

View File

@@ -196,11 +196,11 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag {
Usage: "images to consider as cache sources", Usage: "images to consider as cache sources",
Value: &drone.StringSliceFlag{}, Value: &drone.StringSliceFlag{},
}, },
&cli.StringSliceFlag{ &cli.GenericFlag{
Name: "cache-to", Name: "cache-to",
EnvVars: []string{"PLUGIN_CACHE_TO"}, EnvVars: []string{"PLUGIN_CACHE_TO"},
Usage: "cache destination for the build cache", Usage: "cache destination for the build cache",
Destination: &settings.Build.CacheTo, Value: &drone.StringSliceFlag{},
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "pull-image", Name: "pull-image",

View File

@@ -47,9 +47,14 @@ func run(settings *plugin.Settings) cli.ActionFunc {
if !ok { if !ok {
return fmt.Errorf("failed to read cache-from input") return fmt.Errorf("failed to read cache-from input")
} }
settings.Build.CacheFrom = cacheFrom.Get() settings.Build.CacheFrom = cacheFrom.Get()
cacheTo, ok := ctx.Generic("cache-to").(*drone.StringSliceFlag)
if !ok {
return fmt.Errorf("failed to read cache-to input")
}
settings.Build.CacheTo = cacheTo.Get()
plugin := plugin.New( plugin := plugin.New(
*settings, *settings,
urfave.PipelineFromContext(ctx), urfave.PipelineFromContext(ctx),

View File

@@ -81,7 +81,7 @@ func commandBuild(build Build, dryrun bool) *exec.Cmd {
for _, arg := range build.CacheFrom { for _, arg := range build.CacheFrom {
args = append(args, "--cache-from", arg) args = append(args, "--cache-from", arg)
} }
for _, arg := range build.CacheTo.Value() { for _, arg := range build.CacheTo {
args = append(args, "--cache-to", arg) args = append(args, "--cache-to", arg)
} }
for _, arg := range build.ArgsEnv.Value() { for _, arg := range build.ArgsEnv.Value() {

View File

@@ -65,7 +65,7 @@ type Build struct {
Output string // Docker build output Output string // Docker build output
Pull bool // Docker build pull Pull bool // Docker build pull
CacheFrom []string // Docker build cache-from CacheFrom []string // Docker build cache-from
CacheTo cli.StringSlice // Docker build cache-to CacheTo []string // Docker build cache-to
Compress bool // Docker build compress Compress bool // Docker build compress
Repo cli.StringSlice // Docker build repository Repo cli.StringSlice // Docker build repository
NoCache bool // Docker build no-cache NoCache bool // Docker build no-cache