Compare commits

...

297 Commits

Author SHA1 Message Date
3c96b67e94
add deprecation notice 2023-08-29 21:37:14 +02:00
renovate[bot]
12deebdc80 chore(deps): update dependency golangci/golangci-lint to v1.54.2 2023-08-28 04:19:10 +00:00
renovate[bot]
c325b328d5 chore(docker): update golang:1.20 docker digest to 741d6f9 2023-08-17 12:19:08 +00:00
renovate[bot]
5d9b999006 chore(docker): update golang:1.20 docker digest to ee18a70 2023-08-17 04:47:22 +00:00
renovate[bot]
201c7f05d2 chore(docker): update golang:1.20 docker digest to 2db0b25 2023-08-16 16:13:03 +00:00
renovate[bot]
5d00f635ca chore(deps): update dependency golangci/golangci-lint to v1.54.1 2023-08-14 03:08:49 +00:00
renovate[bot]
bb87287089 chore(docker): update docker:24.0-dind docker digest to 020562d 2023-08-12 04:25:15 +00:00
08408124c6
chore: revert multi-registry support (#311) 2023-08-11 10:10:32 +02:00
0cc14f4114
refactor: use parameter list for multiple registries (#309) 2023-08-11 09:13:42 +02:00
renovate[bot]
6d13cf910f chore(docker): update golang:1.20 docker digest to 37c7d85 2023-08-10 07:31:34 +00:00
renovate[bot]
3b8c905a65 chore(docker): update docker:24.0-dind docker digest to 9e71442 2023-08-09 17:41:39 +00:00
renovate[bot]
bc5002fdd2
fix(deps): update module golang.org/x/sys to v0.11.0 (#302)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-09 11:36:12 +02:00
Maxim Slipenko
13c17d9c3c
feat: Add ability to push to multiple registries (#303)
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
2023-08-09 11:35:58 +02:00
renovate[bot]
56914d2332 chore(docker): update docker:24.0-dind docker digest to 9ec413d 2023-08-08 06:05:36 +00:00
renovate[bot]
c86c9bdde1 chore(docker): update golang:1.20 docker digest to bc5f0b5 2023-08-02 04:56:11 +00:00
renovate[bot]
1ad9710237 chore(docker): update docker digests 2023-08-01 06:04:26 +00:00
renovate[bot]
15751a5906 chore(docker): update docker:24.0-dind docker digest to ec0c2cf 2023-07-20 00:23:46 +00:00
renovate[bot]
7d13e5b69a
chore(deps): update dependency docker/buildx to v0.11.2 (#298)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-19 09:54:54 +02:00
renovate[bot]
3fdf306a5a chore(docker): update golang:1.20 docker digest to cfc9d1b 2023-07-14 00:04:49 +00:00
renovate[bot]
d1f882fd4f chore(docker): update docker digests 2023-07-12 03:56:15 +00:00
renovate[bot]
0f1834d73c chore(docker): update docker:24.0-dind docker digest to 1a3af94 2023-07-11 00:23:53 +00:00
renovate[bot]
7f9d843d90 chore(docker): update docker:24.0-dind docker digest to 8c39dc8 2023-07-07 00:40:31 +00:00
renovate[bot]
8017d097a0 chore(docker): update golang:1.20 docker digest to fd9306e 2023-07-06 03:06:25 +00:00
renovate[bot]
66c2e4229d
fix(deps): update module golang.org/x/sys to v0.10.0 (#288)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-05 20:31:35 +02:00
renovate[bot]
1ec20c6fb5
chore(deps): update dependency docker/buildx to v0.11.1 (#292)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-05 20:31:20 +02:00
renovate[bot]
c8532994c8 chore(docker): update golang:1.20 docker digest to 20ee7c8 2023-07-05 12:57:09 +00:00
renovate[bot]
3d174c7f05 chore(docker): update golang:1.20 docker digest to ff2cca5 2023-07-05 07:36:28 +00:00
renovate[bot]
96f9c9ed49 chore(docker): update golang:1.20 docker digest to 7954299 2023-07-05 01:35:47 +00:00
renovate[bot]
fd67a8c675
chore(docker): update docker:24.0-dind docker digest to 1d148de (#287)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-04 07:03:26 +00:00
d16fd6376b
docs: move documentation for the secrets option to parameter list (#286) 2023-06-29 21:30:58 +02:00
Grégoire Joncour
89db4c201e
fix: fix secrets format (#285) 2023-06-29 21:16:20 +02:00
c7c3ad6942
docs: add usage exaple for docker build secrets (#283) 2023-06-28 20:42:47 +02:00
Moein Nemati
a572b72527
feat: add support for docker build secrets (#282) 2023-06-28 20:26:07 +02:00
renovate[bot]
471b9e046d chore(docker): update golang:1.20 docker digest to 344193a 2023-06-24 06:18:09 +00:00
renovate[bot]
21f863a3f6 chore(docker): update golang:1.20 docker digest to 8f958bf 2023-06-22 13:12:43 +00:00
renovate[bot]
8a27c0806e chore(docker): update docker digests 2023-06-22 06:30:18 +00:00
renovate[bot]
06df8f2afa chore(deps): update dependency golangci/golangci-lint to v1.53.3 2023-06-19 04:22:21 +00:00
renovate[bot]
b072fa7b9e chore(docker): update docker digests 2023-06-18 08:18:19 +00:00
renovate[bot]
dff95931f6 chore(docker): update docker digests 2023-06-14 10:03:37 +00:00
renovate[bot]
c57a258c3f
chore(deps): update dependency docker/buildx to v0.11.0 (#273)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-14 09:45:20 +02:00
renovate[bot]
059911d61e
fix(deps): update module golang.org/x/sys to v0.9.0 (#270)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-13 15:02:13 +02:00
tired-engineer
fca6b1bfd6
docs: fix typo in the description of build_args (#271) 2023-06-13 14:39:46 +02:00
renovate[bot]
1c4e9b3073 chore(docker): update golang:1.20 docker digest to 4b1fc02 2023-06-07 00:52:40 +00:00
renovate[bot]
611035ccdb
fix(deps): update module github.com/thegeeklab/drone-plugin-lib/v2 to v2.3.4 (#268)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-05 14:08:24 +02:00
renovate[bot]
a6049b31c4
fix(deps): update module github.com/urfave/cli/v2 to v2.25.5 (#266)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-05 10:15:25 +02:00
renovate[bot]
99a5d70b8f
fix(deps): update module github.com/sirupsen/logrus to v1.9.3 (#265)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-05 10:00:44 +02:00
renovate[bot]
f023a82350
chore(deps): update dependency golangci/golangci-lint to v1.53.2 (#267)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
2023-06-05 09:51:01 +02:00
renovate[bot]
648645a830 chore(docker): update docker:24.0-dind docker digest to 5edfe30 2023-05-31 21:09:21 +00:00
renovate[bot]
4d109acb51
fix(deps): update module github.com/thegeeklab/drone-plugin-lib/v2 to v2.3.3 (#263)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-29 14:52:06 +02:00
renovate[bot]
b99fd0720f
fix(deps): update module github.com/urfave/cli/v2 to v2.25.4 (#262)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-29 11:37:30 +02:00
renovate[bot]
ec063fa39b
chore(deps): update docker docker tag to v24 (#256)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-29 11:37:17 +02:00
renovate[bot]
2da4b81716
chore(deps): update dependency docker/buildx to v0.10.5 (#258)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-28 15:19:43 +02:00
renovate[bot]
b38f5352ad
fix(deps): update module github.com/sirupsen/logrus to v1.9.2 (#255)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-26 10:58:05 +02:00
renovate[bot]
45775cfcc7 chore(docker): update golang:1.20 docker digest to 690e413 2023-05-24 09:14:02 +00:00
renovate[bot]
f89f08bb3e chore(docker): update golang:1.20 docker digest to 3f1f050 2023-05-24 00:56:58 +00:00
renovate[bot]
1a54de92c6 chore(docker): update docker:23.0-dind docker digest to 0e0a137 2023-05-23 05:40:59 +00:00
renovate[bot]
5b53750c7c chore(docker): update docker:23.0-dind docker digest to ba302fc 2023-05-19 03:19:34 +00:00
renovate[bot]
8c13c906cc chore(docker): update docker:23.0-dind docker digest to d9a1c22 2023-05-17 04:53:37 +00:00
renovate[bot]
17c3ac2ba2 chore(docker): update docker:23.0-dind docker digest to 2985399 2023-05-16 03:37:56 +00:00
renovate[bot]
902fffa343
fix(deps): update module golang.org/x/sys to v0.8.0 (#246)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-14 18:55:59 +02:00
renovate[bot]
64a4055903
fix(deps): update module github.com/urfave/cli/v2 to v2.25.3 (#249)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-13 11:14:32 +02:00
renovate[bot]
693be20096 chore(docker): update docker:23.0-dind docker digest to ed09448 2023-05-11 22:29:53 +00:00
renovate[bot]
241402cefa chore(docker): update golang:1.20 docker digest to 685a22e 2023-05-10 07:32:00 +00:00
renovate[bot]
efbe8b6e6e chore(docker): update docker:23.0-dind docker digest to 064b3ab 2023-05-10 01:49:08 +00:00
renovate[bot]
1d722de967 chore(docker): update golang:1.20 docker digest to 31a8f92 2023-05-05 07:28:11 +00:00
renovate[bot]
b27b2d16a3 chore(docker): update golang:1.20 docker digest to 4dd688d 2023-05-04 23:54:20 +00:00
renovate[bot]
16d197f139 chore(docker): update golang:1.20 docker digest to 3b2c96d 2023-05-04 16:16:07 +00:00
renovate[bot]
624c736428 chore(docker): update golang:1.20 docker digest to 6876eff 2023-05-04 06:08:18 +00:00
569dd1be9c
fix bare url in contribution file (#244) 2023-05-03 11:49:59 +02:00
renovate[bot]
65b0b881a0 chore(docker): update docker:23.0-dind docker digest to f23f0a4 2023-04-27 07:26:13 +00:00
renovate[bot]
4eec237cd9 chore(docker): update docker:23.0-dind docker digest to e40881e 2023-04-21 03:00:52 +00:00
renovate[bot]
851ecbb5ef chore(docker): update docker:23.0-dind docker digest to c20b7d2 2023-04-18 02:31:36 +00:00
renovate[bot]
cc6656fbcc
fix(deps): update module github.com/thegeeklab/drone-plugin-lib/v2 to v2.3.2 (#239)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-14 23:26:53 +02:00
renovate[bot]
f058a7737f
fix(deps): update module github.com/urfave/cli/v2 to v2.25.1 (#231)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-14 09:02:19 +02:00
renovate[bot]
5a0d317f49
fix(deps): update module golang.org/x/sys to v0.7.0 (#235)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-14 08:48:35 +02:00
renovate[bot]
0b7d0d7360 chore(docker): update golang:1.20 docker digest to 403f486 2023-04-13 12:43:56 +00:00
renovate[bot]
2abd6c261b chore(deps): update dependency mvdan/gofumpt to v0.5.0 2023-04-10 06:06:20 +00:00
renovate[bot]
4bd8227733 chore(docker): update docker digests 2023-04-05 06:37:19 +00:00
renovate[bot]
9956fdb1f2 chore(docker): update docker:23.0-dind docker digest to 29f11c7 2023-03-30 06:36:37 +00:00
renovate[bot]
7e8861c97f chore(docker): update docker:23.0-dind docker digest to 3e34497 2023-03-30 00:32:00 +00:00
renovate[bot]
8e4bc7a9f0 chore(docker): update docker digests 2023-03-28 02:09:19 +00:00
renovate[bot]
26beb7d291 chore(deps): update dependency golangci/golangci-lint to v1.52.2 2023-03-27 02:01:39 +00:00
renovate[bot]
d46b18f266 chore(docker): update golang:1.20 docker digest to 1724dc3 2023-03-25 08:17:10 +00:00
f6ce6cca84
fix: use internal dns for docker if no default is set (#228) 2023-03-24 14:04:29 +01:00
6a78c8217c
docs: use headlines instead of emphasis (#227) 2023-03-24 13:53:30 +01:00
renovate[bot]
e869c92f01 chore(docker): update golang:1.20 docker digest to 80950aa 2023-03-24 07:17:30 +00:00
renovate[bot]
f1fd95e49a chore(docker): update golang:1.20 docker digest to 8114f4a 2023-03-24 02:28:36 +00:00
renovate[bot]
5430dd47c7 chore(docker): update golang:1.20 docker digest to a13b5e3 2023-03-23 20:49:40 +00:00
renovate[bot]
93e79e7101 chore(docker): update docker:23.0-dind docker digest to 313f03f 2023-03-23 07:57:10 +00:00
renovate[bot]
c3ba0136db chore(deps): update dependency golangci/golangci-lint to v1.52.0 2023-03-20 03:05:49 +00:00
renovate[bot]
d6ae8a5a68 chore(docker): update golang:1.20 docker digest to 5990c4f 2023-03-17 16:05:47 +00:00
renovate[bot]
215ec42d05 chore(docker): update docker:23.0-dind docker digest to 3a09aaa 2023-03-14 04:11:04 +00:00
Paulo Gomes
cf1e48b342
feat: add support for SBOM attestation (#217)
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
2023-03-08 15:51:24 +01:00
renovate[bot]
a1837cc829 chore(docker): update docker digests 2023-03-08 06:51:20 +00:00
renovate[bot]
db0151c034
fix(deps): update module github.com/urfave/cli/v2 to v2.25.0 (#208) 2023-03-07 08:49:58 +01:00
renovate[bot]
122a43282f
fix(deps): update module golang.org/x/sys to v0.6.0 (#212) 2023-03-07 08:39:43 +01:00
renovate[bot]
fbd1491f9b
chore(deps): update dependency docker/buildx to v0.10.4 (#214) 2023-03-07 08:39:31 +01:00
Patrick Schratz
40f3333479
docs: add example for AWS ECR (#213) 2023-03-06 20:03:09 +01:00
renovate[bot]
e1e845eee9 chore(docker): update golang:1.20 docker digest to 52921e6 2023-03-02 13:33:51 +00:00
renovate[bot]
188917938e chore(docker): update golang:1.20 docker digest to 98b48db 2023-03-02 01:50:29 +00:00
renovate[bot]
e27f3a0b73 chore(docker): update golang:1.20 docker digest to a83a6a3 2023-03-01 17:33:22 +00:00
renovate[bot]
d81a92595b chore(deps): update dependency golangci/golangci-lint to v1.51.2 2023-02-27 07:18:02 +00:00
renovate[bot]
df0d9d563b
chore(docker): update docker:23.0-dind docker digest to 3cf33ff (#206) 2023-02-18 14:33:42 +01:00
renovate[bot]
abd5e4ddaf
chore(deps): update dependency docker/buildx to v0.10.3 (#205) 2023-02-18 14:23:49 +01:00
renovate[bot]
60517841fb chore(docker): update golang:1.20 docker digest to 2edf6aa 2023-02-16 08:57:20 +00:00
renovate[bot]
0765ce908b chore(docker): update golang:1.20 docker digest to 9911e93 2023-02-15 06:14:21 +00:00
renovate[bot]
e5eb3066d3 chore(docker): update docker digests 2023-02-11 12:03:42 +00:00
renovate[bot]
1edaff3a22 chore(docker): update docker digests 2023-02-10 11:29:14 +00:00
renovate[bot]
478bda6133 chore(docker): update golang:1.20 docker digest to 6e835db 2023-02-09 14:25:08 +00:00
dd99164fe6
ci: bump container build plugin to drone-docker-buildx:23 (#198) 2023-02-09 08:54:02 +01:00
renovate[bot]
aa5375d827 chore(docker): update docker:23.0-dind docker digest to 210f22a 2023-02-09 06:44:06 +00:00
renovate[bot]
118da3765e
chore(deps): update docker docker tag to v23 (#188) 2023-02-08 21:51:57 +01:00
renovate[bot]
7483c9f055
fix(deps): update module github.com/thegeeklab/drone-plugin-lib/v2 to v2.3.1 (#197) 2023-02-08 17:18:10 +01:00
ff7ea4bf54
fix drone-matrix template 2023-02-08 17:04:27 +01:00
renovate[bot]
784a3f8ac6
fix(deps): update module github.com/joho/godotenv to v1.5.1 (#190) 2023-02-08 11:07:13 +01:00
renovate[bot]
1864a8f487
fix(deps): update module golang.org/x/sys to v0.5.0 (#196) 2023-02-08 11:06:25 +01:00
renovate[bot]
05b420bd81
chore(deps): update golang docker tag to v1.20 (#187) 2023-02-08 10:22:27 +01:00
0688b1cf1a
refactor: add more linters and fix findings (#195) 2023-02-08 10:13:28 +01:00
renovate[bot]
3f12a30324 chore(deps): update dependency golangci/golangci-lint to v1.51.1 2023-02-06 04:27:33 +00:00
renovate[bot]
65345140a0 chore(docker): update golang:1.19 docker digest to 09009d4 2023-02-05 17:55:20 +00:00
renovate[bot]
88a9ee6e54 chore(docker): update golang:1.19 docker digest to 0ff9c06 2023-02-05 09:11:54 +00:00
renovate[bot]
687b5d5bab chore(docker): update golang:1.19 docker digest to 9e577b0 2023-02-04 17:23:53 +00:00
renovate[bot]
5df0e0551f chore(docker): update docker:20.10-dind docker digest to f02a5fc 2023-02-04 05:55:36 +00:00
renovate[bot]
97fb2f86ea
fix(deps): update module github.com/urfave/cli/v2 to v2.24.3 (#183) 2023-02-03 08:46:36 +01:00
renovate[bot]
9bb8fa7974
fix(deps): update module github.com/coreos/go-semver to v0.3.1 (#180) 2023-02-02 09:24:15 +01:00
renovate[bot]
d0dcf5c0e5
chore(deps): update dependency docker/buildx to v0.10.2 (#184) 2023-02-02 09:16:51 +01:00
renovate[bot]
6e27355e76 chore(docker): update docker:20.10-dind docker digest to c8bb6fa 2023-02-01 10:20:50 +00:00
renovate[bot]
7baa0b6982 chore(docker): update docker:20.10-dind docker digest to 4dc065b 2023-01-28 04:12:30 +00:00
renovate[bot]
7e2853fa21 chore(docker): update docker:20.10-dind docker digest to 85a1b87 2023-01-21 06:29:59 +00:00
renovate[bot]
372fd65384 chore(docker): update docker:20.10-dind docker digest to 03f2d56 2023-01-20 04:56:40 +00:00
a72a46c989
ci: replace outdated gh-pages plugin (#178) 2023-01-14 23:18:06 +01:00
bc497b988a
unify makefile syntax (#177) 2023-01-14 22:57:24 +01:00
6695e6b625
add goarm handling in makefile (#176) 2023-01-14 15:19:47 +01:00
3327233207
fix: fix docker-buildx binary in multiarch container builds (#175) 2023-01-13 22:38:17 +01:00
renovate[bot]
182782cdae chore(docker): update golang:1.19 docker digest to bb9811f 2023-01-13 11:46:58 +00:00
renovate[bot]
2f6a1ae3f0
chore(deps): pin golang docker tag to 06fc512 (#173) 2023-01-12 21:57:02 +01:00
15e7a8a4a0
remove unused drone jsonnet and docker files 2023-01-12 21:48:08 +01:00
7987e8a76b
Revert "test buildx provenance"
This reverts commit 1a1695764e.
2023-01-12 21:39:47 +01:00
1a1695764e
test buildx provenance 2023-01-12 21:35:27 +01:00
a2f76571d6
ci: test buildx multiarch builds (#172) 2023-01-12 21:21:43 +01:00
b47e4c07ed
switch back to drone-docker-buildx:20 in ci 2023-01-12 12:30:53 +01:00
09f2c9a5fc
add missing provenance attestation option 2023-01-12 12:05:43 +01:00
f81ef7b5f8
ci: disable provenance attestation 2023-01-12 11:55:12 +01:00
13e353b883
feat: add option to configure provenance attestation (#171) 2023-01-12 11:28:22 +01:00
6278d55b41
fix: add git to containers to support provenance (#170) 2023-01-12 11:22:34 +01:00
renovate[bot]
59df27455c
chore(deps): update dependency docker/buildx to v0.10.0 (#169) 2023-01-10 08:43:33 +01:00
renovate[bot]
14064978a2 chore(docker): update docker digests 2023-01-10 06:13:33 +00:00
1cf69d672e
ci: switch to buildx plugin (#167) 2023-01-08 15:39:58 +01:00
f907bd038a
docs: fix buildkit config documentation (#166) 2023-01-08 14:41:49 +01:00
8ff3997363
chore: remove support for arm32 (#165) 2023-01-08 14:26:08 +01:00
renovate[bot]
320b8ae71e chore(docker): update docker digests 2023-01-06 03:22:05 +00:00
renovate[bot]
08ef01bfae chore(docker): update docker digests 2022-12-22 04:57:51 +00:00
66bc2aea6b
docs: add example for custom registires (#161) 2022-12-21 09:54:17 +01:00
renovate[bot]
3087aad807
fix(deps): update module github.com/thegeeklab/drone-plugin-lib/v2 to v2.2.1 (#160) 2022-12-21 08:45:10 +01:00
renovate[bot]
f3aceaea84
fix(deps): update module github.com/urfave/cli/v2 to v2.23.7 (#156) 2022-12-20 21:06:31 +01:00
renovate[bot]
7e2ddcf8c6 chore(docker): update docker digests 2022-12-17 05:46:57 +00:00
renovate[bot]
dc297a454a chore(docker): update docker digests 2022-12-06 05:20:27 +00:00
renovate[bot]
65595067ad chore(docker): update docker digests 2022-11-29 06:14:22 +00:00
f7063369b6
docs: fix properties file syntax due to changes in the theme (#154) 2022-11-24 13:55:22 +01:00
renovate[bot]
d67ab72c0a
fix(deps): update module github.com/urfave/cli/v2 to v2.23.5 (#149) 2022-11-24 09:45:30 +01:00
52bc04ee19
ci: create symlink for xgo source directory (#152) 2022-11-24 09:35:50 +01:00
renovate[bot]
9ca985065a chore(docker): update docker digests 2022-11-17 00:13:12 +00:00
renovate[bot]
70a877a6d8 chore(docker): update docker digests 2022-11-11 02:25:43 +00:00
4c83b8f38d
docs: add escape example for cache_from parameter (#148) 2022-11-01 21:49:13 +01:00
b302ea6f8c
chore: remove unused purge parameter (#147) 2022-11-01 14:04:49 +01:00
248b7a5b77
fix: allow escaping of commas in plugin list options (#142) 2022-10-31 20:10:18 +01:00
renovate[bot]
f058ddd6d7
fix(deps): update module github.com/thegeeklab/drone-plugin-lib/v2 to v2.2.0 (#143) 2022-10-31 19:59:20 +01:00
renovate[bot]
2c61bd397a
fix(deps): update module github.com/urfave/cli/v2 to v2.23.0 (#126) 2022-10-31 12:45:15 +01:00
renovate[bot]
32f3560d88 chore(docker): update docker digests 2022-10-26 21:06:03 +00:00
renovate[bot]
0076994501 chore(docker): update docker:20.10-dind docker digest to 3fd7eae 2022-10-26 12:45:34 +00:00
renovate[bot]
101c158c5b chore(docker): update docker digests 2022-10-25 07:17:35 +00:00
renovate[bot]
3d4fbc6ed7 chore(deps): update dependency golangci/golangci-lint to v1.50.1 2022-10-24 04:43:56 +00:00
renovate[bot]
f3c4a68701 chore(docker): update docker digests 2022-10-20 23:52:30 +00:00
renovate[bot]
4186051fde chore(deps): update golang dev tools (non-major) 2022-10-10 05:27:32 +00:00
Richard Jennings
0bd2634a1e
feat: add extra_tags option to set tags including additional registries (#134) 2022-10-09 14:05:05 +02:00
Richard Jennings
4171f3d711
feat: add option to support buildx --label flag (#132) 2022-09-20 21:35:29 +02:00
renovate[bot]
fb64593ea2 chore(docker): update docker digests 2022-09-08 13:18:40 +00:00
renovate[bot]
2630000147 chore(deps): update dependency golangci/golangci-lint to v1.49.0 2022-08-29 03:42:03 +00:00
dbe88b9ce7
docs: fix data file formatting 2022-08-21 22:47:59 +02:00
renovate[bot]
f08db63568
chore(deps): update dependency docker/buildx to v0.9.1 (#128) 2022-08-19 12:01:54 +02:00
renovate[bot]
a2edd82918
chore(deps): update dependency docker/buildx to v0.9.0 (#127)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-18 22:00:09 +02:00
renovate[bot]
a9a2c6c47b chore(docker): update docker digests to 9081d99 2022-08-09 22:15:48 +00:00
Martin Honermeyer
d264446eb5
feat: add cache_to option and remove manual image pull for cache_from images (#124) 2022-08-08 13:36:23 +02:00
renovate[bot]
9af3f0cec2 chore(deps): update dependency golangci/golangci-lint to v1.48.0 2022-08-08 03:30:05 +00:00
renovate[bot]
8e17100464
fix(deps): update module github.com/thegeeklab/drone-plugin-lib/v2 to v2.1.0 (#122) 2022-08-05 16:56:32 +02:00
renovate[bot]
aada3de2d4
fix(deps): update module github.com/urfave/cli/v2 to v2.11.1 (#117) 2022-08-05 13:19:14 +02:00
d6f552cf6d
chore: switch to go1.19 (#121) 2022-08-05 13:18:09 +02:00
renovate[bot]
069e4aed70 chore(docker): update docker digests to 4d4e2a4 2022-08-02 07:11:57 +00:00
renovate[bot]
c9934ab51f chore(deps): update dependency golangci/golangci-lint to v1.47.2 2022-07-25 02:49:24 +00:00
b08866cc0b
fix: add option to set additional build contexts (#116) 2022-07-24 12:48:02 +02:00
renovate[bot]
734b782608
fix(deps): update module github.com/sirupsen/logrus to v1.9.0 (#114) 2022-07-21 09:56:57 +02:00
fc08ea17a7
fix worind in readme and adjust repo config 2022-07-21 09:47:53 +02:00
renovate[bot]
dedda30f40 chore(docker): update docker digests to b14dd07 2022-07-21 04:19:54 +00:00
renovate[bot]
af1671c2c6 chore(docker): update docker digests to e474daa 2022-07-19 13:17:08 +00:00
renovate[bot]
1259165af2 chore(docker): update docker digest to 70cd116 2022-07-19 00:56:07 +00:00
9c8c9df5f5
ci: switch alpine-tools image 2022-07-17 20:45:21 +02:00
renovate[bot]
25bcaaebe0
fix(deps): update module github.com/thegeeklab/drone-plugin-lib/v2 to v2.0.2 (#111) 2022-07-12 16:40:05 +02:00
cda7e13529
docs: fix spelling in readme 2022-07-12 09:12:25 +02:00
yiwenwang2090
8ad42c155b
docs: fix spelling in readme (#110) 2022-07-12 09:04:18 +02:00
renovate[bot]
cd3ee0b036
fix(deps): update module github.com/urfave/cli/v2 to v2.11.0 (#107) 2022-07-11 08:51:40 +02:00
renovate[bot]
0efa6d0259 chore(docker): update docker digests to e51c69a 2022-06-28 01:01:03 +00:00
renovate[bot]
a0423612a3
fix(deps): update module github.com/thegeeklab/drone-plugin-lib/v2 to v2.0.1 (#106) 2022-06-20 21:04:00 +02:00
renovate[bot]
9de74c48ee
fix(deps): update module github.com/urfave/cli/v2 to v2.10.1 (#105) 2022-06-20 10:27:30 +02:00
Renovate Bot
d328801aeb chore(docker): update docker digests to c82526b 2022-06-07 22:21:42 +00:00
fe003ec38d
fix typo in config description 2022-06-02 21:50:32 +02:00
a893c63e5d
docs: refactor plugin properties 2022-06-02 21:48:53 +02:00
12dd9fea01
refactor: add plugin flags to category 2022-06-02 21:26:34 +02:00
db4c4bee72
fix(deps): update module github.com/thegeeklab/drone-plugin-lib to v2 2022-06-02 15:00:33 +02:00
Renovate Bot
d297a380ee chore(docker): update docker digests to cafb0c7 2022-06-01 03:59:17 +00:00
renovate[bot]
2fafc223db
fix(deps): update module github.com/urfave/cli/v2 to v2.8.1 (#101) 2022-05-29 14:06:15 +02:00
Renovate Bot
9e8c306d6a chore(docker): update docker digests to c53c87e 2022-05-27 04:37:59 +00:00
Renovate Bot
112808149a chore(deps): update dependency golangci/golangci-lint to v1.46.2 2022-05-23 05:52:42 +00:00
renovate[bot]
c5466c4a6f
fix(deps): update module github.com/urfave/cli/v2 to v2.7.1 (#96) 2022-05-20 15:52:24 +02:00
Renovate Bot
404e1a4df5 chore(docker): update docker digests to bba1e8c 2022-05-19 01:08:27 +00:00
Renovate Bot
98076dfad0 chore(docker): update docker digests to cdc3036 2022-05-13 01:24:23 +00:00
Renovate Bot
7e1ae8db6a chore(docker): update docker digests to e5bc753 2022-05-11 03:51:02 +00:00
Renovate Bot
f0b62a931e chore(docker): update docker digests to 333ea25 2022-05-06 04:05:41 +00:00
768b061514
refactor: switch to forked thegeeklab/drone-plugin-lib (#94) 2022-05-03 22:47:51 +02:00
renovate[bot]
7dd172d417
fix(deps): update module github.com/urfave/cli/v2 to v2.5.1 (#92) 2022-05-02 21:56:20 +02:00
e428096ca8
docs: fix hugo hint shortcode 2022-05-02 21:47:12 +02:00
renovate[bot]
716bb7c7ac
fix(deps): update module github.com/urfave/cli/v2 to v2.4.8 (#88) 2022-04-25 12:54:36 +02:00
fef64f2b79
ci: refactor build tools and ci setup (#90) 2022-04-25 12:51:42 +02:00
Renovate Bot
770a1cd1ab chore(docker): update docker digests to 393cc1a 2022-04-05 15:18:13 +00:00
renovate[bot]
ef4a67d1ee
chore(deps): update dependency docker/buildx to v0.8.2 (#86) 2022-04-04 09:04:19 +02:00
renovate[bot]
6d20bc6de0
chore(deps): update dependency docker/buildx to v0.8.1 (#79) 2022-03-30 22:43:06 +02:00
dc3b20d794
chore: switch to go1.18 as build requirement (#85) 2022-03-30 22:41:25 +02:00
Renovate Bot
ed5b82d5d6 chore(docker): update docker digest to e816908 2022-03-29 19:25:59 +00:00
Renovate Bot
011fceff83 chore(docker): update docker digests to d74f218 2022-03-29 13:20:23 +00:00
Renovate Bot
c293628a84 chore(docker): update docker digests to 75505cc 2022-03-24 12:33:04 +00:00
Renovate Bot
497defbdf0 chore(docker): update docker digest to fcbd7ca 2022-03-23 20:28:50 +00:00
Renovate Bot
77f2dfaeb4 chore(docker): update docker digests to e6222d4 2022-03-18 16:38:19 +00:00
renovate[bot]
51ff675a33
fix(deps): update module github.com/urfave/cli/v2 to v2.4.0 (#76) 2022-03-15 20:53:59 +01:00
Renovate Bot
af3a9cf087 chore(docker): update docker digests to d48bf6b 2022-03-11 17:28:28 +00:00
renovate[bot]
1fc702e09c
chore(deps): update dependency docker/buildx to v0.8.0 (#74) 2022-03-10 09:39:37 +01:00
Renovate Bot
4ca3c1f5bb chore(docker): update docker digests to af0ce9e 2022-02-14 11:56:12 +00:00
df617139de
docs: adjust helptext for the output option (#72) 2022-01-27 22:02:58 +01:00
Martin Honermeyer
ee13dd891e
feat: add output option to set the export action for build results (#71) 2022-01-27 21:53:46 +01:00
25c057585e
docs: fix build command (#69) 2022-01-12 10:36:15 +01:00
6af488bcd7
docs: clarify versioning and handling of breaking changes 2022-01-12 10:07:49 +01:00
17016c9f49
fix: fix auto_tag behavior to avoid unexpected publishing (#68)
BREAKING CHANGE: `latest` has been removed from the default `tags` list, which is now empty. You must specify `auto_tag` or `tags` option, otherwise the plugin will build but __never__ tag and push the image.
2022-01-12 09:10:27 +01:00
a3e33afdf6
chore: end of the year maintenance 2021-12-21 10:54:53 +01:00
f82f66b03d
fix renovate preset config 2021-12-21 09:55:58 +01:00
b34f887e33
chore: adjust changelog template to link to prs instead of issues (#64) 2021-12-12 13:19:54 +01:00
renovate[bot]
fb80a7b1ed
chore(deps): update dependency docker/buildx to v0.7.1 (#63) 2021-11-26 14:40:29 +01:00
16441d4efb
fix license name in readme (#61) 2021-11-16 13:41:50 +01:00
renovate[bot]
e00fc707a9
chore(deps): update dependency docker/buildx to v0.7.0 (#59) 2021-11-11 20:01:30 +01:00
renovate[bot]
c2d59aae6c
fix(deps): update module honnef.co/go/tools to v0.2.2 (#60) 2021-11-11 19:55:13 +01:00
Renovate Bot
094150fddc chore(docker): update docker:20.10-dind docker digest to d20f086 2021-10-05 20:37:34 +00:00
Renovate Bot
db51c23ee4 chore(docker): update docker digests 2021-10-05 09:01:48 +00:00
renovate[bot]
6ff2225863
fix(deps): update module github.com/joho/godotenv to v1.4.0 (#55) 2021-09-25 12:07:54 +02:00
41627dfb62
improve changelog template 2021-09-22 11:48:47 +02:00
0f8af695e7
improve drone-matrix template 2021-09-22 09:57:42 +02:00
515f68778e
fix drone yaml format and switch to drone-matrix plugin (#54) 2021-09-19 20:41:41 +02:00
8ea08c698a
docs: add missing plugin description 2021-09-11 21:30:14 +02:00
2404bc12a1
docs: add parameter documentation (#53) 2021-09-11 21:15:02 +02:00
276f215b24
fix: remove unimplemented squash option (#52) 2021-09-07 21:34:47 +02:00
Renovate Bot
708587693c chore(docker): update docker digests 2021-09-01 14:56:23 +00:00
Renovate Bot
f568309a37 chore(docker): update docker:20.10-dind docker digest to 05464e7 2021-09-01 02:31:10 +00:00
renovate[bot]
b6b0f413a0
chore(deps): update dependency docker/buildx to v0.6.3 (#48)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-31 10:53:00 +02:00
Renovate Bot
d389d16a7d chore(docker): update docker:20.10-dind docker digest to c0aac52 2021-08-24 14:33:13 +00:00
Renovate Bot
3e9f3fef08 chore(docker): update docker digests 2021-08-24 12:48:16 +00:00
renovate[bot]
069e83d6b9
fix(deps): update module honnef.co/go/tools to v0.2.1 (#43)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-23 20:59:18 +02:00
renovate[bot]
6a6997f990
chore(deps): update dependency docker/buildx to v0.6.2 (#44)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-08-23 20:59:07 +02:00
renovate[bot]
52b4cc2805
chore(deps): update dependency docker/buildx to v0.6.1 (#38)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-07-31 23:58:50 +02:00
renovate[bot]
6dda099539
chore(deps): update dependency docker/buildx to v0.6.0 (#34)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-07-25 14:28:43 +02:00
a5a561fd91
feat: load buildkit config from string instead of file (#37) 2021-07-25 14:28:33 +02:00
Renovate Bot
8f25682501 chore(deps): update docker digests 2021-07-21 20:18:32 +00:00
Renovate Bot
6938b6dbca chore(deps): update docker digests 2021-07-14 23:24:58 +00:00
Albie
904641bf10
feat: add option to specify buildkit config file path (#32) 2021-07-08 09:00:51 +02:00
380e304e7a
add drone-docker-buildx-ecr to readme 2021-07-03 15:26:01 +02:00
29f1707797
cleanup unused code 2021-07-03 15:09:12 +02:00
Maarten De Wispelaere
2e0e0dd7d7
Possible fix for https://github.com/thegeeklab/drone-docker-buildx/issues/28 (#30) 2021-07-02 18:58:55 +02:00
a6cc96fbda
fix: allow multi-platform builds using --push flag (#29) 2021-06-16 22:21:00 +02:00
renovate[bot]
562ee26fda
fix(deps): update module honnef.co/go/tools to v0.2.0 (#27)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-05-25 17:44:48 +02:00
6f18dff4d9
disable require branches to be up to date 2021-05-25 17:44:06 +02:00
5f01026c5c
chore: update build env to golang 1.16 (#26) 2021-05-10 09:03:59 +02:00
7148b3d306
chore: improve generated changelog (#25) 2021-05-09 23:46:51 +02:00
Renovate Bot
26339083ac chore(deps): update docker digests 2021-05-07 15:12:36 +00:00
Renovate Bot
fe0b3e924d chore(deps): update docker digests 2021-04-14 23:59:23 +00:00
Renovate Bot
ebc095efb4 chore(deps): update docker digests 2021-04-12 22:24:21 +00:00
Renovate Bot
b1dda964ea chore(deps): update docker digests 2021-04-01 16:07:14 +00:00
Renovate Bot
3170764381 chore(deps): update docker digests 2021-03-26 12:58:55 +00:00
renovate[bot]
421de00a8e
fix(deps): update module github.com/sirupsen/logrus to v1.8.1 (#18)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-03-10 08:16:36 +01:00
Renovate Bot
61d24fd8f6 chore(deps): update docker digests 2021-03-03 03:47:04 +00:00
Renovate Bot
9f2084c859 chore(deps): update docker digests 2021-03-02 02:17:04 +00:00
Renovate Bot
4cf00e322a chore(deps): update amd64/docker:20.10-dind docker digest to 203e624 2021-02-18 05:29:41 +00:00
Renovate Bot
e92fd13f90 chore(deps): update arm64v8/docker:20.10-dind docker digest to 83202d3 2021-02-17 23:21:14 +00:00
renovate[bot]
ef505ec241
chore(deps): update module sirupsen/logrus to v1.8.0 (#13)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-02-17 22:10:49 +01:00
renovate[bot]
dbaf922a53
chore(deps): update module sirupsen/logrus to v1.7.1 (#12)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-02-16 11:57:34 +01:00
1d7bcf2572
rebuild drone config (#11) 2021-02-15 20:31:22 +01:00
e740a7bc76
fix: normalize version variable in buildx download url 2021-02-15 20:18:31 +01:00
d32a1ee2d0
ci: auto-generate changelog (#10) 2021-02-15 10:46:58 +01:00
Florian Piesche
b0a0e149b3
fix: get arm64 verson of buildx for arm64 image (#8) 2021-02-15 10:29:26 +01:00
Florian Piesche
1a372ede32
Get armv7 version of buildx for arm image (#9) 2021-02-15 10:28:50 +01:00
Renovate Bot
c33198a1c8 chore(deps): update arm64v8/docker:20.10-dind docker digest to 6188423 2021-02-11 13:00:44 +00:00
Renovate Bot
70d8b355d1 chore(deps): update amd64/docker:20.10-dind docker digest to 15ba912 2021-02-11 07:20:03 +00:00
renovate[bot]
91e5526677
chore(deps): update dependency docker/buildx to v0.5.1 (#5)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-01-31 22:56:13 +01:00
36 changed files with 1284 additions and 1201 deletions

23
.chglog/CHANGELOG.tpl.md Executable file
View File

@ -0,0 +1,23 @@
# Changelog
{{ range .Versions -}}
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }})
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ (regexReplaceAll "(.*)/issues/(.*)" (regexReplaceAll "(Co-\\w*-by.*)" .Subject "") "${1}/pull/${2}") | trim }}
{{ end }}
{{- end -}}
{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

25
.chglog/config.yml Executable file
View File

@ -0,0 +1,25 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/thegeeklab/drone-docker-buildx
options:
commit_groups:
title_maps:
feat: Features
fix: Bug Fixes
perf: Performance Improvements
refactor: Code Refactoring
chore: Others
test: Testing
ci: CI Pipeline
docs: Documentation
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE

20
.dictionary Normal file
View File

@ -0,0 +1,20 @@
url
ip
mtu
dns
ipv6
buildkit
json
config
dockerfile
og
gzip
toml
config
host:ip
drone-docker-buildx
multiarch
buildx
DockerHub
ECR
GHCR

View File

@ -1,322 +0,0 @@
local PipelineTest = {
kind: 'pipeline',
image_pull_secrets: ['docker_config'],
name: 'test',
platform: {
os: 'linux',
arch: 'amd64',
},
steps: [
{
name: 'staticcheck',
image: 'golang:1.15',
commands: [
'go run honnef.co/go/tools/cmd/staticcheck ./...',
],
volumes: [
{
name: 'gopath',
path: '/go',
},
],
},
{
name: 'lint',
image: 'golang:1.15',
commands: [
'go run golang.org/x/lint/golint -set_exit_status ./...',
],
volumes: [
{
name: 'gopath',
path: '/go',
},
],
},
{
name: 'vet',
image: 'golang:1.15',
commands: [
'go vet ./...',
],
volumes: [
{
name: 'gopath',
path: '/go',
},
],
},
{
name: 'test',
image: 'golang:1.15',
commands: [
'go test -cover ./...',
],
volumes: [
{
name: 'gopath',
path: '/go',
},
],
},
],
volumes: [
{
name: 'gopath',
temp: {},
},
],
trigger: {
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
},
};
local PipelineBuildBinaries = {
kind: 'pipeline',
image_pull_secrets: ['docker_config'],
name: 'build-binaries',
platform: {
os: 'linux',
arch: 'amd64',
},
steps: [
{
name: 'build',
image: 'techknowlogick/xgo:go-1.15.x',
commands: [
'[ -z "${DRONE_TAG}" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=${DRONE_TAG##v}',
'mkdir -p release/',
"cd cmd/drone-docker-buildx && xgo -ldflags \"-s -w -X main.version=$BUILD_VERSION\" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm64' -out drone-docker-buildx .",
'mv /build/* /drone/src/release/',
],
},
{
name: 'executable',
image: 'alpine',
commands: [
'$(find release/ -executable -type f | grep drone-docker-buildx-linux-amd64) --help',
],
},
{
name: 'compress',
image: 'alpine',
commands: [
'apk add upx',
'find release/ -maxdepth 1 -executable -type f -exec upx {} \\;',
'ls -lh release/',
],
},
{
name: 'checksum',
image: 'alpine',
commands: [
'cd release/ && sha256sum * > sha256sum.txt',
],
},
{
name: 'publish',
image: 'plugins/github-release',
settings: {
overwrite: true,
api_key: {
from_secret: 'github_token',
},
files: ['release/*'],
title: '${DRONE_TAG}',
note: 'CHANGELOG.md',
},
when: {
ref: [
'refs/tags/**',
],
},
},
],
depends_on: [
'test',
],
trigger: {
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
},
};
local PipelineBuildContainer(arch='amd64') = {
kind: 'pipeline',
image_pull_secrets: ['docker_config'],
name: 'build-container-' + arch,
platform: {
os: 'linux',
arch: arch,
},
steps: [
{
name: 'build',
image: 'golang:1.15',
commands: [
'[ -z "${DRONE_TAG}" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=${DRONE_TAG##v}',
'go build -v -ldflags "-X main.version=$BUILD_VERSION" -a -tags netgo -o release/' + arch + '/drone-docker-buildx ./cmd/drone-docker-buildx',
],
},
{
name: 'dryrun',
image: 'plugins/docker:19',
settings: {
config: { from_secret: 'docker_config' },
dry_run: true,
dockerfile: 'docker/Dockerfile.' + arch,
repo: 'thegeeklab/${DRONE_REPO_NAME}',
username: { from_secret: 'docker_username' },
password: { from_secret: 'docker_password' },
},
depends_on: ['build'],
when: {
ref: ['refs/pull/**'],
},
},
{
name: 'publish-dockerhub',
image: 'plugins/docker:19',
settings: {
config: { from_secret: 'docker_config' },
auto_tag: true,
auto_tag_suffix: arch,
dockerfile: 'docker/Dockerfile.' + arch,
repo: 'thegeeklab/${DRONE_REPO_NAME}',
username: { from_secret: 'docker_username' },
password: { from_secret: 'docker_password' },
},
when: {
ref: ['refs/heads/main', 'refs/tags/**'],
},
depends_on: ['dryrun'],
},
{
name: 'publish-quay',
image: 'plugins/docker:19',
settings: {
config: { from_secret: 'docker_config' },
auto_tag: true,
auto_tag_suffix: arch,
dockerfile: 'docker/Dockerfile.' + arch,
registry: 'quay.io',
repo: 'quay.io/thegeeklab/${DRONE_REPO_NAME}',
username: { from_secret: 'quay_username' },
password: { from_secret: 'quay_password' },
},
when: {
ref: ['refs/heads/main', 'refs/tags/**'],
},
depends_on: ['dryrun'],
},
],
depends_on: [
'test',
],
trigger: {
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
},
};
local PipelineNotifications = {
kind: 'pipeline',
image_pull_secrets: ['docker_config'],
name: 'notifications',
platform: {
os: 'linux',
arch: 'amd64',
},
steps: [
{
image: 'plugins/manifest',
name: 'manifest-dockerhub',
settings: {
ignore_missing: true,
auto_tag: true,
username: { from_secret: 'docker_username' },
password: { from_secret: 'docker_password' },
spec: 'docker/manifest.tmpl',
},
when: {
status: ['success'],
},
},
{
image: 'plugins/manifest',
name: 'manifest-quay',
settings: {
ignore_missing: true,
auto_tag: true,
username: { from_secret: 'quay_username' },
password: { from_secret: 'quay_password' },
spec: 'docker/manifest-quay.tmpl',
},
when: {
status: ['success'],
},
},
{
name: 'pushrm-dockerhub',
image: 'chko/docker-pushrm:1',
environment: {
DOCKER_PASS: {
from_secret: 'docker_password',
},
DOCKER_USER: {
from_secret: 'docker_username',
},
PUSHRM_FILE: 'README.md',
PUSHRM_SHORT: 'Drone plugin to build multiarch Docker images with buildx',
PUSHRM_TARGET: 'thegeeklab/${DRONE_REPO_NAME}',
},
when: {
status: ['success'],
},
},
{
name: 'pushrm-quay',
image: 'chko/docker-pushrm:1',
environment: {
APIKEY__QUAY_IO: {
from_secret: 'quay_token',
},
PUSHRM_FILE: 'README.md',
PUSHRM_TARGET: 'quay.io/thegeeklab/${DRONE_REPO_NAME}',
},
when: {
status: ['success'],
},
},
{
name: 'matrix',
image: 'plugins/matrix',
settings: {
homeserver: { from_secret: 'matrix_homeserver' },
roomid: { from_secret: 'matrix_roomid' },
template: 'Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}',
username: { from_secret: 'matrix_username' },
password: { from_secret: 'matrix_password' },
},
when: {
status: ['success', 'failure'],
},
},
],
depends_on: [
'build-binaries',
'build-container-amd64',
'build-container-arm64',
],
trigger: {
ref: ['refs/heads/main', 'refs/tags/**'],
status: ['success', 'failure'],
},
};
[
PipelineTest,
PipelineBuildBinaries,
PipelineBuildContainer(arch='amd64'),
PipelineBuildContainer(arch='arm64'),
PipelineNotifications,
]

View File

@ -1,386 +0,0 @@
---
kind: pipeline
name: test
platform:
os: linux
arch: amd64
steps:
- name: staticcheck
image: golang:1.15
commands:
- go run honnef.co/go/tools/cmd/staticcheck ./...
volumes:
- name: gopath
path: /go
- name: lint
image: golang:1.15
commands:
- go run golang.org/x/lint/golint -set_exit_status ./...
volumes:
- name: gopath
path: /go
- name: vet
image: golang:1.15
commands:
- go vet ./...
volumes:
- name: gopath
path: /go
- name: test
image: golang:1.15
commands:
- go test -cover ./...
volumes:
- name: gopath
path: /go
volumes:
- name: gopath
temp: {}
image_pull_secrets:
- docker_config
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
---
kind: pipeline
name: build-binaries
platform:
os: linux
arch: amd64
steps:
- name: build
image: techknowlogick/xgo:go-1.15.x
commands:
- "[ -z \"${DRONE_TAG}\" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=${DRONE_TAG##v}"
- mkdir -p release/
- cd cmd/drone-docker-buildx && xgo -ldflags "-s -w -X main.version=$BUILD_VERSION" -tags netgo -targets 'linux/amd64,linux/arm-6,linux/arm64' -out drone-docker-buildx .
- mv /build/* /drone/src/release/
- name: executable
image: alpine
commands:
- $(find release/ -executable -type f | grep drone-docker-buildx-linux-amd64) --help
- name: compress
image: alpine
commands:
- apk add upx
- find release/ -maxdepth 1 -executable -type f -exec upx {} \;
- ls -lh release/
- name: checksum
image: alpine
commands:
- cd release/ && sha256sum * > sha256sum.txt
- name: publish
image: plugins/github-release
settings:
api_key:
from_secret: github_token
files:
- release/*
note: CHANGELOG.md
overwrite: true
title: ${DRONE_TAG}
when:
ref:
- refs/tags/**
image_pull_secrets:
- docker_config
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
depends_on:
- test
---
kind: pipeline
name: build-container-amd64
platform:
os: linux
arch: amd64
steps:
- name: build
image: golang:1.15
commands:
- "[ -z \"${DRONE_TAG}\" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=${DRONE_TAG##v}"
- go build -v -ldflags "-X main.version=$BUILD_VERSION" -a -tags netgo -o release/amd64/drone-docker-buildx ./cmd/drone-docker-buildx
- name: dryrun
image: plugins/docker:19
settings:
config:
from_secret: docker_config
dockerfile: docker/Dockerfile.amd64
dry_run: true
password:
from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: docker_username
when:
ref:
- refs/pull/**
depends_on:
- build
- name: publish-dockerhub
image: plugins/docker:19
settings:
auto_tag: true
auto_tag_suffix: amd64
config:
from_secret: docker_config
dockerfile: docker/Dockerfile.amd64
password:
from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: docker_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- dryrun
- name: publish-quay
image: plugins/docker:19
settings:
auto_tag: true
auto_tag_suffix: amd64
config:
from_secret: docker_config
dockerfile: docker/Dockerfile.amd64
password:
from_secret: quay_password
registry: quay.io
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: quay_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- dryrun
image_pull_secrets:
- docker_config
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
depends_on:
- test
---
kind: pipeline
name: build-container-arm64
platform:
os: linux
arch: arm64
steps:
- name: build
image: golang:1.15
commands:
- "[ -z \"${DRONE_TAG}\" ] && BUILD_VERSION=${DRONE_COMMIT_SHA:0:8} || BUILD_VERSION=${DRONE_TAG##v}"
- go build -v -ldflags "-X main.version=$BUILD_VERSION" -a -tags netgo -o release/arm64/drone-docker-buildx ./cmd/drone-docker-buildx
- name: dryrun
image: plugins/docker:19
settings:
config:
from_secret: docker_config
dockerfile: docker/Dockerfile.arm64
dry_run: true
password:
from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: docker_username
when:
ref:
- refs/pull/**
depends_on:
- build
- name: publish-dockerhub
image: plugins/docker:19
settings:
auto_tag: true
auto_tag_suffix: arm64
config:
from_secret: docker_config
dockerfile: docker/Dockerfile.arm64
password:
from_secret: docker_password
repo: thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: docker_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- dryrun
- name: publish-quay
image: plugins/docker:19
settings:
auto_tag: true
auto_tag_suffix: arm64
config:
from_secret: docker_config
dockerfile: docker/Dockerfile.arm64
password:
from_secret: quay_password
registry: quay.io
repo: quay.io/thegeeklab/${DRONE_REPO_NAME}
username:
from_secret: quay_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- dryrun
image_pull_secrets:
- docker_config
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
depends_on:
- test
---
kind: pipeline
name: notifications
platform:
os: linux
arch: amd64
steps:
- name: manifest-dockerhub
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
password:
from_secret: docker_password
spec: docker/manifest.tmpl
username:
from_secret: docker_username
when:
status:
- success
- name: manifest-quay
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
password:
from_secret: quay_password
spec: docker/manifest-quay.tmpl
username:
from_secret: quay_username
when:
status:
- success
- name: pushrm-dockerhub
image: chko/docker-pushrm:1
environment:
DOCKER_PASS:
from_secret: docker_password
DOCKER_USER:
from_secret: docker_username
PUSHRM_FILE: README.md
PUSHRM_SHORT: Drone plugin to build multiarch Docker images with buildx
PUSHRM_TARGET: thegeeklab/${DRONE_REPO_NAME}
when:
status:
- success
- name: pushrm-quay
image: chko/docker-pushrm:1
environment:
APIKEY__QUAY_IO:
from_secret: quay_token
PUSHRM_FILE: README.md
PUSHRM_TARGET: quay.io/thegeeklab/${DRONE_REPO_NAME}
when:
status:
- success
- name: matrix
image: plugins/matrix
settings:
homeserver:
from_secret: matrix_homeserver
password:
from_secret: matrix_password
roomid:
from_secret: matrix_roomid
template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}"
username:
from_secret: matrix_username
when:
status:
- success
- failure
image_pull_secrets:
- docker_config
trigger:
ref:
- refs/heads/main
- refs/tags/**
status:
- success
- failure
depends_on:
- build-binaries
- build-container-amd64
- build-container-arm64
---
kind: signature
hmac: f3927845c8739c33bd85d97dc6a81e73b88de2bfb4e592b6943db9e890bb4d47
...

17
.github/settings.yml vendored
View File

@ -1,6 +1,7 @@
repository:
name: drone-docker-buildx
description: Drone plugin to build multiarch Docker images with buildx
homepage: https://drone-plugin-index.geekdocs.de/plugins/drone-docker-buildx
topics: drone, drone-plugin
private: false
@ -48,8 +49,20 @@ branches:
protection:
required_pull_request_reviews: null
required_status_checks:
strict: true
strict: false
contexts:
- continuous-integration/drone/pr
enforce_admins: null
enforce_admins: true
required_linear_history: true
restrictions: null
- name: docs
protection:
required_pull_request_reviews: null
required_status_checks: null
enforce_admins: true
required_linear_history: true
restrictions:
apps: []
users: []
teams:
- bot

2
.gitignore vendored
View File

@ -1,4 +1,6 @@
/dist/
/release/
/drone-docker-buildx*
coverage.out
CHANGELOG.md

97
.golangci.yml Normal file
View File

@ -0,0 +1,97 @@
linters:
enable-all: false
disable-all: true
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- unused
- asasalint
- asciicheck
- bidichk
- bodyclose
- containedctx
- contextcheck
- decorder
- dogsled
- dupl
- dupword
- durationcheck
- errchkjson
- errname
- errorlint
- execinquery
- exhaustive
- exportloopref
- forcetypeassert
- ginkgolinter
- gocheckcompilerdirectives
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- godox
- goerr113
- gofmt
- gofumpt
- goheader
- goimports
- gomnd
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- grouper
- importas
- interfacebloat
- ireturn
- lll
- loggercheck
- maintidx
- makezero
- misspell
- musttag
- nakedret
- nestif
- nilerr
- nilnil
- nlreturn
- noctx
- nolintlint
- nonamedreturns
- nosprintfhostport
- prealloc
- predeclared
- promlinter
- reassign
- revive
# - rowserrcheck
# - sqlclosecheck
# - structcheck
- stylecheck
- tagliatelle
- tenv
- testableexamples
- thelper
- tparallel
- unconvert
- unparam
- usestdlibvars
# - wastedassign
- whitespace
- wsl
fast: false
run:
timeout: 3m
linters-settings:
gofumpt:
extra-rules: true
lang-version: "1.20"

6
.markdownlint.yml Normal file
View File

@ -0,0 +1,6 @@
---
default: True
MD013: False
MD041: False
MD004:
style: dash

3
.prettierignore Normal file
View File

@ -0,0 +1,3 @@
.drone.yml
*.tpl.md
LICENSE

View File

@ -1,11 +0,0 @@
# Changelog
## v20.10.2 (2021-01-22)
### New Features
- set DOCKER_IMAGE_CREATED as build-arg
### Others
- **deps**: update dependencies

View File

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

3
Corefile Normal file
View File

@ -0,0 +1,3 @@
.:53 {
forward . /etc/resolv.conf
}

View File

@ -1,4 +1,14 @@
FROM arm32v7/docker:20.10-dind
FROM --platform=$BUILDPLATFORM golang:1.20@sha256:741d6f9bcab778441efe05c8e4369d4f8ff56c9a635a97d77f55d8b0ec62f907 as build
ARG TARGETOS
ARG TARGETARCH
ADD . /src
WORKDIR /src
RUN make build
FROM docker:24.0-dind@sha256:020562d22f11c27997e00da910ed6b580d93094bc25841cb87aacab4ced4a882
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
@ -7,20 +17,25 @@ LABEL org.opencontainers.image.url="https://github.com/thegeeklab/drone-docker-b
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/drone-docker-buildx"
LABEL org.opencontainers.image.documentation="https://github.com/thegeeklab/drone-docker-buildx"
ARG TARGETOS
ARG TARGETARCH
ARG BUILDX_VERSION
# renovate: datasource=github-releases depName=docker/buildx
ENV BUILDX_VERSION="${BUILDX_VERSION:-0.5.0}"
ENV BUILDX_VERSION="${BUILDX_VERSION:-v0.11.2}"
ENV DOCKER_HOST=unix:///var/run/docker.sock
RUN apk --update add --virtual .build-deps curl && \
apk --update add --no-cache git coredns && \
mkdir -p /usr/lib/docker/cli-plugins/ && \
curl -SsL -o /usr/lib/docker/cli-plugins/docker-buildx "https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-amd64" && \
curl -SsL -o /usr/lib/docker/cli-plugins/docker-buildx \
"https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION##v}/buildx-v${BUILDX_VERSION##v}.${TARGETOS:-linux}-${TARGETARCH:-amd64}" && \
chmod 755 /usr/lib/docker/cli-plugins/docker-buildx && \
apk del .build-deps && \
rm -rf /var/cache/apk/* && \
rm -rf /tmp/*
ADD release/arm/drone-docker-buildx /bin/
COPY --from=build /src/Corefile /etc/coredns/Corefile
COPY --from=build /src/dist/drone-docker-buildx /bin/drone-docker-buildx
ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "drone-docker-buildx"]

View File

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

101
Makefile Normal file
View File

@ -0,0 +1,101 @@
# renovate: datasource=github-releases depName=mvdan/gofumpt
GOFUMPT_PACKAGE_VERSION := v0.5.0
# renovate: datasource=github-releases depName=golangci/golangci-lint
GOLANGCI_LINT_PACKAGE_VERSION := v1.54.2
EXECUTABLE := drone-docker-buildx
DIST := dist
DIST_DIRS := $(DIST)
IMPORT := github.com/thegeeklab/$(EXECUTABLE)
GO ?= go
CWD ?= $(shell pwd)
PACKAGES ?= $(shell go list ./...)
SOURCES ?= $(shell find . -name "*.go" -type f)
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@$(GOFUMPT_PACKAGE_VERSION)
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_PACKAGE_VERSION)
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
GENERATE ?=
XGO_VERSION := go-1.20.x
XGO_TARGETS ?= linux/amd64,linux/arm64
TARGETOS ?= linux
TARGETARCH ?= amd64
ifneq ("$(TARGETVARIANT)","")
GOARM ?= $(subst v,,$(TARGETVARIANT))
endif
TAGS ?= netgo
ifndef VERSION
ifneq ($(DRONE_TAG),)
VERSION ?= $(subst v,,$(DRONE_TAG))
else
VERSION ?= $(shell git rev-parse --short HEAD)
endif
endif
ifndef DATE
DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%S%z")
endif
LDFLAGS += -s -w -X "main.BuildVersion=$(VERSION)" -X "main.BuildDate=$(DATE)"
.PHONY: all
all: clean build
.PHONY: clean
clean:
$(GO) clean -i ./...
rm -rf $(DIST_DIRS)
.PHONY: fmt
fmt:
$(GO) run $(GOFUMPT_PACKAGE) -extra -w $(SOURCES)
.PHONY: golangci-lint
golangci-lint:
$(GO) run $(GOLANGCI_LINT_PACKAGE) run
.PHONY: lint
lint: golangci-lint
.PHONY: generate
generate:
$(GO) generate $(GENERATE)
.PHONY: test
test:
$(GO) test -v -coverprofile coverage.out $(PACKAGES)
.PHONY: build
build: $(DIST)/$(EXECUTABLE)
$(DIST)/$(EXECUTABLE): $(SOURCES)
GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) GOARM=$(GOARM) $(GO) build -v -tags '$(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -o $@ ./cmd/$(EXECUTABLE)
$(DIST_DIRS):
mkdir -p $(DIST_DIRS)
.PHONY: xgo
xgo: | $(DIST_DIRS)
$(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -v -ldflags '-extldflags "-static" $(LDFLAGS)' -tags '$(TAGS)' -targets '$(XGO_TARGETS)' -out $(EXECUTABLE) --pkg cmd/$(EXECUTABLE) .
cp /build/* $(CWD)/$(DIST)
ls -l $(CWD)/$(DIST)
.PHONY: checksum
checksum:
cd $(DIST); $(foreach file,$(wildcard $(DIST)/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;)
ls -l $(CWD)/$(DIST)
.PHONY: release
release: xgo checksum
.PHONY: deps
deps:
$(GO) mod download
$(GO) install $(GOFUMPT_PACKAGE)
$(GO) install $(GOLANGCI_LINT_PACKAGE)
$(GO) install $(XGO_PACKAGE)

View File

@ -1,6 +1,6 @@
# drone-docker-buildx
Drone plugin to build multiarch Docker images with buildx
DISCONTINUED: Drone plugin to build multiarch Docker images with buildx
[![Build Status](https://img.shields.io/drone/build/thegeeklab/drone-docker-buildx?logo=drone&server=https%3A%2F%2Fdrone.thegeeklab.de)](https://drone.thegeeklab.de/thegeeklab/drone-docker-buildx)
[![Docker Hub](https://img.shields.io/badge/dockerhub-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/drone-docker-buildx)
@ -8,53 +8,30 @@ Drone plugin to build multiarch Docker images with buildx
[![Go Report Card](https://goreportcard.com/badge/github.com/thegeeklab/drone-docker-buildx)](https://goreportcard.com/report/github.com/thegeeklab/drone-docker-buildx)
[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/drone-docker-buildx)](https://github.com/thegeeklab/drone-docker-buildx/graphs/contributors)
[![Source: GitHub](https://img.shields.io/badge/source-github-blue.svg?logo=github&logoColor=white)](https://github.com/thegeeklab/drone-docker-buildx)
[![License: MIT](https://img.shields.io/github/license/thegeeklab/drone-docker-buildx)](https://github.com/thegeeklab/drone-docker-buildx/blob/main/LICENSE)
[![License: Apache-2.0](https://img.shields.io/github/license/thegeeklab/drone-docker-buildx)](https://github.com/thegeeklab/drone-docker-buildx/blob/main/LICENSE)
Drone plugin to build multiarch Docker images with buildx. This plugin is a fork of [drone-plugins/drone-docker](https://github.com/drone-plugins/drone-docker).
> **DISCONTINUED:** As I don't use Drone CI anymore, this project is unmaintained. If you are interested in a free and open source CI system check out [Woodpecker CI](https://woodpecker-ci.org/).
## Docker Tags
Drone plugin to build multiarch Docker images with buildx. This plugin is a fork of [drone-plugins/drone-docker](https://github.com/drone-plugins/drone-docker). You can find the full documentation at [https://drone-plugin-index.geekdocs.de](https://drone-plugin-index.geekdocs.de/plugins/drone-docker-buildx).
Tags are following the main Docker version e.g. `20.10`, the second part is reflecting the plugin "version". A full example would be `20.10.5`.
## Versioning
## Build
The tags follow the major version of Docker, e.g. `20`, and the minor and patch parts reflect the `version` of the plugin. A full example would be `20.12.5`. Minor versions can introduce breaking changes, while patch versions can be considered non-breaking.
Build the binary with the following command:
## Community
```Shell
export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0
export GO111MODULE=on
<!-- prettier-ignore-start -->
<!-- spellchecker-disable -->
go build -v -a -tags netgo -o release/drone-docker-buildx
```
- [BitProcessor/drone-docker-buildx-ecr](https://github.com/BitProcessor/drone-docker-buildx-ecr) by [@BitProcessor](https://github.com/BitProcessor)
Build the Docker image with the following command:
```Shell
docker build --file docker/Dockerfile.amd64 --tag thegeeklab/drone-docker-buildx .
```
## Usage
> Notice: Be aware that the tis plugin requires privileged capabilities, otherwise the integrated Docker daemon is not able to start.
```console
docker run --rm \
-e PLUGIN_TAG=latest \
-e PLUGIN_REPO=octocat/hello-world \
-e DRONE_COMMIT_SHA=00000000 \
-v $(pwd):$(pwd) \
-w $(pwd) \
--privileged \
thegeeklab/drone-docker-buildx --dry-run
```
<!-- spellchecker-enable -->
<!-- prettier-ignore-end -->
## Contributors
Special thanks goes to all [contributors](https://github.com/thegeeklab/drone-docker-buildx/graphs/contributors). If you would like to contribute,
please see the [instructions](https://github.com/thegeeklab/drone-docker-buildx/blob/main/CONTRIBUTING.md).
Special thanks to all [contributors](https://github.com/thegeeklab/drone-docker-buildx/graphs/contributors). If you would like to contribute, please see the [instructions](https://github.com/thegeeklab/drone-docker-buildx/blob/main/CONTRIBUTING.md).
## License
This project is licensed under the MIT License - see the [LICENSE](https://github.com/thegeeklab/drone-docker-buildx/blob/main/LICENSE) file for details.
This project is licensed under the Apache-2.0 License - see the [LICENSE](https://github.com/thegeeklab/drone-docker-buildx/blob/main/LICENSE) file for details.

128
_docs/content/_index.md Normal file
View File

@ -0,0 +1,128 @@
---
title: drone-docker-buildx
---
[![Build Status](https://img.shields.io/drone/build/thegeeklab/drone-docker-buildx?logo=drone&server=https%3A%2F%2Fdrone.thegeeklab.de)](https://drone.thegeeklab.de/thegeeklab/drone-docker-buildx)
[![Docker Hub](https://img.shields.io/badge/dockerhub-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/drone-docker-buildx)
[![Quay.io](https://img.shields.io/badge/quay-latest-blue.svg?logo=docker&logoColor=white)](https://quay.io/repository/thegeeklab/drone-docker-buildx)
[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/drone-docker-buildx)](https://github.com/thegeeklab/drone-docker-buildx/graphs/contributors)
[![Source: GitHub](https://img.shields.io/badge/source-github-blue.svg?logo=github&logoColor=white)](https://github.com/thegeeklab/drone-docker-buildx)
[![License: MIT](https://img.shields.io/github/license/thegeeklab/drone-docker-buildx)](https://github.com/thegeeklab/drone-docker-buildx/blob/main/LICENSE)
Drone plugin to build and publish multiarch Docker images with buildx.
<!-- prettier-ignore-start -->
<!-- spellchecker-disable -->
{{< toc >}}
<!-- spellchecker-enable -->
<!-- prettier-ignore-end -->
## Versioning
The tags follow the major version of Docker, e.g. `20`, and the minor and patch parts reflect the `version` of the plugin. A full example would be `20.12.5`. Minor versions can introduce breaking changes, while patch versions can be considered non-breaking.
## Usage
{{< hint type=important >}}
Be aware that the this plugin requires [privileged](https://docs.drone.io/pipeline/docker/syntax/steps/#privileged-mode) capabilities, otherwise the integrated Docker daemon is not able to start.
{{< /hint >}}
```yaml
kind: pipeline
name: default
steps:
- name: docker
image: thegeeklab/drone-docker-buildx:23
privileged: true
settings:
username: octocat
password: secure
repo: octocat/example
tags: latest
```
### Parameters
<!-- prettier-ignore-start -->
<!-- spellchecker-disable -->
{{< propertylist name=drone-docker-buildx.data sort=name >}}
<!-- spellchecker-enable -->
<!-- prettier-ignore-end -->
### Examples
#### Push to other registries than DockerHub
If the created image is to be pushed to registries other than the default DockerHub, it is necessary to set `registry` and `repo` as fully-qualified name.
**GHCR:**
```yaml
kind: pipeline
name: default
steps:
- name: docker
image: thegeeklab/drone-docker-buildx:23
privileged: true
settings:
registry: ghcr.io
username: octocat
password: secret-access-token
repo: ghcr.io/octocat/example
tags: latest
```
**AWS ECR:**
```yaml
kind: pipeline
name: default
steps:
- name: docker
image: thegeeklab/drone-docker-buildx:23
privileged: true
environment:
AWS_ACCESS_KEY_ID:
from_secret: aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: aws_secret_access_key
settings:
registry: <account_id>.dkr.ecr.<region>.amazonaws.com
repo: <account_id>.dkr.ecr.<region>.amazonaws.com/octocat/example
tags: latest
```
## Build
Build the binary with the following command:
```shell
export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0
export GO111MODULE=on
make build
```
Build the Docker image with the following command:
```shell
docker build --file docker/Dockerfile.amd64 --tag thegeeklab/drone-docker-buildx .
```
## Test
```shell
docker run --rm \
-e PLUGIN_TAG=latest \
-e PLUGIN_REPO=octocat/hello-world \
-e DRONE_COMMIT_SHA=00000000 \
-v $(pwd):$(pwd) \
-w $(pwd) \
--privileged \
thegeeklab/drone-docker-buildx --dry-run
```

295
_docs/data/data.yaml Normal file
View File

@ -0,0 +1,295 @@
---
properties:
- name: dry_run
description: Disable docker push.
type: bool
required: false
- name: mirror
description: Use a registry mirror to pull images.
type: string
required: false
- name: storage_driver
description: The docker daemon storage driver.
type: string
required: false
- name: storage_path
description: The docker daemon storage path.
defaultValue: /var/lib/docker
type: string
required: false
- name: bip
description: Allows the docker daemon to bride IP address.
type: string
required: false
- name: mtu
description: A docker daemon custom MTU.
type: string
required: false
- name: custom_dns
description: Custom docker daemon DNS server.
type: list
required: false
- name: custom_dns_search
description: Custom docker daemon DNS search domain.
type: list
required: false
- name: insecure
description: Enable the usage of insecure registries.
type: bool
defaultValue: false
required: false
- name: ipv6
description: Enable docker daemon IPv6 support.
type: bool
defaultValue: false
required: false
- name: experimental
description: Enable docker daemon experimental mode.
type: bool
defaultValue: false
required: false
- name: debug
description: Enable verbose debug mode for the docker daemon.
type: string
defaultValue: false
required: false
- name: daemon_off
description: Disable the startup of the docker daemon.
type: string
defaultValue: false
required: false
- name: buildkit_config
description: |
Content of the docker buildkit toml [config](https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md). Example:
```yaml
steps:
- name: Build
image: thegeeklab/drone-docker-buildx:23
settings:
repo: example/repo
buildkit_config: |
[registry."registry.local:30081"]
http = true
insecure = true
```
type: string
defaultValue: false
required: false
- name: dockerfile
description: Set dockerfile to use for the image build.
defaultValue: Dockerfile
type: string
required: false
- name: context
description: Set the path of the build context to use.
defaultValue: .
type: string
required: false
- name: named_context
description: Set additional named [build contexts](https://docs.docker.com/engine/reference/commandline/buildx_build/#build-context) (e.g., name=path).
type: list
required: false
- name: tags
description: Set repository tags to use for the image. Tags can also be loaded from a `.tags` file.
defaultValue: latest
type: list
required: false
- name: auto_tag
description: |
Generate tag names automatically based on git branch and git tag. When this feature is enabled and the event type is `tag`,
the plugin will automatically tag the image using the standard semVer convention. For example:
- `1.0.0` produces docker tags `1`, `1.0`, `1.0.0`
- `1.0.0-rc.1` produces docker tags `1.0.0-rc.1`
When the event type is `push` and the target branch is your default branch, the plugin will automatically tag the image
as `latest`. All other event types and branches are ignored.
defaultValue: false
type: bool
required: false
- name: auto_tag_suffix
description: Generate tag names with the given suffix.
type: string
required: false
- name: extra_tags
description: |
Set additional tags to be used for the image. Additional tags can also be loaded from an `.extratags` file. This function can be used
to push images to multiple registries at once. Therefore, it is necessary to use the `config` flag to provide a configuration file
that contains the authentication information for all used registries.
type: list
required: false
- name: build_args
description: Custom build arguments to pass to the build.
type: list
required: false
- name: build_args_from_env
description: Forward environment variables as custom arguments to the build.
type: list
required: false
- name: quiet
description: Enable suppression of the build output.
defaultValue: false
type: bool
required: false
- name: target
description: The docker build target.
type: string
required: false
- name: cache_from
description: |
Images to consider as [cache sources](https://docs.docker.com/engine/reference/commandline/buildx_build/#cache-from). To properly work,
commas used in the cache source entries need to be escaped:
```yaml
steps:
- name: Build
image: thegeeklab/drone-docker-buildx:23
settings:
repo: example/repo
cache_from:
# while using quotes, double-escaping is required
- "type=registry\\\\,ref=example"
- 'type=foo\\,ref=bar'
```
type: list
required: false
- name: cache_to
description: |
[Cache destination](https://docs.docker.com/engine/reference/commandline/buildx_build/#cache-to) for the build cache.
type: string
required: false
- name: pull_image
description: Enforce to pull the base image at build time.
defaultValue: true
type: bool
required: false
- name: compress
description: Enable compression of the build context using gzip.
defaultValue: false
type: bool
required: false
- name: output
description: |
[Export action](https://docs.docker.com/engine/reference/commandline/buildx_build/#output) for the build result
(format: `path` or `type=TYPE[,KEY=VALUE]`).
defaultValue: false
type: bool
required: false
- name: repo
description: |
Repository name for the image. If the image is to be pushed to registries other than the default DockerHub,
it is necessary to set `repo` as fully-qualified name.
type: string
required: false
- name: registry
description: Docker registry to upload images.
defaultValue: https://index.docker.io/v1/
type: string
required: false
- name: username
description: Username for authentication with the registry.
type: string
required: false
- name: password
description: Password for authentication with the registry.
type: string
required: false
- name: email
description: E-Mail address for authentication with the registry.
type: string
required: false
- name: config
description: Content of the docker daemon json config.
type: string
required: false
- name: no_cache
description: Disable the usage of cached intermediate containers.
defaultValue: false
type: string
required: false
- name: add_host
description: Additional `host:ip` mapping.
type: list
required: false
- name: platforms
description: Target platforms for build.
type: list
required: false
- name: labels
description: Labels to add to the image.
type: list
required: false
- name: provenance
description: Generate [provenance](https://docs.docker.com/build/attestations/slsa-provenance/) attestation for the build (shorthand for `--attest=type=provenance`).
type: string
required: false
- name: sbom
description: Generate [sbom](https://docs.docker.com/build/attestations/sbom/) attestation for the build (shorthand for `--attest type=sbom`).
type: string
required: false
- name: secrets
description: |
Exposes [secrets](https://docs.docker.com/engine/reference/commandline/buildx_build/#secret) to the build.
The secrets can be used by the build using `RUN --mount=type=secret` mount.
```yaml
steps:
- name: Build
image: thegeeklab/drone-docker-buildx:23
privileged: true
environment:
SECURE_TOKEN:
from_secret: secure_token
settings:
secrets:
# while using quotes, double-escaping is required
- "id=raw_file_secret\\\\,src=file.txt"
- 'id=other_raw_file_secret\\,src=other_file.txt'
- "id=SECRET_TOKEN"
```
To use secrets from files a [host volume](https://docs.drone.io/pipeline/docker/syntax/volumes/host/) is required.
This should be used with caution and avoided whenever possible.
type: list
required: false

View File

@ -2,241 +2,331 @@ package main
import (
"github.com/thegeeklab/drone-docker-buildx/plugin"
"github.com/thegeeklab/drone-plugin-lib/v2/drone"
"github.com/urfave/cli/v2"
)
// settingsFlags has the cli.Flags for the plugin.Settings.
func settingsFlags(settings *plugin.Settings) []cli.Flag {
//
//nolint:maintidx
func settingsFlags(settings *plugin.Settings, category string) []cli.Flag {
return []cli.Flag{
&cli.BoolFlag{
Name: "dry-run",
Usage: "dry run disables docker push",
EnvVars: []string{"PLUGIN_DRY_RUN"},
Usage: "disable docker push",
Destination: &settings.Dryrun,
},
&cli.StringFlag{
Name: "remote.url",
Usage: "git remote url",
EnvVars: []string{"DRONE_REMOTE_URL"},
Destination: &settings.Build.Remote,
Category: category,
},
&cli.StringFlag{
Name: "daemon.mirror",
Usage: "docker daemon registry mirror",
EnvVars: []string{"PLUGIN_MIRROR", "DOCKER_PLUGIN_MIRROR"},
Usage: "registry mirror to pull images",
Destination: &settings.Daemon.Mirror,
Category: category,
},
&cli.StringFlag{
Name: "daemon.storage-driver",
Usage: "docker daemon storage driver",
EnvVars: []string{"PLUGIN_STORAGE_DRIVER"},
Usage: "docker daemon storage driver",
Destination: &settings.Daemon.StorageDriver,
Category: category,
},
&cli.StringFlag{
Name: "daemon.storage-path",
EnvVars: []string{"PLUGIN_STORAGE_PATH"},
Usage: "docker daemon storage path",
Value: "/var/lib/docker",
EnvVars: []string{"PLUGIN_STORAGE_PATH"},
Destination: &settings.Daemon.StoragePath,
Category: category,
},
&cli.StringFlag{
Name: "daemon.bip",
Usage: "docker daemon bride ip address",
EnvVars: []string{"PLUGIN_BIP"},
Usage: "allow the docker daemon to bride ip address",
Destination: &settings.Daemon.Bip,
Category: category,
},
&cli.StringFlag{
Name: "daemon.mtu",
Usage: "docker daemon custom mtu setting",
EnvVars: []string{"PLUGIN_MTU"},
Usage: "docker daemon custom mtu setting",
Destination: &settings.Daemon.MTU,
Category: category,
},
&cli.StringSliceFlag{
Name: "daemon.dns",
Usage: "docker daemon dns server",
EnvVars: []string{"PLUGIN_CUSTOM_DNS"},
Usage: "custom docker daemon dns server",
Destination: &settings.Daemon.DNS,
Category: category,
},
&cli.StringSliceFlag{
Name: "daemon.dns-search",
Usage: "docker daemon dns search domains",
EnvVars: []string{"PLUGIN_CUSTOM_DNS_SEARCH"},
Usage: "custom docker daemon dns search domain",
Destination: &settings.Daemon.DNSSearch,
Category: category,
},
&cli.BoolFlag{
Name: "daemon.insecure",
Usage: "docker daemon allows insecure registries",
EnvVars: []string{"PLUGIN_INSECURE"},
Usage: "allow the docker daemon to use insecure registries",
Value: false,
Destination: &settings.Daemon.Insecure,
Category: category,
},
&cli.BoolFlag{
Name: "daemon.ipv6",
Usage: "docker daemon IPv6 networking",
EnvVars: []string{"PLUGIN_IPV6"},
Usage: "enable docker daemon IPv6 support",
Value: false,
Destination: &settings.Daemon.IPv6,
Category: category,
},
&cli.BoolFlag{
Name: "daemon.experimental",
Usage: "docker daemon Experimental mode",
EnvVars: []string{"PLUGIN_EXPERIMENTAL"},
Usage: "enable docker daemon experimental mode",
Value: false,
Destination: &settings.Daemon.Experimental,
Category: category,
},
&cli.BoolFlag{
Name: "daemon.debug",
Usage: "docker daemon executes in debug mode",
EnvVars: []string{"PLUGIN_DEBUG", "DOCKER_LAUNCH_DEBUG"},
EnvVars: []string{"PLUGIN_DEBUG"},
Usage: "enable verbose debug mode for the docker daemon",
Value: false,
Destination: &settings.Daemon.Debug,
Category: category,
},
&cli.BoolFlag{
Name: "daemon.off",
Usage: "don't start the docker daemon",
EnvVars: []string{"PLUGIN_DAEMON_OFF"},
Usage: "disable the startup of the docker daemon",
Value: false,
Destination: &settings.Daemon.Disabled,
Category: category,
},
&cli.StringFlag{
Name: "daemon.buildkit-config",
EnvVars: []string{"PLUGIN_BUILDKIT_CONFIG"},
Usage: "content of the docker buildkit toml config",
Destination: &settings.Daemon.BuildkitConfig,
Category: category,
},
&cli.StringFlag{
Name: "dockerfile",
Usage: "build dockerfile",
Value: "Dockerfile",
EnvVars: []string{"PLUGIN_DOCKERFILE"},
Usage: "dockerfile to use for the image build",
Value: "Dockerfile",
Destination: &settings.Build.Dockerfile,
Category: category,
},
&cli.StringFlag{
Name: "context",
Usage: "build context",
Value: ".",
EnvVars: []string{"PLUGIN_CONTEXT"},
Usage: "path of the build context",
Value: ".",
Destination: &settings.Build.Context,
Category: category,
},
&cli.StringSliceFlag{
Name: "named-context",
EnvVars: []string{"PLUGIN_NAMED_CONTEXT"},
Usage: "additional named build context",
Destination: &settings.Build.NamedContext,
Category: category,
},
&cli.StringSliceFlag{
Name: "tags",
Usage: "build tags",
Value: cli.NewStringSlice([]string{"latest"}...),
EnvVars: []string{"PLUGIN_TAG", "PLUGIN_TAGS"},
Usage: "repository tags to use for the image",
FilePath: ".tags",
Destination: &settings.Build.Tags,
Category: category,
},
&cli.BoolFlag{
Name: "tags.auto",
Usage: "default build tags",
EnvVars: []string{"PLUGIN_DEFAULT_TAGS", "PLUGIN_AUTO_TAG"},
Usage: "generate tag names automatically based on git branch and git tag",
Value: false,
Destination: &settings.Build.TagsAuto,
Category: category,
},
&cli.StringFlag{
Name: "tags.suffix",
Usage: "default build tags with suffix",
EnvVars: []string{"PLUGIN_DEFAULT_SUFFIX", "PLUGIN_AUTO_TAG_SUFFIX"},
Usage: "generate tag names with the given suffix",
Destination: &settings.Build.TagsSuffix,
Category: category,
},
&cli.StringSliceFlag{
Name: "extra.tags",
EnvVars: []string{"PLUGIN_EXTRA_TAGS"},
Usage: "additional tags to use for the image including registry",
FilePath: ".extratags",
Destination: &settings.Build.ExtraTags,
Category: category,
},
&cli.StringSliceFlag{
Name: "args",
Usage: "build args",
EnvVars: []string{"PLUGIN_BUILD_ARGS"},
Usage: "custom build arguments for the build",
Destination: &settings.Build.Args,
Category: category,
},
&cli.StringSliceFlag{
Name: "args-from-env",
Usage: "build args",
EnvVars: []string{"PLUGIN_BUILD_ARGS_FROM_ENV"},
Usage: "forward environment variables as custom arguments to the build",
Destination: &settings.Build.ArgsEnv,
Category: category,
},
&cli.BoolFlag{
Name: "quiet",
Usage: "quiet docker build",
EnvVars: []string{"PLUGIN_QUIET"},
Usage: "enable suppression of the build output",
Value: false,
Destination: &settings.Build.Quiet,
Category: category,
},
&cli.StringFlag{
Name: "output",
EnvVars: []string{"PLUGIN_OUTPUT"},
Usage: "export action for the build result",
Destination: &settings.Build.Output,
Category: category,
},
&cli.StringFlag{
Name: "target",
Usage: "build target",
EnvVars: []string{"PLUGIN_TARGET"},
Usage: "build target to use",
Destination: &settings.Build.Target,
Category: category,
},
&cli.StringSliceFlag{
Name: "cache-from",
Usage: "images to consider as cache sources",
EnvVars: []string{"PLUGIN_CACHE_FROM"},
Destination: &settings.Build.CacheFrom,
&cli.GenericFlag{
Name: "cache-from",
EnvVars: []string{"PLUGIN_CACHE_FROM"},
Usage: "images to consider as cache sources",
Value: &drone.StringSliceFlag{},
Category: category,
},
&cli.BoolFlag{
Name: "squash",
Usage: "squash the layers at build time",
EnvVars: []string{"PLUGIN_SQUASH"},
Destination: &settings.Build.Squash,
&cli.StringFlag{
Name: "cache-to",
EnvVars: []string{"PLUGIN_CACHE_TO"},
Usage: "cache destination for the build cache",
Destination: &settings.Build.CacheTo,
Category: category,
},
&cli.BoolFlag{
Name: "pull-image",
Usage: "force pull base image at build time",
EnvVars: []string{"PLUGIN_PULL_IMAGE"},
Usage: "enforce to pull base image at build time",
Value: true,
Destination: &settings.Build.Pull,
Category: category,
},
&cli.BoolFlag{
Name: "compress",
Usage: "compress the build context using gzip",
EnvVars: []string{"PLUGIN_COMPRESS"},
Usage: "enable compression of the build context using gzip",
Value: false,
Destination: &settings.Build.Compress,
Category: category,
},
&cli.StringFlag{
Name: "repo",
Usage: "docker repository",
EnvVars: []string{"PLUGIN_REPO"},
Usage: "repository name for the image",
Destination: &settings.Build.Repo,
Category: category,
},
&cli.StringFlag{
Name: "docker.registry",
Usage: "docker registry",
Value: "https://index.docker.io/v1/",
EnvVars: []string{"PLUGIN_REGISTRY", "DOCKER_REGISTRY"},
Usage: "docker registry to authenticate with",
Value: "https://index.docker.io/v1/",
Destination: &settings.Login.Registry,
Category: category,
},
&cli.StringFlag{
Name: "docker.username",
Usage: "docker username",
EnvVars: []string{"PLUGIN_USERNAME", "DOCKER_USERNAME"},
Usage: "username for registry authentication",
Destination: &settings.Login.Username,
Category: category,
},
&cli.StringFlag{
Name: "docker.password",
Usage: "docker password",
EnvVars: []string{"PLUGIN_PASSWORD", "DOCKER_PASSWORD"},
Usage: "password for registry authentication",
Destination: &settings.Login.Password,
Category: category,
},
&cli.StringFlag{
Name: "docker.email",
Usage: "docker email",
EnvVars: []string{"PLUGIN_EMAIL", "DOCKER_EMAIL"},
Usage: "email address for registry authentication",
Destination: &settings.Login.Email,
Category: category,
},
&cli.StringFlag{
Name: "docker.config",
Usage: "docker json dockerconfig content",
EnvVars: []string{"PLUGIN_CONFIG", "DOCKER_PLUGIN_CONFIG"},
Usage: "content of the docker daemon json config",
Destination: &settings.Login.Config,
},
&cli.BoolFlag{
Name: "docker.purge",
Usage: "docker should cleanup images",
EnvVars: []string{"PLUGIN_PURGE"},
Value: true,
Destination: &settings.Cleanup,
Category: category,
},
&cli.BoolFlag{
Name: "no-cache",
Usage: "do not use cached intermediate containers",
EnvVars: []string{"PLUGIN_NO_CACHE"},
Usage: "disable the usage of cached intermediate containers",
Value: false,
Destination: &settings.Build.NoCache,
Category: category,
},
&cli.StringSliceFlag{
Name: "add-host",
Usage: "additional host:IP mapping",
EnvVars: []string{"PLUGIN_ADD_HOST"},
Usage: "additional host:ip mapping",
Destination: &settings.Build.AddHost,
Category: category,
},
&cli.StringSliceFlag{
Name: "platforms",
Usage: "arget platform for build",
EnvVars: []string{"PLUGIN_PLATFORMS"},
Usage: "target platform for build",
Destination: &settings.Build.Platforms,
Category: category,
},
&cli.StringSliceFlag{
Name: "labels",
EnvVars: []string{"PLUGIN_LABELS"},
Usage: "labels to add to image",
Destination: &settings.Build.Labels,
Category: category,
},
&cli.StringFlag{
Name: "provenance",
EnvVars: []string{"PLUGIN_PROVENANCE"},
Usage: "generates provenance attestation for the build",
Destination: &settings.Build.Provenance,
Category: category,
},
&cli.StringFlag{
Name: "sbom",
EnvVars: []string{"PLUGIN_SBOM"},
Usage: "generates sbom attestation for the build",
Destination: &settings.Build.SBOM,
Category: category,
},
&cli.GenericFlag{
Name: "secrets",
EnvVars: []string{"PLUGIN_SECRETS"},
Usage: "exposes secrets to the build",
Value: &drone.StringSliceFlag{},
Category: category,
},
}
}

View File

@ -1,35 +1,48 @@
package main
import (
"errors"
"fmt"
"os"
"github.com/joho/godotenv"
"github.com/sirupsen/logrus"
"github.com/thegeeklab/drone-docker-buildx/plugin"
"github.com/urfave/cli/v2"
"github.com/drone-plugins/drone-plugin-lib/errors"
"github.com/drone-plugins/drone-plugin-lib/urfave"
"github.com/thegeeklab/drone-plugin-lib/v2/drone"
"github.com/thegeeklab/drone-plugin-lib/v2/urfave"
)
var version = "unknown"
//nolint:gochecknoglobals
var (
BuildVersion = "devel"
BuildDate = "00000000"
)
var ErrTypeAssertionFailed = errors.New("type assertion failed")
func main() {
settings := &plugin.Settings{}
if _, err := os.Stat("/run/drone/env"); err == nil {
godotenv.Overload("/run/drone/env")
_ = godotenv.Overload("/run/drone/env")
}
cli.VersionPrinter = func(c *cli.Context) {
fmt.Printf("%s version=%s date=%s\n", c.App.Name, c.App.Version, BuildDate)
}
app := &cli.App{
Name: "drone-docker-buildx",
Usage: "build docker container with DinD and buildx",
Version: version,
Flags: append(settingsFlags(settings), urfave.Flags()...),
Version: BuildVersion,
Flags: append(settingsFlags(settings, urfave.FlagsPluginCategory), urfave.Flags()...),
Action: run(settings),
}
if err := app.Run(os.Args); err != nil {
errors.HandleExit(err)
logrus.Fatal(err)
}
}
@ -37,6 +50,20 @@ func run(settings *plugin.Settings) cli.ActionFunc {
return func(ctx *cli.Context) error {
urfave.LoggingFromContext(ctx)
cacheFrom, ok := ctx.Generic("cache-from").(*drone.StringSliceFlag)
if !ok {
return fmt.Errorf("%w: failed to read cache-from input", ErrTypeAssertionFailed)
}
settings.Build.CacheFrom = cacheFrom.Get()
secrets, ok := ctx.Generic("secrets").(*drone.StringSliceFlag)
if !ok {
return fmt.Errorf("%w: failed to read secrets input", ErrTypeAssertionFailed)
}
settings.Build.Secrets = secrets.Get()
plugin := plugin.New(
*settings,
urfave.PipelineFromContext(ctx),
@ -44,19 +71,11 @@ func run(settings *plugin.Settings) cli.ActionFunc {
)
if err := plugin.Validate(); err != nil {
if e, ok := err.(errors.ExitCoder); ok {
return e
}
return errors.ExitMessagef("validation failed: %w", err)
return fmt.Errorf("validation failed: %w", err)
}
if err := plugin.Execute(); err != nil {
if e, ok := err.(errors.ExitCoder); ok {
return e
}
return errors.ExitMessagef("execution failed: %w", err)
return fmt.Errorf("execution failed: %w", err)
}
return nil

View File

@ -1,26 +0,0 @@
FROM amd64/docker:20.10-dind@sha256:12521ff42db0d1e1d99f89c7dea6aa6e2d028c20cb42dad8285503735ddf678d
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.title="drone-docker-buildx"
LABEL org.opencontainers.image.url="https://github.com/thegeeklab/drone-docker-buildx"
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/drone-docker-buildx"
LABEL org.opencontainers.image.documentation="https://github.com/thegeeklab/drone-docker-buildx"
ARG BUILDX_VERSION
# renovate: datasource=github-releases depName=docker/buildx
ENV BUILDX_VERSION="${BUILDX_VERSION:-0.5.0}"
ENV DOCKER_HOST=unix:///var/run/docker.sock
RUN apk --update add --virtual .build-deps curl && \
mkdir -p /usr/lib/docker/cli-plugins/ && \
curl -SsL -o /usr/lib/docker/cli-plugins/docker-buildx "https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-amd64" && \
chmod 755 /usr/lib/docker/cli-plugins/docker-buildx && \
apk del .build-deps && \
rm -rf /var/cache/apk/* && \
rm -rf /tmp/*
ADD release/amd64/drone-docker-buildx /bin/
ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "drone-docker-buildx"]

View File

@ -1,26 +0,0 @@
FROM arm64v8/docker:20.10-dind@sha256:009bdea1b7cf4de7f5f7febf8cce1f322b92598927318c78cd2c012d8c0dc866
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
LABEL org.opencontainers.image.title="drone-docker-buildx"
LABEL org.opencontainers.image.url="https://github.com/thegeeklab/drone-docker-buildx"
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/drone-docker-buildx"
LABEL org.opencontainers.image.documentation="https://github.com/thegeeklab/drone-docker-buildx"
ARG BUILDX_VERSION
# renovate: datasource=github-releases depName=docker/buildx
ENV BUILDX_VERSION="${BUILDX_VERSION:-0.5.0}"
ENV DOCKER_HOST=unix:///var/run/docker.sock
RUN apk --update add --virtual .build-deps curl && \
mkdir -p /usr/lib/docker/cli-plugins/ && \
curl -SsL -o /usr/lib/docker/cli-plugins/docker-buildx "https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-amd64" && \
chmod 755 /usr/lib/docker/cli-plugins/docker-buildx && \
apk del .build-deps && \
rm -rf /var/cache/apk/* && \
rm -rf /tmp/*
ADD release/arm64/drone-docker-buildx /bin/
ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "drone-docker-buildx"]

View File

@ -1,24 +0,0 @@
image: quay.io/thegeeklab/drone-docker-buildx:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
{{#if build.tags}}
tags:
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
- image: quay.io/thegeeklab/drone-docker-buildx:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}amd64
platform:
architecture: amd64
os: linux
- image: quay.io/thegeeklab/drone-docker-buildx:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm64
platform:
architecture: arm64
os: linux
variant: v8
- image: quay.io/thegeeklab/drone-docker-buildx:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm
platform:
architecture: arm
os: linux
variant: v7

View File

@ -1,24 +0,0 @@
image: thegeeklab/drone-docker-buildx:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
{{#if build.tags}}
tags:
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
- image: thegeeklab/drone-docker-buildx:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}amd64
platform:
architecture: amd64
os: linux
- image: thegeeklab/drone-docker-buildx:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm64
platform:
architecture: arm64
os: linux
variant: v8
- image: thegeeklab/drone-docker-buildx:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm
platform:
architecture: arm
os: linux
variant: v7

24
go.mod
View File

@ -1,16 +1,18 @@
module github.com/thegeeklab/drone-docker-buildx
go 1.15
go 1.20
require (
github.com/coreos/go-semver v0.3.0
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/drone-plugins/drone-plugin-lib v0.4.0
github.com/joho/godotenv v1.3.0
github.com/kr/pretty v0.1.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sirupsen/logrus v1.7.0
github.com/urfave/cli/v2 v2.3.0
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
github.com/coreos/go-semver v0.3.1
github.com/joho/godotenv v1.5.1
github.com/sirupsen/logrus v1.9.3
github.com/thegeeklab/drone-plugin-lib/v2 v2.3.4
github.com/urfave/cli/v2 v2.25.5
golang.org/x/sys v0.11.0
)
require (
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
)

75
go.sum
View File

@ -1,58 +1,31 @@
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/drone-plugins/drone-plugin-lib v0.4.0 h1:qywEYGhquUuid6zNLmKia8CWY1TUa8jPQQ/G9ozfAmc=
github.com/drone-plugins/drone-plugin-lib v0.4.0/go.mod h1:EgqogX38GoJFtckeSQyhBJYX8P+KWBPhdprAVvyRxF8=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ=
github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M=
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78 h1:nVuTkr9L6Bq62qpUqKo/RnZCFfzDBL0bYo6w9OJUqZY=
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/thegeeklab/drone-plugin-lib/v2 v2.3.4 h1:Quzrike/xRAR0izxQ0d+ocJyIUm4h1497Oyo9grcRzg=
github.com/thegeeklab/drone-plugin-lib/v2 v2.3.4/go.mod h1:qWVUZCmwL0Ntwa/hvyqM03EeIr1ReBR2XJsmIc7MGus=
github.com/urfave/cli/v2 v2.25.5 h1:d0NIAyhh5shGscroL7ek/Ya9QYQE0KNabJgiUinIQkc=
github.com/urfave/cli/v2 v2.25.5/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3 h1:fvjTMHxHEw/mxHbtzPi3JCcKXQRAnQTBRo6YCJSVHKI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

40
plugin/coredns.go Normal file
View File

@ -0,0 +1,40 @@
package plugin
import (
"io"
"net"
"os"
"os/exec"
)
func (p Plugin) startCoredns() {
cmd := exec.Command("coredns", "-conf", "/etc/coredns/Corefile")
if p.settings.Daemon.Debug {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
} else {
cmd.Stdout = io.Discard
cmd.Stderr = io.Discard
}
go func() {
trace(cmd)
_ = cmd.Run()
}()
}
func getContainerIP() (string, error) {
netInterfaceAddrList, err := net.InterfaceAddrs()
if err != nil {
return "", err
}
for _, netInterfaceAddr := range netInterfaceAddrList {
netIP, ok := netInterfaceAddr.(*net.IPNet)
if ok && !netIP.IP.IsLoopback() && netIP.IP.To4() != nil {
return netIP.IP.String(), nil
}
}
return "", nil
}

View File

@ -1,13 +1,16 @@
package plugin
import (
"io/ioutil"
"io"
"os"
)
const dockerExe = "/usr/local/bin/docker"
const dockerdExe = "/usr/local/bin/dockerd"
const dockerHome = "/root/.docker/"
const (
dockerBin = "/usr/local/bin/docker"
dockerdBin = "/usr/local/bin/dockerd"
dockerHome = "/root/.docker/"
buildkitConfig = "/tmp/buildkit.toml"
)
func (p Plugin) startDaemon() {
cmd := commandDaemon(p.settings.Daemon)
@ -15,11 +18,12 @@ func (p Plugin) startDaemon() {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
} else {
cmd.Stdout = ioutil.Discard
cmd.Stderr = ioutil.Discard
cmd.Stdout = io.Discard
cmd.Stderr = io.Discard
}
go func() {
trace(cmd)
cmd.Run()
_ = cmd.Run()
}()
}

View File

@ -3,72 +3,80 @@ package plugin
import (
"fmt"
"os"
"os/exec"
"strings"
"time"
"github.com/urfave/cli/v2"
"golang.org/x/sys/execabs"
)
// helper function to create the docker login command.
func commandLogin(login Login) *exec.Cmd {
func commandLogin(login Login) *execabs.Cmd {
if login.Email != "" {
return commandLoginEmail(login)
}
return exec.Command(
dockerExe, "login",
args := []string{
"login",
"-u", login.Username,
"-p", login.Password,
login.Registry,
}
return execabs.Command(
dockerBin, args...,
)
}
// helper to check if args match "docker pull <image>"
func isCommandPull(args []string) bool {
return len(args) > 2 && args[1] == "pull"
}
func commandPull(repo string) *exec.Cmd {
return exec.Command(dockerExe, "pull", repo)
}
func commandLoginEmail(login Login) *exec.Cmd {
return exec.Command(
dockerExe, "login",
func commandLoginEmail(login Login) *execabs.Cmd {
args := []string{
"login",
"-u", login.Username,
"-p", login.Password,
"-e", login.Email,
login.Registry,
}
return execabs.Command(
dockerBin, args...,
)
}
// helper function to create the docker info command.
func commandVersion() *exec.Cmd {
return exec.Command(dockerExe, "version")
func commandVersion() *execabs.Cmd {
return execabs.Command(dockerBin, "version")
}
// helper function to create the docker info command.
func commandInfo() *exec.Cmd {
return exec.Command(dockerExe, "info")
func commandInfo() *execabs.Cmd {
return execabs.Command(dockerBin, "info")
}
func commandBuilder() *exec.Cmd {
return exec.Command(dockerExe, "buildx", "create", "--use")
func commandBuilder(daemon Daemon) *execabs.Cmd {
args := []string{
"buildx",
"create",
"--use",
}
if daemon.BuildkitConfig != "" {
args = append(args, "--config", buildkitConfig)
}
return execabs.Command(dockerBin, args...)
}
func commandBuildx() *exec.Cmd {
return exec.Command(dockerExe, "buildx", "ls")
func commandBuildx() *execabs.Cmd {
return execabs.Command(dockerBin, "buildx", "ls")
}
// helper function to create the docker build command.
func commandBuild(build Build) *exec.Cmd {
func commandBuild(build Build, dryrun bool) *execabs.Cmd {
args := []string{
"buildx",
"build",
"--load",
"--rm=true",
"-f", build.Dockerfile,
"-t", build.Name,
}
defaultBuildArgs := []string{
@ -76,45 +84,90 @@ func commandBuild(build Build) *exec.Cmd {
}
args = append(args, build.Context)
if build.Squash {
args = append(args, "--squash")
if !dryrun && build.Output == "" && len(build.Tags.Value()) > 0 {
args = append(args, "--push")
}
if build.Compress {
args = append(args, "--compress")
}
if build.Pull {
args = append(args, "--pull=true")
}
if build.NoCache {
args = append(args, "--no-cache")
}
for _, arg := range build.CacheFrom.Value() {
for _, arg := range build.CacheFrom {
args = append(args, "--cache-from", arg)
}
if build.CacheTo != "" {
args = append(args, "--cache-to", build.CacheTo)
}
for _, arg := range build.ArgsEnv.Value() {
addProxyValue(&build, arg)
}
for _, arg := range append(defaultBuildArgs, build.Args.Value()...) {
args = append(args, "--build-arg", arg)
}
for _, host := range build.AddHost.Value() {
args = append(args, "--add-host", host)
}
if build.Target != "" {
args = append(args, "--target", build.Target)
}
if build.Quiet {
args = append(args, "--quiet")
}
if len(build.Platforms.Value()) > 0 {
args = append(args, "--platform", strings.Join(build.Platforms.Value()[:], ","))
if build.Output != "" {
args = append(args, "--output", build.Output)
}
return exec.Command(dockerExe, args...)
for _, arg := range build.NamedContext.Value() {
args = append(args, "--build-context", arg)
}
if len(build.Platforms.Value()) > 0 {
args = append(args, "--platform", strings.Join(build.Platforms.Value(), ","))
}
for _, arg := range build.Tags.Value() {
args = append(args, "-t", fmt.Sprintf("%s:%s", build.Repo, arg))
}
for _, arg := range build.ExtraTags.Value() {
args = append(args, "-t", arg)
}
for _, arg := range build.Labels.Value() {
args = append(args, "--label", arg)
}
if build.Provenance != "" {
args = append(args, "--provenance", build.Provenance)
}
if build.SBOM != "" {
args = append(args, "--sbom", build.SBOM)
}
for _, secret := range build.Secrets {
args = append(args, "--secret", secret)
}
return execabs.Command(dockerBin, args...)
}
// helper function to add proxy values from the environment
// helper function to add proxy values from the environment.
func addProxyBuildArgs(build *Build) {
addProxyValue(build, "http_proxy")
addProxyValue(build, "https_proxy")
@ -157,25 +210,8 @@ func hasProxyBuildArg(build *Build, key string) bool {
return false
}
// helper function to create the docker tag command.
func commandTag(build Build, tag string) *exec.Cmd {
var (
source = build.Name
target = fmt.Sprintf("%s:%s", build.Repo, tag)
)
return exec.Command(
dockerExe, "tag", source, target,
)
}
// helper function to create the docker push command.
func commandPush(build Build, tag string) *exec.Cmd {
target := fmt.Sprintf("%s:%s", build.Repo, tag)
return exec.Command(dockerExe, "push", target)
}
// helper function to create the docker daemon command.
func commandDaemon(daemon Daemon) *exec.Cmd {
func commandDaemon(daemon Daemon) *execabs.Cmd {
args := []string{
"--data-root", daemon.StoragePath,
"--host=unix:///var/run/docker.sock",
@ -184,53 +220,44 @@ func commandDaemon(daemon Daemon) *exec.Cmd {
if daemon.StorageDriver != "" {
args = append(args, "-s", daemon.StorageDriver)
}
if daemon.Insecure && daemon.Registry != "" {
args = append(args, "--insecure-registry", daemon.Registry)
}
if daemon.IPv6 {
args = append(args, "--ipv6")
}
if len(daemon.Mirror) != 0 {
args = append(args, "--registry-mirror", daemon.Mirror)
}
if len(daemon.Bip) != 0 {
args = append(args, "--bip", daemon.Bip)
}
for _, dns := range daemon.DNS.Value() {
args = append(args, "--dns", dns)
}
for _, dnsSearch := range daemon.DNSSearch.Value() {
args = append(args, "--dns-search", dnsSearch)
}
if len(daemon.MTU) != 0 {
args = append(args, "--mtu", daemon.MTU)
}
if daemon.Experimental {
args = append(args, "--experimental")
}
return exec.Command(dockerdExe, args...)
}
// helper to check if args match "docker prune"
func isCommandPrune(args []string) bool {
return len(args) > 3 && args[2] == "prune"
}
func commandPrune() *exec.Cmd {
return exec.Command(dockerExe, "system", "prune", "-f")
}
// helper to check if args match "docker rmi"
func isCommandRmi(args []string) bool {
return len(args) > 2 && args[1] == "rmi"
}
func commandRmi(tag string) *exec.Cmd {
return exec.Command(dockerExe, "rmi", tag)
return execabs.Command(dockerdBin, args...)
}
// trace writes each command to stdout with the command wrapped in an xml
// tag so that it can be extracted and displayed in the logs.
func trace(cmd *exec.Cmd) {
func trace(cmd *execabs.Cmd) {
fmt.Fprintf(os.Stdout, "+ %s\n", strings.Join(cmd.Args, " "))
}

View File

@ -1 +0,0 @@
package plugin

View File

@ -2,31 +2,31 @@ package plugin
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"time"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
"golang.org/x/sys/execabs"
)
// Daemon defines Docker daemon parameters.
type Daemon struct {
Registry string // Docker registry
Mirror string // Docker registry mirror
Insecure bool // Docker daemon enable insecure registries
StorageDriver string // Docker daemon storage driver
StoragePath string // Docker daemon storage path
Disabled bool // DOcker daemon is disabled (already running)
Debug bool // Docker daemon started in debug mode
Bip string // Docker daemon network bridge IP address
DNS cli.StringSlice // Docker daemon dns server
DNSSearch cli.StringSlice // Docker daemon dns search domain
MTU string // Docker daemon mtu setting
IPv6 bool // Docker daemon IPv6 networking
Experimental bool // Docker daemon enable experimental mode
Registry string // Docker registry
Mirror string // Docker registry mirror
Insecure bool // Docker daemon enable insecure registries
StorageDriver string // Docker daemon storage driver
StoragePath string // Docker daemon storage path
Disabled bool // DOcker daemon is disabled (already running)
Debug bool // Docker daemon started in debug mode
Bip string // Docker daemon network bridge IP address
DNS cli.StringSlice // Docker daemon dns server
DNSSearch cli.StringSlice // Docker daemon dns search domain
MTU string // Docker daemon mtu setting
IPv6 bool // Docker daemon IPv6 networking
Experimental bool // Docker daemon enable experimental mode
BuildkitConfig string // Docker buildkit config
}
// Login defines Docker login parameters.
@ -40,45 +40,46 @@ type Login struct {
// Build defines Docker build parameters.
type Build struct {
Remote string // Git remote URL
Name string // Git commit sha used as docker default named tag
Ref string // Git commit ref
Branch string // Git repository branch
Dockerfile string // Docker build Dockerfile
Context string // Docker build context
TagsAuto bool // Docker build auto tag
TagsSuffix string // Docker build tags with suffix
Tags cli.StringSlice // Docker build tags
Platforms cli.StringSlice // Docker build target platforms
Args cli.StringSlice // Docker build args
ArgsEnv cli.StringSlice // Docker build args from env
Target string // Docker build target
Squash bool // Docker build squash
Pull bool // Docker build pull
CacheFrom cli.StringSlice // Docker build cache-from
Compress bool // Docker build compress
Repo string // Docker build repository
NoCache bool // Docker build no-cache
AddHost cli.StringSlice // Docker build add-host
Quiet bool // Docker build quiet
Ref string // Git commit ref
Branch string // Git repository branch
Dockerfile string // Docker build Dockerfile
Context string // Docker build context
TagsAuto bool // Docker build auto tag
TagsSuffix string // Docker build tags with suffix
Tags cli.StringSlice // Docker build tags
ExtraTags cli.StringSlice // Docker build tags including registry
Platforms cli.StringSlice // Docker build target platforms
Args cli.StringSlice // Docker build args
ArgsEnv cli.StringSlice // Docker build args from env
Target string // Docker build target
Pull bool // Docker build pull
CacheFrom []string // Docker build cache-from
CacheTo string // Docker build cache-to
Compress bool // Docker build compress
Repo string // Docker build repository
NoCache bool // Docker build no-cache
AddHost cli.StringSlice // Docker build add-host
Quiet bool // Docker build quiet
Output string // Docker build output folder
NamedContext cli.StringSlice // Docker build named context
Labels cli.StringSlice // Docker build labels
Provenance string // Docker build provenance attestation
SBOM string // Docker build sbom attestation
Secrets []string // Docker build secrets
}
// Settings for the Plugin.
type Settings struct {
Daemon Daemon
Login Login
Build Build
Dryrun bool
Cleanup bool
Daemon Daemon
Login Login
Build Build
Dryrun bool
}
const strictFilePerm = 0o600
// Validate handles the settings validation of the plugin.
func (p *Plugin) Validate() error {
p.settings.Build.Name = "00000000"
if p.pipeline.Commit.SHA != "" {
p.settings.Build.Name = p.pipeline.Commit.SHA
}
p.settings.Build.Branch = p.pipeline.Repo.Branch
p.settings.Build.Ref = p.pipeline.Commit.Ref
p.settings.Daemon.Registry = p.settings.Login.Registry
@ -94,12 +95,15 @@ func (p *Plugin) Validate() error {
p.settings.Build.TagsSuffix,
)
if err != nil {
logrus.Printf("cannot build docker image for %s, invalid semantic version", p.settings.Build.Ref)
logrus.Infof("cannot generate tags from %s, invalid semantic version", p.settings.Build.Ref)
return err
}
p.settings.Build.Tags = *cli.NewStringSlice(tag...)
} else {
logrus.Printf("skipping automated docker build for %s", p.settings.Build.Ref)
logrus.Infof("skip auto-tagging for %s, not on default branch or tag", p.settings.Build.Ref)
return nil
}
}
@ -108,9 +112,29 @@ func (p *Plugin) Validate() error {
}
// Execute provides the implementation of the plugin.
//
//nolint:gocognit
func (p *Plugin) Execute() error {
// start the Docker daemon server
//nolint: nestif
if !p.settings.Daemon.Disabled {
// If no custom DNS value set start internal DNS server
if len(p.settings.Daemon.DNS.Value()) == 0 {
ip, err := getContainerIP()
if err != nil {
logrus.Warnf("error detecting IP address: %v", err)
}
if ip != "" {
logrus.Debugf("discovered IP address: %v", ip)
p.startCoredns()
if err := p.settings.Daemon.DNS.Set(ip); err != nil {
return fmt.Errorf("error setting daemon dns: %w", err)
}
}
}
p.startDaemon()
}
@ -118,75 +142,65 @@ func (p *Plugin) Execute() error {
// ready to accept connections before we proceed.
for i := 0; i < 15; i++ {
cmd := commandInfo()
err := cmd.Run()
if err == nil {
break
}
time.Sleep(time.Second * 1)
}
// Create Auth Config File
if p.settings.Login.Config != "" {
os.MkdirAll(dockerHome, 0600)
if err := os.MkdirAll(dockerHome, strictFilePerm); err != nil {
return fmt.Errorf("failed to create docker home: %w", err)
}
path := filepath.Join(dockerHome, "config.json")
err := ioutil.WriteFile(path, []byte(p.settings.Login.Config), 0600)
err := os.WriteFile(path, []byte(p.settings.Login.Config), strictFilePerm)
if err != nil {
return fmt.Errorf("error writing config.json: %s", err)
return fmt.Errorf("error writing config.json: %w", err)
}
}
// login to the Docker registry
if p.settings.Login.Password != "" {
cmd := commandLogin(p.settings.Login)
err := cmd.Run()
if err != nil {
return fmt.Errorf("error authenticating: %s", err)
return fmt.Errorf("error authenticating: %w", err)
}
}
if p.settings.Daemon.BuildkitConfig != "" {
err := os.WriteFile(buildkitConfig, []byte(p.settings.Daemon.BuildkitConfig), strictFilePerm)
if err != nil {
return fmt.Errorf("error writing buildkit.toml: %w", err)
}
}
switch {
case p.settings.Login.Password != "":
fmt.Println("Detected registry credentials")
logrus.Info("Detected registry credentials")
case p.settings.Login.Config != "":
fmt.Println("Detected registry credentials file")
logrus.Info("Detected registry credentials file")
default:
fmt.Println("Registry credentials or Docker config not provided. Guest mode enabled.")
}
if p.settings.Build.Squash && !p.settings.Daemon.Experimental {
fmt.Println("Squash build flag is only available when Docker deamon is started with experimental flag. Ignoring...")
p.settings.Build.Squash = false
logrus.Info("Registry credentials or Docker config not provided. Guest mode enabled.")
}
// add proxy build args
addProxyBuildArgs(&p.settings.Build)
var cmds []*exec.Cmd
var cmds []*execabs.Cmd
cmds = append(cmds, commandVersion()) // docker version
cmds = append(cmds, commandInfo()) // docker info
cmds = append(cmds, commandBuilder())
cmds = append(cmds, commandBuilder(p.settings.Daemon))
cmds = append(cmds, commandBuildx())
// pre-pull cache images
for _, img := range p.settings.Build.CacheFrom.Value() {
cmds = append(cmds, commandPull(img))
}
cmds = append(cmds, commandBuild(p.settings.Build)) // docker build
for _, tag := range p.settings.Build.Tags.Value() {
cmds = append(cmds, commandTag(p.settings.Build, tag)) // docker tag
if !p.settings.Dryrun {
cmds = append(cmds, commandPush(p.settings.Build, tag)) // docker push
}
}
if p.settings.Cleanup {
cmds = append(cmds, commandRmi(p.settings.Build.Name)) // docker rmi
cmds = append(cmds, commandPrune()) // docker system prune -f
}
cmds = append(cmds, commandBuild(p.settings.Build, p.settings.Dryrun)) // docker build
// execute all commands in batch mode.
for _, cmd := range cmds {
@ -195,13 +209,7 @@ func (p *Plugin) Execute() error {
trace(cmd)
err := cmd.Run()
if err != nil && isCommandPull(cmd.Args) {
fmt.Printf("Could not pull cache-from image %s. Ignoring...\n", cmd.Args[2])
} else if err != nil && isCommandPrune(cmd.Args) {
fmt.Printf("Could not prune system containers. Ignoring...\n")
} else if err != nil && isCommandRmi(cmd.Args) {
fmt.Printf("Could not remove image %s. Ignoring...\n", cmd.Args[2])
} else if err != nil {
if err != nil {
return err
}
}

View File

@ -1,7 +1,7 @@
package plugin
import (
"github.com/drone-plugins/drone-plugin-lib/drone"
"github.com/thegeeklab/drone-plugin-lib/v2/drone"
)
// Plugin implements drone.Plugin to provide the plugin implementation.
@ -12,7 +12,7 @@ type Plugin struct {
}
// New initializes a plugin from the given Settings, Pipeline, and Network.
func New(settings Settings, pipeline drone.Pipeline, network drone.Network) drone.Plugin {
func New(settings Settings, pipeline drone.Pipeline, network drone.Network) *Plugin {
return &Plugin{
settings: settings,
pipeline: pipeline,

View File

@ -14,9 +14,11 @@ func DefaultTagSuffix(ref, suffix string) ([]string, error) {
if err != nil {
return nil, err
}
if len(suffix) == 0 {
return tags, nil
}
for i, tag := range tags {
if tag == "latest" {
tags[i] = suffix
@ -24,13 +26,15 @@ func DefaultTagSuffix(ref, suffix string) ([]string, error) {
tags[i] = fmt.Sprintf("%s-%s", tag, suffix)
}
}
return tags, nil
}
func splitOff(input string, delim string) string {
parts := strings.SplitN(input, delim, 2)
func splitOff(input, delim string) string {
const splits = 2
parts := strings.SplitN(input, delim, splits)
if len(parts) == 2 {
if len(parts) == splits {
return parts[0]
}
@ -43,42 +47,65 @@ func DefaultTags(ref string) ([]string, error) {
if !strings.HasPrefix(ref, "refs/tags/") {
return []string{"latest"}, nil
}
v := stripTagPrefix(ref)
version, err := semver.NewVersion(v)
rawVersion := stripTagPrefix(ref)
version, err := semver.NewVersion(rawVersion)
if err != nil {
return []string{"latest"}, err
}
if version.PreRelease != "" || version.Metadata != "" {
return []string{
version.String(),
}, nil
}
v = stripTagPrefix(ref)
v = splitOff(splitOff(v, "+"), "-")
dotParts := strings.SplitN(v, ".", 3)
rawVersion = stripTagPrefix(ref)
rawVersion = splitOff(splitOff(rawVersion, "+"), "-")
//nolint:gomnd
dotParts := strings.SplitN(rawVersion, ".", 3)
if version.Major == 0 {
return []string{
fmt.Sprintf("%0*d.%0*d", len(dotParts[0]), version.Major, len(dotParts[1]), version.Minor),
fmt.Sprintf("%0*d.%0*d.%0*d", len(dotParts[0]), version.Major, len(dotParts[1]), version.Minor, len(dotParts[2]), version.Patch),
fmt.Sprintf(
"%0*d.%0*d.%0*d",
len(dotParts[0]),
version.Major,
len(dotParts[1]),
version.Minor,
len(dotParts[2]),
version.Patch,
),
}, nil
}
return []string{
fmt.Sprintf("%0*d", len(dotParts[0]), version.Major),
fmt.Sprintf("%0*d.%0*d", len(dotParts[0]), version.Major, len(dotParts[1]), version.Minor),
fmt.Sprintf("%0*d.%0*d.%0*d", len(dotParts[0]), version.Major, len(dotParts[1]), version.Minor, len(dotParts[2]), version.Patch),
fmt.Sprintf(
"%0*d.%0*d.%0*d",
len(dotParts[0]),
version.Major,
len(dotParts[1]),
version.Minor,
len(dotParts[2]),
version.Patch,
),
}, nil
}
// UseDefaultTag for keep only default branch for latest tag
// UseDefaultTag to keep only default branch for latest tag.
func UseDefaultTag(ref, defaultBranch string) bool {
if strings.HasPrefix(ref, "refs/tags/") {
return true
}
if stripHeadPrefix(ref) == defaultBranch {
return true
}
return false
}
@ -89,5 +116,6 @@ func stripHeadPrefix(ref string) string {
func stripTagPrefix(ref string) string {
ref = strings.TrimPrefix(ref, "refs/tags/")
ref = strings.TrimPrefix(ref, "v")
return ref
}

View File

@ -6,7 +6,7 @@ import (
)
func Test_stripTagPrefix(t *testing.T) {
var tests = []struct {
tests := []struct {
Before string
After string
}{
@ -24,12 +24,12 @@ func Test_stripTagPrefix(t *testing.T) {
}
func TestDefaultTags(t *testing.T) {
var tests = []struct {
tests := []struct {
Before string
After []string
}{
{"", []string{"latest"}},
{"refs/heads/master", []string{"latest"}},
{"refs/heads/main", []string{"latest"}},
{"refs/tags/0.9.0", []string{"0.9", "0.9.0"}},
{"refs/tags/1.0.0", []string{"1", "1.0", "1.0.0"}},
{"refs/tags/v1.0.0", []string{"1", "1.0", "1.0.0"}},
@ -40,8 +40,10 @@ func TestDefaultTags(t *testing.T) {
tags, err := DefaultTags(test.Before)
if err != nil {
t.Error(err)
continue
}
got, want := tags, test.After
if !reflect.DeepEqual(got, want) {
t.Errorf("Got tag %v, want %v", got, want)
@ -50,7 +52,7 @@ func TestDefaultTags(t *testing.T) {
}
func TestDefaultTagsError(t *testing.T) {
var tests = []string{
tests := []string{
"refs/tags/x1.0.0",
"refs/tags/20190203",
}
@ -64,7 +66,7 @@ func TestDefaultTagsError(t *testing.T) {
}
func TestDefaultTagSuffix(t *testing.T) {
var tests = []struct {
tests := []struct {
Before string
Suffix string
After []string
@ -123,8 +125,10 @@ func TestDefaultTagSuffix(t *testing.T) {
tag, err := DefaultTagSuffix(test.Before, test.Suffix)
if err != nil {
t.Error(err)
continue
}
got, want := tag, test.After
if !reflect.DeepEqual(got, want) {
t.Errorf("Got tag %v, want %v", got, want)
@ -136,17 +140,19 @@ func Test_stripHeadPrefix(t *testing.T) {
type args struct {
ref string
}
tests := []struct {
args args
want string
}{
{
args: args{
ref: "refs/heads/master",
ref: "refs/heads/main",
},
want: "master",
want: "main",
},
}
for _, tt := range tests {
if got := stripHeadPrefix(tt.args.ref); got != tt.want {
t.Errorf("stripHeadPrefix() = %v, want %v", got, tt.want)
@ -159,6 +165,7 @@ func TestUseDefaultTag(t *testing.T) {
ref string
defaultBranch string
}
tests := []struct {
name string
args args
@ -167,8 +174,8 @@ func TestUseDefaultTag(t *testing.T) {
{
name: "latest tag for default branch",
args: args{
ref: "refs/heads/master",
defaultBranch: "master",
ref: "refs/heads/main",
defaultBranch: "main",
},
want: true,
},
@ -176,7 +183,7 @@ func TestUseDefaultTag(t *testing.T) {
name: "build from tags",
args: args{
ref: "refs/tags/v1.0.0",
defaultBranch: "master",
defaultBranch: "main",
},
want: true,
},
@ -184,11 +191,12 @@ func TestUseDefaultTag(t *testing.T) {
name: "skip build for not default branch",
args: args{
ref: "refs/heads/develop",
defaultBranch: "master",
defaultBranch: "main",
},
want: false,
},
}
for _, tt := range tests {
if got := UseDefaultTag(tt.args.ref, tt.args.defaultBranch); got != tt.want {
t.Errorf("%q. UseDefaultTag() = %v, want %v", tt.name, got, tt.want)

View File

@ -1,4 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>thegeeklab/renovate-presets"]
}