mirror of
https://github.com/thegeeklab/docker-tidy.git
synced 2024-11-04 20:10:40 +00:00
Compare commits
655 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
9637b3aa3f | ||
|
6756e50a2b | ||
|
791261dfe0 | ||
|
d4cda4c96e | ||
|
2aa662e4ab | ||
d9fac61721 | |||
|
50b29582a2 | ||
7145f46411 | |||
|
ada8379c7f | ||
|
2b65019281 | ||
|
4107d54e5a | ||
|
ce98ff48ad | ||
|
425451edba | ||
|
588458f921 | ||
|
6c74656363 | ||
|
a70f67cda3 | ||
|
a92e91904d | ||
|
6ce60bd579 | ||
|
805b2b289a | ||
|
eb783d2f7a | ||
|
d762158829 | ||
|
698ebb904f | ||
|
147582209b | ||
|
9bb6841da7 | ||
|
8fba3dca3b | ||
|
26239b409f | ||
|
3a02efb4b1 | ||
|
c0baa946c9 | ||
|
e0d43b20cd | ||
|
a45bba0347 | ||
|
b15c4f2133 | ||
|
15e6278156 | ||
|
98490d06d0 | ||
|
190bb2fa1f | ||
|
e8f9731a30 | ||
|
79606bf19e | ||
|
56eac8af21 | ||
|
4b561a38c9 | ||
|
4acc8d7dd6 | ||
|
f2322312c9 | ||
8b1da64f4f | |||
|
28cbf3b60a | ||
|
7751a4ad74 | ||
|
ce949a87be | ||
|
9f0f1c10a9 | ||
|
e71bda050b | ||
|
23b42be628 | ||
|
d754500b0e | ||
|
491bd1875f | ||
|
d27fc50d2d | ||
|
9b04502097 | ||
|
19db149f1b | ||
|
014627b564 | ||
|
1e5d6b8df9 | ||
|
e9185cdaa6 | ||
|
a7770ea08d | ||
|
f67f112433 | ||
|
4cfd618987 | ||
|
157dabfeff | ||
|
fcfb9e3410 | ||
|
5cf6abb8dd | ||
|
515b0e3163 | ||
|
43f76d51ae | ||
|
7c6b4c7c40 | ||
|
651af74296 | ||
|
1d70cd3017 | ||
|
0130a3a7b0 | ||
|
ca54d039d3 | ||
|
c0cc3c1434 | ||
|
255330f547 | ||
|
67d17dbac4 | ||
|
a809e20900 | ||
|
16acc8f500 | ||
|
27f88e07f6 | ||
|
fbf727c593 | ||
|
53d324c747 | ||
|
acb91fe39b | ||
|
433b8ce2aa | ||
|
724e14c741 | ||
|
c5d50cf47a | ||
|
ae9a16c898 | ||
|
635cd51a17 | ||
|
77ca9f62d2 | ||
|
40e2f72fb0 | ||
|
5a4a9dc879 | ||
|
0a8780c381 | ||
|
c0b496943f | ||
|
393887fbb5 | ||
|
6555f4add6 | ||
|
eee7a5a1ff | ||
|
9f31bfdf9e | ||
|
9596da32c9 | ||
|
d15499b120 | ||
|
da587cdaf1 | ||
|
2e78717804 | ||
|
7e2c68c8fe | ||
|
5a98f7127d | ||
|
9701519a85 | ||
|
01293f3634 | ||
|
cbddcedb62 | ||
|
4be97eb542 | ||
|
3e644aa33d | ||
|
a86f86e3a1 | ||
|
95e7ee4471 | ||
|
73d739831a | ||
|
44599113ab | ||
|
1b33fc3b74 | ||
|
83a32d14c6 | ||
63ca6e6bdb | |||
|
1e557bd253 | ||
|
32da9eb537 | ||
|
1d19939b68 | ||
|
233b29a8cd | ||
|
90876dc452 | ||
|
9d2503fb30 | ||
|
ec6ff19057 | ||
|
fc31bd26c2 | ||
|
8d9c9a5f5f | ||
|
6a80f83587 | ||
e261307149 | |||
|
f69a97b61c | ||
84a3d303ed | |||
|
24a8388cb1 | ||
|
3a47080078 | ||
7dbd1158c6 | |||
|
536752a83e | ||
|
f334c0da1e | ||
|
fc02a0071a | ||
|
9ce45bf75b | ||
|
9a5c025d7c | ||
|
95e5f2ac4a | ||
|
48e90b3fa8 | ||
|
72f6b0e758 | ||
|
b684cb042f | ||
|
e280fd4395 | ||
|
824b850e57 | ||
|
5fb5fbb2e5 | ||
|
fc20bb4de0 | ||
|
df1c82beac | ||
|
c81a2b7dca | ||
|
5e7b78b181 | ||
|
f957a5c41d | ||
|
194a793cb2 | ||
|
85a945b4ed | ||
|
bf8e7c5256 | ||
|
7a7df50721 | ||
|
535969d581 | ||
3eebffb06a | |||
525483e99c | |||
|
ea0468cc8d | ||
5063ba7d6b | |||
|
3ea1adfe03 | ||
|
ea56dc4f41 | ||
|
e0f99929c1 | ||
|
0a2257fb13 | ||
b1e15928ad | |||
|
f386910970 | ||
|
91fbaf9d9d | ||
|
a4643c714a | ||
|
d7b1253555 | ||
1c7b43fff0 | |||
|
d325e16548 | ||
|
7a7118aa75 | ||
|
042feaa792 | ||
|
39bca2ebf9 | ||
|
03437632ff | ||
|
9b6e622a84 | ||
|
7ac907ea02 | ||
|
4f6d92bbcc | ||
347e074e5b | |||
12f2428e9f | |||
|
2a3e1612f8 | ||
|
8a28ecefc6 | ||
71365ef471 | |||
|
ce3d0acfcd | ||
|
c51f8d1578 | ||
|
d27a1a974f | ||
|
5ac3434045 | ||
|
c976506e5a | ||
|
e1fab9e27e | ||
|
fed37cc7d0 | ||
|
b82fdfbeed | ||
|
06f21389bb | ||
|
54954fab7b | ||
|
56e140e146 | ||
|
f314885f99 | ||
|
985adf4614 | ||
|
ee06eff3f2 | ||
12cc05e53e | |||
b581e501da | |||
e91f10ae14 | |||
|
dd299ecf5c | ||
ea4bf4a218 | |||
4988cac525 | |||
|
7b82bbf871 | ||
|
3c6dcda7a6 | ||
|
a75380dcab | ||
|
3ea31f660b | ||
|
9bc9ef4d45 | ||
|
0ef523ceb7 | ||
|
2bebea17fd | ||
|
43c1180bee | ||
|
39c8ce5c2e | ||
|
fcee5e7f6f | ||
|
7ffd2d6ca7 | ||
|
a97d20c6ff | ||
8f4b694d7e | |||
|
15bface557 | ||
88cf97ee86 | |||
|
a4e893b5dd | ||
|
fe27327da5 | ||
|
544c0bf25b | ||
|
ff118d656a | ||
|
cca9765fa2 | ||
|
aa1b914f6b | ||
|
a265caa3ca | ||
|
5f2594710f | ||
|
16e6aec457 | ||
7c1bab90c9 | |||
4f6b8880c4 | |||
|
f0b927edd2 | ||
|
bb651f9e10 | ||
9b2094d0f2 | |||
|
034100a706 | ||
|
b6c0253a04 | ||
|
cae751f84a | ||
|
e7622ecf28 | ||
|
69c1ddecb6 | ||
|
81de219b8a | ||
|
304c54cdaa | ||
|
3562868a44 | ||
|
0b9ce24909 | ||
|
6397347f6e | ||
|
53db01a050 | ||
|
4a3ffc823b | ||
|
88ddece439 | ||
|
b4fcf55bad | ||
|
eb600badab | ||
00d3334ec8 | |||
|
f8c0ffc313 | ||
|
5a14273f81 | ||
|
08c0bce852 | ||
|
f8cc44c8c8 | ||
|
8dd1af4c8c | ||
5ac47c0af6 | |||
|
330045634e | ||
|
9a36af321b | ||
|
e77b94a096 | ||
|
8e12d9d38d | ||
|
62b2865424 | ||
|
ce31cb7109 | ||
b99be1f3a5 | |||
9d81d2fd66 | |||
|
2258638555 | ||
|
59dbc8daef | ||
|
aa20b9aa32 | ||
|
c1a372ebd0 | ||
|
2ecdb5ce2c | ||
|
983911a58b | ||
|
b88a8fe280 | ||
|
758888ef93 | ||
|
28baf4f9bc | ||
|
f27e44e979 | ||
|
69761af054 | ||
|
352bd11129 | ||
|
b048c76870 | ||
|
fb8d7d835d | ||
|
6f2ed5ca86 | ||
|
92eb995799 | ||
|
c3c2cec106 | ||
|
82036df6ab | ||
|
5c457a3715 | ||
|
68cfc83503 | ||
|
3630fdc4e2 | ||
7b2270d4f1 | |||
|
f198a21b70 | ||
|
a3b539953f | ||
|
4de34d58f5 | ||
|
839765c19d | ||
|
cafb48dd8c | ||
|
c09cbcecd5 | ||
|
afcd209277 | ||
|
3ff50a673f | ||
|
7865d4bfe3 | ||
|
32eb2fcaed | ||
7695d32d61 | |||
|
3b4e4f042a | ||
|
ffa9f1de98 | ||
|
222fdb9a24 | ||
|
b26ea42ad0 | ||
|
beb4a34349 | ||
5b55a2585c | |||
|
9232d91088 | ||
|
ae7d326db0 | ||
|
ffc99756d9 | ||
|
f453268586 | ||
|
e186b101f9 | ||
|
61ff009407 | ||
|
1d71983c0a | ||
|
f4a3917675 | ||
|
1d3d472507 | ||
|
99437083fc | ||
|
f6039d90b8 | ||
|
711acd985c | ||
|
b4caa60b51 | ||
|
f268028c67 | ||
|
088bcebfb0 | ||
6c97a93bc4 | |||
|
3f8f86351b | ||
|
913b5aab01 | ||
|
445e0e9435 | ||
|
005a44842e | ||
|
83e3c0a158 | ||
|
5e163ba5b5 | ||
|
baa8dbe240 | ||
|
1c1bc5fe32 | ||
|
4cc8f89505 | ||
|
7480d76db5 | ||
|
20c43043c7 | ||
9073896721 | |||
|
bff68cb9bd | ||
|
4ed5285d63 | ||
|
80a953e930 | ||
5c92916f51 | |||
|
fd4eb05830 | ||
6a2454d081 | |||
|
6d4ff66b3f | ||
|
ca1db20838 | ||
|
ef35312edf | ||
|
33d4d8cea3 | ||
|
cf5af9f34f | ||
|
fbcc0e3dfa | ||
|
6bbc993e48 | ||
|
4bc7375c13 | ||
|
98c740fb90 | ||
|
31994c8c06 | ||
|
9346326e0b | ||
|
6f7e3cf889 | ||
|
82d21e5b07 | ||
8135f73ee2 | |||
|
fa1d245f12 | ||
|
ff722181f9 | ||
|
1219aaa1c7 | ||
|
6929c94a3a | ||
8b8e3eafae | |||
|
a3d1ee6d2a | ||
|
fcaf3e47d0 | ||
|
55248a7199 | ||
|
522941a6e3 | ||
|
354d0ad8a7 | ||
|
825068c98d | ||
|
9e0e4d3bfa | ||
|
26a4ca5601 | ||
|
a6973289bf | ||
|
65af002494 | ||
|
1f15102098 | ||
|
9cd7526026 | ||
|
0d85108bc1 | ||
82ec4f3138 | |||
|
2d27816802 | ||
|
edddd5ea30 | ||
|
b3eb7c6659 | ||
|
62a6ecb92a | ||
|
4d55cab3f0 | ||
|
52241caf28 | ||
|
c823004049 | ||
|
b4442b9a95 | ||
|
c4dd01eb1a | ||
|
1347dbe794 | ||
|
6d66189180 | ||
|
3a9eec8eb9 | ||
|
fa86bb6aea | ||
104f38790b | |||
|
85c9bfe492 | ||
198c08f684 | |||
|
45c5213b61 | ||
06a9dd3772 | |||
|
07f0d1b83e | ||
|
54dac885be | ||
|
31ae49ed2c | ||
|
f15a5beb16 | ||
|
6b2043486b | ||
|
b3003266b6 | ||
|
ce62684262 | ||
|
fa83c61dd6 | ||
|
1c74385b2c | ||
|
9772d31eeb | ||
|
1f941b38bc | ||
|
2fcdec3888 | ||
|
119308d609 | ||
|
e3522464ce | ||
|
3d2b4189a2 | ||
|
0e7ee6e916 | ||
|
f0e9769c96 | ||
|
696cfebd23 | ||
|
456093413c | ||
|
ab87570886 | ||
|
f3ed88edd9 | ||
|
0c1c0626d7 | ||
|
a67deea0ac | ||
|
f0c6a52006 | ||
|
8df41f515d | ||
|
dd97930c20 | ||
|
e9793ca648 | ||
|
1a306faca2 | ||
|
cf80327e73 | ||
|
30b7370b4e | ||
|
23656f2a94 | ||
|
3353a10578 | ||
|
f4b28177c4 | ||
|
0c511f6f1f | ||
|
60200964d3 | ||
|
9a213d2afd | ||
|
effb7d6df8 | ||
|
50c379fb82 | ||
|
954cef5635 | ||
|
1b3840f654 | ||
|
69059b1492 | ||
|
5b4bde8a7c | ||
|
2d7d473b31 | ||
|
478ba06a96 | ||
|
99b8ad5ac9 | ||
|
67e431c5c3 | ||
|
a68018500b | ||
|
f667915ef4 | ||
|
81c7bbd881 | ||
|
9e066f0099 | ||
|
31bad7357e | ||
|
ac13339ddc | ||
|
64ffb12722 | ||
|
8cceb71ad1 | ||
|
9b15c1b3e3 | ||
|
f9ea8a959b | ||
|
0d8f854db0 | ||
|
4e0a346dd6 | ||
|
3d06abfc94 | ||
|
b3ea853840 | ||
|
86fcb17237 | ||
|
2388ca8c48 | ||
|
826a949d0e | ||
|
083307b673 | ||
|
d2e60c36c9 | ||
|
c03ad419aa | ||
|
46caa3d2d0 | ||
9f1c0c39d2 | |||
4eac4e6035 | |||
|
12317162c4 | ||
|
83304370c0 | ||
|
433af8a364 | ||
|
789fad25ad | ||
30adbcf2e2 | |||
|
7e26330409 | ||
8d1642db90 | |||
|
5da9cad46f | ||
|
d168316802 | ||
|
d8a1766ad5 | ||
|
0e2014dbd2 | ||
|
877edacc05 | ||
|
adcff64901 | ||
|
112fb4561a | ||
|
2053091beb | ||
|
405d444812 | ||
|
e43c8e55fc | ||
|
d2e8dcb887 | ||
|
6950924a3e | ||
|
b4bb4a6b03 | ||
|
b88532308c | ||
|
d7e23976f0 | ||
|
31e1985f70 | ||
|
dbce4d72c8 | ||
|
99e6d7cef8 | ||
|
c394ac85d4 | ||
|
fcdeb0eb98 | ||
|
fe131bfb04 | ||
|
f2c6073f24 | ||
|
d316266174 | ||
|
649dc4eca1 | ||
|
4379e29dac | ||
|
21576991a5 | ||
|
c07e22f62f | ||
|
f4ccdc2324 | ||
|
cda55122f2 | ||
|
cf7b43f7e4 | ||
|
648e9961b8 | ||
|
29fdc2c6ea | ||
|
753795636e | ||
|
041f29eb58 | ||
13a0f35cd5 | |||
|
a942d85542 | ||
|
b4c7b3f2d2 | ||
|
d21b4ef7b1 | ||
|
d3147dc3f2 | ||
|
8b7797ed1a | ||
|
5d65ea8dd3 | ||
4dfe569d7c | |||
e23f3462d8 | |||
|
1d3294acee | ||
|
88e81b827d | ||
|
d31a978097 | ||
|
36a55225bc | ||
|
74192442bd | ||
|
91079cf6d5 | ||
5228cc6393 | |||
|
412a331879 | ||
|
02b2755cbb | ||
|
334febbfd7 | ||
|
24c851d4c4 | ||
|
87eef8597a | ||
|
87221f5268 | ||
|
f739352312 | ||
|
55ff80562d | ||
|
37c8e003e0 | ||
|
5a24e940ae | ||
|
dfa1a95dda | ||
|
25f6f8b7c2 | ||
|
a4df85fd00 | ||
|
880a7ffd89 | ||
|
5dc9ddb32a | ||
|
ea7584ddb3 | ||
|
426c9d976f | ||
|
ead57f5924 | ||
|
bcd3753a3c | ||
|
8a659c33bf | ||
|
1c8e72ca0a | ||
|
eb47e30856 | ||
|
9943311515 | ||
|
38c3bc2348 | ||
|
44d40a45fd | ||
|
27d7003039 | ||
de4ec94d1f | |||
|
dc17262c54 | ||
|
7e2c30fd27 | ||
|
94068ce963 | ||
|
4d56b45802 | ||
|
4f95cf9de0 | ||
|
06a8e3a0bf | ||
|
415ea92069 | ||
|
2476fccf42 | ||
|
1ca4a29ed4 | ||
|
8081f64912 | ||
|
db3481778b | ||
|
703460ebeb | ||
|
4014972c67 | ||
|
a2e5c83b06 | ||
|
2fa962da30 | ||
|
e0ff861fda | ||
|
7e34443aa8 | ||
8a1e7b3d9d | |||
|
ca2718eb8e | ||
|
c608f88029 | ||
|
9986c7f8a0 | ||
|
1e5cd0a1d0 | ||
|
a6e2419686 | ||
|
8c58faa9c6 | ||
|
a422994504 | ||
|
74f968e350 | ||
|
e241b27b1c | ||
|
cad3250a28 | ||
|
1ebc7e59f9 | ||
|
c1d33705bd | ||
|
b2ebd70fdc | ||
|
36b42a48ba | ||
17ce2e3dd0 | |||
|
3e00615252 | ||
|
c2e88a6598 | ||
|
3579de4e48 | ||
|
12ec9de43c | ||
|
f7b9737972 | ||
|
d636bd71ac | ||
|
20460593f4 | ||
|
697ac4564b | ||
|
0e98b18d64 | ||
|
3c906c4183 | ||
|
5401fac46c | ||
|
93674694ea | ||
312bcc3097 | |||
b639d88f5f | |||
48f58efb56 | |||
|
ed9a3ebf80 | ||
|
968f608c4f | ||
|
8ccf573757 | ||
|
787aaffbb6 | ||
|
34367d58a9 | ||
|
0a3367dfc1 | ||
e112187056 | |||
|
bbc0cd4092 | ||
|
c8e16750c4 | ||
|
f3308f8855 | ||
|
df78993628 | ||
|
4a74f12c63 | ||
|
6d2642ca76 | ||
|
d9e3c138be | ||
|
f062a72777 | ||
|
a750dbebed | ||
|
458c1f96b1 | ||
|
c140cbbd44 | ||
|
abc4909688 | ||
|
1d4693805b | ||
|
163e397acd | ||
|
68ae951953 | ||
|
87f7e30333 | ||
|
47d6f7c9aa | ||
|
f9d5cba70f | ||
|
0385625cc3 | ||
|
87fbc4b01f | ||
|
5487837447 | ||
|
8a30b7d4fd | ||
|
c8d4ffdc81 | ||
|
b33875e9eb | ||
|
590d07dcb5 | ||
|
f0582e7bee | ||
|
e49741bcc5 | ||
|
f2057c954f | ||
|
4442ecbd8e | ||
1cc28b7708 | |||
74558f86e9 | |||
|
c3073c096a | ||
|
1be0bd582f | ||
|
ca707418f8 | ||
|
ab19dad2c5 | ||
|
60b9ab7bfa | ||
|
ac96a56aa3 | ||
|
b6567986ed | ||
|
78e1852fc8 | ||
|
784684789f | ||
|
b342252c8e | ||
d93e65a52c | |||
|
2a55b2e53c | ||
|
298249075d | ||
|
2810d43592 | ||
72b17073d1 | |||
52cb1d718d | |||
|
338897aa61 | ||
|
d6410a15b6 | ||
ee69b01e3a | |||
468d6001f1 | |||
|
cf779588cf | ||
|
c17e34618b | ||
|
0eb92fe138 | ||
|
b43ceb8ea9 | ||
|
e0c56926ec | ||
|
e888cbbd68 | ||
|
1dbbcd4a33 | ||
|
4b3aa29a36 | ||
|
3bcc6bd49f | ||
|
96c8dae494 | ||
|
00fbc9afbe | ||
|
70dff0c546 | ||
|
d540e3a776 | ||
|
4812604f51 | ||
|
8fa8f41681 | ||
|
56c53c5463 | ||
|
3085572825 | ||
|
028dd1ce1f | ||
|
861483d523 |
@ -1,27 +0,0 @@
|
|||||||
# 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 }}
|
|
||||||
|
|
||||||
{{ $subjects := list }}
|
|
||||||
{{ range .Commits -}}
|
|
||||||
{{ if not (has .Subject $subjects) -}}
|
|
||||||
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
|
|
||||||
{{ $subjects = append $subjects .Subject -}}
|
|
||||||
{{ end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- if .NoteGroups -}}
|
|
||||||
{{ range .NoteGroups -}}
|
|
||||||
### {{ .Title }}
|
|
||||||
|
|
||||||
{{ range .Notes }}
|
|
||||||
{{ .Body }}
|
|
||||||
{{ end }}
|
|
||||||
{{ end -}}
|
|
||||||
{{ end -}}
|
|
||||||
{{ end -}}
|
|
@ -1,25 +0,0 @@
|
|||||||
style: github
|
|
||||||
template: CHANGELOG.tpl.md
|
|
||||||
info:
|
|
||||||
title: CHANGELOG
|
|
||||||
repository_url: https://github.com/thegeeklab/docker-tidy
|
|
||||||
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
|
|
512
.drone.jsonnet
512
.drone.jsonnet
@ -1,512 +0,0 @@
|
|||||||
local PythonVersion(pyversion='3.6') = {
|
|
||||||
name: 'python' + std.strReplace(pyversion, '.', '') + '-pytest',
|
|
||||||
image: 'python:' + pyversion,
|
|
||||||
environment: {
|
|
||||||
PY_COLORS: 1,
|
|
||||||
},
|
|
||||||
commands: [
|
|
||||||
'pip install poetry poetry-dynamic-versioning -qq',
|
|
||||||
'poetry config experimental.new-installer false',
|
|
||||||
'poetry install',
|
|
||||||
'poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail',
|
|
||||||
'poetry version',
|
|
||||||
'poetry run docker-tidy --help',
|
|
||||||
],
|
|
||||||
depends_on: [
|
|
||||||
'fetch',
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
local PipelineLint = {
|
|
||||||
kind: 'pipeline',
|
|
||||||
name: 'lint',
|
|
||||||
platform: {
|
|
||||||
os: 'linux',
|
|
||||||
arch: 'amd64',
|
|
||||||
},
|
|
||||||
steps: [
|
|
||||||
{
|
|
||||||
name: 'yapf',
|
|
||||||
image: 'python:3.9',
|
|
||||||
environment: {
|
|
||||||
PY_COLORS: 1,
|
|
||||||
},
|
|
||||||
commands: [
|
|
||||||
'git fetch -tq',
|
|
||||||
'pip install poetry poetry-dynamic-versioning -qq',
|
|
||||||
'poetry config experimental.new-installer false',
|
|
||||||
'poetry install',
|
|
||||||
'poetry run yapf -dr ./dockertidy',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'flake8',
|
|
||||||
image: 'python:3.9',
|
|
||||||
environment: {
|
|
||||||
PY_COLORS: 1,
|
|
||||||
},
|
|
||||||
commands: [
|
|
||||||
'git fetch -tq',
|
|
||||||
'pip install poetry poetry-dynamic-versioning -qq',
|
|
||||||
'poetry config experimental.new-installer false',
|
|
||||||
'poetry install',
|
|
||||||
'poetry run flake8 ./dockertidy',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
trigger: {
|
|
||||||
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
local PipelineTest = {
|
|
||||||
kind: 'pipeline',
|
|
||||||
name: 'test',
|
|
||||||
platform: {
|
|
||||||
os: 'linux',
|
|
||||||
arch: 'amd64',
|
|
||||||
},
|
|
||||||
steps: [
|
|
||||||
{
|
|
||||||
name: 'fetch',
|
|
||||||
image: 'python:3.9',
|
|
||||||
commands: [
|
|
||||||
'git fetch -tq',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
PythonVersion(pyversion='3.6'),
|
|
||||||
PythonVersion(pyversion='3.7'),
|
|
||||||
PythonVersion(pyversion='3.8'),
|
|
||||||
PythonVersion(pyversion='3.9'),
|
|
||||||
{
|
|
||||||
name: 'codecov',
|
|
||||||
image: 'python:3.9',
|
|
||||||
environment: {
|
|
||||||
PY_COLORS: 1,
|
|
||||||
CODECOV_TOKEN: { from_secret: 'codecov_token' },
|
|
||||||
},
|
|
||||||
commands: [
|
|
||||||
'pip install codecov -qq',
|
|
||||||
'codecov --required -X gcov',
|
|
||||||
],
|
|
||||||
depends_on: [
|
|
||||||
'python36-pytest',
|
|
||||||
'python37-pytest',
|
|
||||||
'python38-pytest',
|
|
||||||
'python39-pytest',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
depends_on: [
|
|
||||||
'lint',
|
|
||||||
],
|
|
||||||
trigger: {
|
|
||||||
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
local PipelineSecurity = {
|
|
||||||
kind: 'pipeline',
|
|
||||||
name: 'security',
|
|
||||||
platform: {
|
|
||||||
os: 'linux',
|
|
||||||
arch: 'amd64',
|
|
||||||
},
|
|
||||||
steps: [
|
|
||||||
{
|
|
||||||
name: 'bandit',
|
|
||||||
image: 'python:3.9',
|
|
||||||
environment: {
|
|
||||||
PY_COLORS: 1,
|
|
||||||
},
|
|
||||||
commands: [
|
|
||||||
'git fetch -tq',
|
|
||||||
'pip install poetry poetry-dynamic-versioning -qq',
|
|
||||||
'poetry config experimental.new-installer false',
|
|
||||||
'poetry install',
|
|
||||||
'poetry run bandit -r ./dockertidy -x ./dockertidy/test',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
depends_on: [
|
|
||||||
'test',
|
|
||||||
],
|
|
||||||
trigger: {
|
|
||||||
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
local PipelineBuildPackage = {
|
|
||||||
kind: 'pipeline',
|
|
||||||
name: 'build-package',
|
|
||||||
platform: {
|
|
||||||
os: 'linux',
|
|
||||||
arch: 'amd64',
|
|
||||||
},
|
|
||||||
steps: [
|
|
||||||
{
|
|
||||||
name: 'build',
|
|
||||||
image: 'python:3.9',
|
|
||||||
commands: [
|
|
||||||
'git fetch -tq',
|
|
||||||
'pip install poetry poetry-dynamic-versioning -qq',
|
|
||||||
'poetry build',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'checksum',
|
|
||||||
image: 'alpine',
|
|
||||||
commands: [
|
|
||||||
'cd dist/ && sha256sum * > ../sha256sum.txt',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'changelog-generate',
|
|
||||||
image: 'thegeeklab/git-chglog',
|
|
||||||
commands: [
|
|
||||||
'git fetch -tq',
|
|
||||||
'git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'changelog-format',
|
|
||||||
image: 'thegeeklab/alpine-tools',
|
|
||||||
commands: [
|
|
||||||
'prettier CHANGELOG.md',
|
|
||||||
'prettier -w CHANGELOG.md',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'publish-github',
|
|
||||||
image: 'plugins/github-release',
|
|
||||||
settings: {
|
|
||||||
overwrite: true,
|
|
||||||
api_key: { from_secret: 'github_token' },
|
|
||||||
files: ['dist/*', 'sha256sum.txt'],
|
|
||||||
title: '${DRONE_TAG}',
|
|
||||||
note: 'CHANGELOG.md',
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
ref: ['refs/tags/**'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'publish-pypi',
|
|
||||||
image: 'python:3.9',
|
|
||||||
commands: [
|
|
||||||
'git fetch -tq',
|
|
||||||
'pip install poetry poetry-dynamic-versioning -qq',
|
|
||||||
'poetry publish -n',
|
|
||||||
],
|
|
||||||
environment: {
|
|
||||||
POETRY_HTTP_BASIC_PYPI_USERNAME: { from_secret: 'pypi_username' },
|
|
||||||
POETRY_HTTP_BASIC_PYPI_PASSWORD: { from_secret: 'pypi_password' },
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
ref: ['refs/tags/**'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
depends_on: [
|
|
||||||
'security',
|
|
||||||
],
|
|
||||||
trigger: {
|
|
||||||
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
local PipelineBuildContainer(arch='amd64') = {
|
|
||||||
local build = if arch == 'arm' then [{
|
|
||||||
name: 'build',
|
|
||||||
image: 'python:3.9-alpine',
|
|
||||||
commands: [
|
|
||||||
'apk add -Uq --no-cache build-base openssl-dev libffi-dev musl-dev python3-dev git cargo',
|
|
||||||
'git fetch -tq',
|
|
||||||
'pip install poetry poetry-dynamic-versioning -qq',
|
|
||||||
'poetry build',
|
|
||||||
],
|
|
||||||
environment: {
|
|
||||||
CARGO_NET_GIT_FETCH_WITH_CLI: true,
|
|
||||||
},
|
|
||||||
}] else [{
|
|
||||||
name: 'build',
|
|
||||||
image: 'python:3.9',
|
|
||||||
commands: [
|
|
||||||
'git fetch -tq',
|
|
||||||
'pip install poetry poetry-dynamic-versioning -qq',
|
|
||||||
'poetry build',
|
|
||||||
],
|
|
||||||
}],
|
|
||||||
|
|
||||||
kind: 'pipeline',
|
|
||||||
name: 'build-container-' + arch,
|
|
||||||
platform: {
|
|
||||||
os: 'linux',
|
|
||||||
arch: arch,
|
|
||||||
},
|
|
||||||
steps: build + [
|
|
||||||
{
|
|
||||||
name: 'dryrun',
|
|
||||||
image: 'thegeeklab/drone-docker:19',
|
|
||||||
settings: {
|
|
||||||
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: 'thegeeklab/drone-docker:19',
|
|
||||||
settings: {
|
|
||||||
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: 'thegeeklab/drone-docker:19',
|
|
||||||
settings: {
|
|
||||||
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: [
|
|
||||||
'security',
|
|
||||||
],
|
|
||||||
trigger: {
|
|
||||||
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
local PipelineDocs = {
|
|
||||||
kind: 'pipeline',
|
|
||||||
name: 'docs',
|
|
||||||
platform: {
|
|
||||||
os: 'linux',
|
|
||||||
arch: 'amd64',
|
|
||||||
},
|
|
||||||
concurrency: {
|
|
||||||
limit: 1,
|
|
||||||
},
|
|
||||||
steps: [
|
|
||||||
{
|
|
||||||
name: 'assets',
|
|
||||||
image: 'thegeeklab/alpine-tools',
|
|
||||||
commands: [
|
|
||||||
'make doc',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'markdownlint',
|
|
||||||
image: 'thegeeklab/markdownlint-cli',
|
|
||||||
commands: [
|
|
||||||
"markdownlint 'docs/content/**/*.md' 'README.md' 'CONTRIBUTING.md'",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'spellcheck',
|
|
||||||
image: 'node:lts-alpine',
|
|
||||||
commands: [
|
|
||||||
'npm install -g spellchecker-cli',
|
|
||||||
"spellchecker --files 'docs/content/**/*.md' 'README.md' 'CONTRIBUTING.md' -d .dictionary -p spell indefinite-article syntax-urls --no-suggestions",
|
|
||||||
],
|
|
||||||
environment: {
|
|
||||||
FORCE_COLOR: true,
|
|
||||||
NPM_CONFIG_LOGLEVEL: 'error',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'testbuild',
|
|
||||||
image: 'thegeeklab/hugo:0.83.1',
|
|
||||||
commands: [
|
|
||||||
'hugo -s docs/ -b http://localhost/',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'link-validation',
|
|
||||||
image: 'thegeeklab/link-validator',
|
|
||||||
commands: [
|
|
||||||
'link-validator -ro',
|
|
||||||
],
|
|
||||||
environment: {
|
|
||||||
LINK_VALIDATOR_BASE_DIR: 'docs/public',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'build',
|
|
||||||
image: 'thegeeklab/hugo:0.83.1',
|
|
||||||
commands: [
|
|
||||||
'hugo -s docs/',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'beautify',
|
|
||||||
image: 'node:lts-alpine',
|
|
||||||
commands: [
|
|
||||||
'npm install -g js-beautify',
|
|
||||||
"html-beautify -r -f 'docs/public/**/*.html'",
|
|
||||||
],
|
|
||||||
environment: {
|
|
||||||
FORCE_COLOR: true,
|
|
||||||
NPM_CONFIG_LOGLEVEL: 'error',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'publish',
|
|
||||||
image: 'plugins/s3-sync',
|
|
||||||
settings: {
|
|
||||||
access_key: { from_secret: 's3_access_key' },
|
|
||||||
bucket: 'geekdocs',
|
|
||||||
delete: true,
|
|
||||||
endpoint: 'https://sp.rknet.org',
|
|
||||||
path_style: true,
|
|
||||||
secret_key: { from_secret: 's3_secret_access_key' },
|
|
||||||
source: 'docs/public/',
|
|
||||||
strip_prefix: 'docs/public/',
|
|
||||||
target: '/${DRONE_REPO_NAME}',
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
ref: ['refs/heads/main', 'refs/tags/**'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
depends_on: [
|
|
||||||
'build-package',
|
|
||||||
'build-container-amd64',
|
|
||||||
'build-container-arm64',
|
|
||||||
'build-container-arm',
|
|
||||||
],
|
|
||||||
trigger: {
|
|
||||||
ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
local PipelineNotifications = {
|
|
||||||
kind: 'pipeline',
|
|
||||||
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',
|
|
||||||
pull: 'always',
|
|
||||||
image: 'chko/docker-pushrm:1',
|
|
||||||
environment: {
|
|
||||||
DOCKER_PASS: {
|
|
||||||
from_secret: 'docker_password',
|
|
||||||
},
|
|
||||||
DOCKER_USER: {
|
|
||||||
from_secret: 'docker_username',
|
|
||||||
},
|
|
||||||
PUSHRM_FILE: 'README.md',
|
|
||||||
PUSHRM_SHORT: 'Keep docker hosts tidy',
|
|
||||||
PUSHRM_TARGET: 'thegeeklab/${DRONE_REPO_NAME}',
|
|
||||||
},
|
|
||||||
when: {
|
|
||||||
status: ['success'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'pushrm-quay',
|
|
||||||
pull: 'always',
|
|
||||||
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: [
|
|
||||||
'docs',
|
|
||||||
],
|
|
||||||
trigger: {
|
|
||||||
ref: ['refs/heads/main', 'refs/tags/**'],
|
|
||||||
status: ['success', 'failure'],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
[
|
|
||||||
PipelineLint,
|
|
||||||
PipelineTest,
|
|
||||||
PipelineSecurity,
|
|
||||||
PipelineBuildPackage,
|
|
||||||
PipelineBuildContainer(arch='amd64'),
|
|
||||||
PipelineBuildContainer(arch='arm64'),
|
|
||||||
PipelineBuildContainer(arch='arm'),
|
|
||||||
PipelineDocs,
|
|
||||||
PipelineNotifications,
|
|
||||||
]
|
|
654
.drone.yml
654
.drone.yml
@ -1,654 +0,0 @@
|
|||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: lint
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: yapf
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry config experimental.new-installer false
|
|
||||||
- poetry install
|
|
||||||
- poetry run yapf -dr ./dockertidy
|
|
||||||
environment:
|
|
||||||
PY_COLORS: 1
|
|
||||||
|
|
||||||
- name: flake8
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry config experimental.new-installer false
|
|
||||||
- poetry install
|
|
||||||
- poetry run flake8 ./dockertidy
|
|
||||||
environment:
|
|
||||||
PY_COLORS: 1
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: test
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: fetch
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
|
|
||||||
- name: python36-pytest
|
|
||||||
image: python:3.6
|
|
||||||
commands:
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry config experimental.new-installer false
|
|
||||||
- poetry install
|
|
||||||
- poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
|
|
||||||
- poetry version
|
|
||||||
- poetry run docker-tidy --help
|
|
||||||
environment:
|
|
||||||
PY_COLORS: 1
|
|
||||||
depends_on:
|
|
||||||
- fetch
|
|
||||||
|
|
||||||
- name: python37-pytest
|
|
||||||
image: python:3.7
|
|
||||||
commands:
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry config experimental.new-installer false
|
|
||||||
- poetry install
|
|
||||||
- poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
|
|
||||||
- poetry version
|
|
||||||
- poetry run docker-tidy --help
|
|
||||||
environment:
|
|
||||||
PY_COLORS: 1
|
|
||||||
depends_on:
|
|
||||||
- fetch
|
|
||||||
|
|
||||||
- name: python38-pytest
|
|
||||||
image: python:3.8
|
|
||||||
commands:
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry config experimental.new-installer false
|
|
||||||
- poetry install
|
|
||||||
- poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
|
|
||||||
- poetry version
|
|
||||||
- poetry run docker-tidy --help
|
|
||||||
environment:
|
|
||||||
PY_COLORS: 1
|
|
||||||
depends_on:
|
|
||||||
- fetch
|
|
||||||
|
|
||||||
- name: python39-pytest
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry config experimental.new-installer false
|
|
||||||
- poetry install
|
|
||||||
- poetry run pytest dockertidy --cov=dockertidy --cov-append --no-cov-on-fail
|
|
||||||
- poetry version
|
|
||||||
- poetry run docker-tidy --help
|
|
||||||
environment:
|
|
||||||
PY_COLORS: 1
|
|
||||||
depends_on:
|
|
||||||
- fetch
|
|
||||||
|
|
||||||
- name: codecov
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- pip install codecov -qq
|
|
||||||
- codecov --required -X gcov
|
|
||||||
environment:
|
|
||||||
CODECOV_TOKEN:
|
|
||||||
from_secret: codecov_token
|
|
||||||
PY_COLORS: 1
|
|
||||||
depends_on:
|
|
||||||
- python36-pytest
|
|
||||||
- python37-pytest
|
|
||||||
- python38-pytest
|
|
||||||
- python39-pytest
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- lint
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: security
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: bandit
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry config experimental.new-installer false
|
|
||||||
- poetry install
|
|
||||||
- poetry run bandit -r ./dockertidy -x ./dockertidy/test
|
|
||||||
environment:
|
|
||||||
PY_COLORS: 1
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- test
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: build-package
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry build
|
|
||||||
|
|
||||||
- name: checksum
|
|
||||||
image: alpine
|
|
||||||
commands:
|
|
||||||
- cd dist/ && sha256sum * > ../sha256sum.txt
|
|
||||||
|
|
||||||
- name: changelog-generate
|
|
||||||
image: thegeeklab/git-chglog
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
- git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}
|
|
||||||
|
|
||||||
- name: changelog-format
|
|
||||||
image: thegeeklab/alpine-tools
|
|
||||||
commands:
|
|
||||||
- prettier CHANGELOG.md
|
|
||||||
- prettier -w CHANGELOG.md
|
|
||||||
|
|
||||||
- name: publish-github
|
|
||||||
image: plugins/github-release
|
|
||||||
settings:
|
|
||||||
api_key:
|
|
||||||
from_secret: github_token
|
|
||||||
files:
|
|
||||||
- dist/*
|
|
||||||
- sha256sum.txt
|
|
||||||
note: CHANGELOG.md
|
|
||||||
overwrite: true
|
|
||||||
title: ${DRONE_TAG}
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/tags/**
|
|
||||||
|
|
||||||
- name: publish-pypi
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry publish -n
|
|
||||||
environment:
|
|
||||||
POETRY_HTTP_BASIC_PYPI_PASSWORD:
|
|
||||||
from_secret: pypi_password
|
|
||||||
POETRY_HTTP_BASIC_PYPI_USERNAME:
|
|
||||||
from_secret: pypi_username
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/tags/**
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- security
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: build-container-amd64
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry build
|
|
||||||
|
|
||||||
- name: dryrun
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
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: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: amd64
|
|
||||||
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: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: amd64
|
|
||||||
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
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- security
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: build-container-arm64
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: arm64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: python:3.9
|
|
||||||
commands:
|
|
||||||
- git fetch -tq
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry build
|
|
||||||
|
|
||||||
- name: dryrun
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
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: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: arm64
|
|
||||||
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: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: arm64
|
|
||||||
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
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- security
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: build-container-arm
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: arm
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: python:3.9-alpine
|
|
||||||
commands:
|
|
||||||
- apk add -Uq --no-cache build-base openssl-dev libffi-dev musl-dev python3-dev git cargo
|
|
||||||
- git fetch -tq
|
|
||||||
- pip install poetry poetry-dynamic-versioning -qq
|
|
||||||
- poetry build
|
|
||||||
environment:
|
|
||||||
CARGO_NET_GIT_FETCH_WITH_CLI: true
|
|
||||||
|
|
||||||
- name: dryrun
|
|
||||||
image: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
dockerfile: docker/Dockerfile.arm
|
|
||||||
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: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: arm
|
|
||||||
dockerfile: docker/Dockerfile.arm
|
|
||||||
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: thegeeklab/drone-docker:19
|
|
||||||
settings:
|
|
||||||
auto_tag: true
|
|
||||||
auto_tag_suffix: arm
|
|
||||||
dockerfile: docker/Dockerfile.arm
|
|
||||||
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
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- security
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: docs
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
limit: 1
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: assets
|
|
||||||
image: thegeeklab/alpine-tools
|
|
||||||
commands:
|
|
||||||
- make doc
|
|
||||||
|
|
||||||
- name: markdownlint
|
|
||||||
image: thegeeklab/markdownlint-cli
|
|
||||||
commands:
|
|
||||||
- markdownlint 'docs/content/**/*.md' 'README.md' 'CONTRIBUTING.md'
|
|
||||||
|
|
||||||
- name: spellcheck
|
|
||||||
image: node:lts-alpine
|
|
||||||
commands:
|
|
||||||
- npm install -g spellchecker-cli
|
|
||||||
- spellchecker --files 'docs/content/**/*.md' 'README.md' 'CONTRIBUTING.md' -d .dictionary -p spell indefinite-article syntax-urls --no-suggestions
|
|
||||||
environment:
|
|
||||||
FORCE_COLOR: true
|
|
||||||
NPM_CONFIG_LOGLEVEL: error
|
|
||||||
|
|
||||||
- name: testbuild
|
|
||||||
image: thegeeklab/hugo:0.83.1
|
|
||||||
commands:
|
|
||||||
- hugo -s docs/ -b http://localhost/
|
|
||||||
|
|
||||||
- name: link-validation
|
|
||||||
image: thegeeklab/link-validator
|
|
||||||
commands:
|
|
||||||
- link-validator -ro
|
|
||||||
environment:
|
|
||||||
LINK_VALIDATOR_BASE_DIR: docs/public
|
|
||||||
|
|
||||||
- name: build
|
|
||||||
image: thegeeklab/hugo:0.83.1
|
|
||||||
commands:
|
|
||||||
- hugo -s docs/
|
|
||||||
|
|
||||||
- name: beautify
|
|
||||||
image: node:lts-alpine
|
|
||||||
commands:
|
|
||||||
- npm install -g js-beautify
|
|
||||||
- html-beautify -r -f 'docs/public/**/*.html'
|
|
||||||
environment:
|
|
||||||
FORCE_COLOR: true
|
|
||||||
NPM_CONFIG_LOGLEVEL: error
|
|
||||||
|
|
||||||
- name: publish
|
|
||||||
image: plugins/s3-sync
|
|
||||||
settings:
|
|
||||||
access_key:
|
|
||||||
from_secret: s3_access_key
|
|
||||||
bucket: geekdocs
|
|
||||||
delete: true
|
|
||||||
endpoint: https://sp.rknet.org
|
|
||||||
path_style: true
|
|
||||||
secret_key:
|
|
||||||
from_secret: s3_secret_access_key
|
|
||||||
source: docs/public/
|
|
||||||
strip_prefix: docs/public/
|
|
||||||
target: /${DRONE_REPO_NAME}
|
|
||||||
when:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
- refs/pull/**
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- build-package
|
|
||||||
- build-container-amd64
|
|
||||||
- build-container-arm64
|
|
||||||
- build-container-arm
|
|
||||||
|
|
||||||
---
|
|
||||||
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
|
|
||||||
pull: always
|
|
||||||
image: chko/docker-pushrm:1
|
|
||||||
environment:
|
|
||||||
DOCKER_PASS:
|
|
||||||
from_secret: docker_password
|
|
||||||
DOCKER_USER:
|
|
||||||
from_secret: docker_username
|
|
||||||
PUSHRM_FILE: README.md
|
|
||||||
PUSHRM_SHORT: Keep docker hosts tidy
|
|
||||||
PUSHRM_TARGET: thegeeklab/${DRONE_REPO_NAME}
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- success
|
|
||||||
|
|
||||||
- name: pushrm-quay
|
|
||||||
pull: always
|
|
||||||
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
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/main
|
|
||||||
- refs/tags/**
|
|
||||||
status:
|
|
||||||
- success
|
|
||||||
- failure
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- docs
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: signature
|
|
||||||
hmac: 0ceda00e37bf11614697e5f502d9cc78a8f04ba77a7862566ee6e5ecc5fc9c89
|
|
||||||
|
|
||||||
...
|
|
9
.github/settings.yml
vendored
9
.github/settings.yml
vendored
@ -52,6 +52,11 @@ branches:
|
|||||||
required_status_checks:
|
required_status_checks:
|
||||||
strict: false
|
strict: false
|
||||||
contexts:
|
contexts:
|
||||||
- continuous-integration/drone/pr
|
- ci/woodpecker/pr/lint
|
||||||
enforce_admins: null
|
- ci/woodpecker/pr/test
|
||||||
|
- ci/woodpecker/pr/build-package
|
||||||
|
- ci/woodpecker/pr/build-container
|
||||||
|
- ci/woodpecker/pr/docs
|
||||||
|
enforce_admins: false
|
||||||
|
required_linear_history: true
|
||||||
restrictions: null
|
restrictions: null
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -106,7 +106,9 @@ pip-wheel-metadata
|
|||||||
docs/themes/
|
docs/themes/
|
||||||
docs/public/
|
docs/public/
|
||||||
resources/_gen/
|
resources/_gen/
|
||||||
|
.hugo_build.lock
|
||||||
|
|
||||||
# Misc
|
# Misc
|
||||||
.dockertidy*
|
.dockertidy*
|
||||||
CHANGELOG.md
|
CHANGELOG.md
|
||||||
|
.ruff_cache
|
||||||
|
47
.gitsv/config.yml
Normal file
47
.gitsv/config.yml
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
---
|
||||||
|
version: "1.1"
|
||||||
|
|
||||||
|
versioning:
|
||||||
|
update-major: []
|
||||||
|
update-minor: [feat]
|
||||||
|
update-patch: [fix, perf, refactor, chore, test, ci, docs]
|
||||||
|
|
||||||
|
tag:
|
||||||
|
pattern: "v%d.%d.%d"
|
||||||
|
|
||||||
|
release-notes:
|
||||||
|
sections:
|
||||||
|
- name: Features
|
||||||
|
commit-types: [feat]
|
||||||
|
section-type: commits
|
||||||
|
- name: Bug Fixes
|
||||||
|
commit-types: [fix]
|
||||||
|
section-type: commits
|
||||||
|
- name: Performance Improvements
|
||||||
|
commit-types: [perf]
|
||||||
|
section-type: commits
|
||||||
|
- name: Code Refactoring
|
||||||
|
commit-types: [refactor]
|
||||||
|
section-type: commits
|
||||||
|
- name: Others
|
||||||
|
commit-types: [chore]
|
||||||
|
section-type: commits
|
||||||
|
- name: Testing
|
||||||
|
commit-types: [test]
|
||||||
|
section-type: commits
|
||||||
|
- name: CI Pipeline
|
||||||
|
commit-types: [ci]
|
||||||
|
section-type: commits
|
||||||
|
- name: Documentation
|
||||||
|
commit-types: [docs]
|
||||||
|
section-type: commits
|
||||||
|
- name: Breaking Changes
|
||||||
|
section-type: breaking-changes
|
||||||
|
|
||||||
|
commit-message:
|
||||||
|
footer:
|
||||||
|
issue:
|
||||||
|
key: issue
|
||||||
|
add-value-prefix: "#"
|
||||||
|
issue:
|
||||||
|
regex: "#?[0-9]+"
|
1
.lycheeignore
Normal file
1
.lycheeignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
https://hub.docker.com/r/thegeeklab/*
|
82
.woodpecker/build-container.yml
Normal file
82
.woodpecker/build-container.yml
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
---
|
||||||
|
when:
|
||||||
|
- event: [pull_request, tag]
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: docker.io/library/python:3.12
|
||||||
|
commands:
|
||||||
|
- pip install poetry poetry-dynamic-versioning -qq
|
||||||
|
- poetry build
|
||||||
|
|
||||||
|
- name: security-build
|
||||||
|
image: quay.io/thegeeklab/wp-docker-buildx:5
|
||||||
|
depends_on: [build]
|
||||||
|
settings:
|
||||||
|
containerfile: Containerfile.multiarch
|
||||||
|
output: type=oci,dest=oci/${CI_REPO_NAME},tar=false
|
||||||
|
repo: ${CI_REPO}
|
||||||
|
|
||||||
|
- name: security-scan
|
||||||
|
image: docker.io/aquasec/trivy
|
||||||
|
depends_on: [security-build]
|
||||||
|
commands:
|
||||||
|
- trivy -v
|
||||||
|
- trivy image --input oci/${CI_REPO_NAME}
|
||||||
|
environment:
|
||||||
|
TRIVY_EXIT_CODE: "1"
|
||||||
|
TRIVY_IGNORE_UNFIXED: "true"
|
||||||
|
TRIVY_NO_PROGRESS: "true"
|
||||||
|
TRIVY_SEVERITY: HIGH,CRITICAL
|
||||||
|
TRIVY_TIMEOUT: 1m
|
||||||
|
TRIVY_DB_REPOSITORY: docker.io/aquasec/trivy-db:2
|
||||||
|
|
||||||
|
- name: publish-dockerhub
|
||||||
|
image: quay.io/thegeeklab/wp-docker-buildx:5
|
||||||
|
depends_on: [security-scan]
|
||||||
|
settings:
|
||||||
|
auto_tag: true
|
||||||
|
containerfile: Containerfile.multiarch
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
platforms:
|
||||||
|
- linux/amd64
|
||||||
|
- linux/arm64
|
||||||
|
provenance: false
|
||||||
|
repo: ${CI_REPO}
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
when:
|
||||||
|
- event: [tag]
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
- name: publish-quay
|
||||||
|
image: quay.io/thegeeklab/wp-docker-buildx:5
|
||||||
|
depends_on: security-scan
|
||||||
|
settings:
|
||||||
|
auto_tag: true
|
||||||
|
containerfile: Containerfile.multiarch
|
||||||
|
password:
|
||||||
|
from_secret: quay_password
|
||||||
|
platforms:
|
||||||
|
- linux/amd64
|
||||||
|
- linux/arm64
|
||||||
|
provenance: false
|
||||||
|
registry: quay.io
|
||||||
|
repo: quay.io/${CI_REPO}
|
||||||
|
username:
|
||||||
|
from_secret: quay_username
|
||||||
|
when:
|
||||||
|
- event: [tag]
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- lint
|
||||||
|
- test
|
56
.woodpecker/build-package.yml
Normal file
56
.woodpecker/build-package.yml
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
---
|
||||||
|
when:
|
||||||
|
- event: [pull_request, tag]
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: docker.io/library/python:3.12
|
||||||
|
commands:
|
||||||
|
- pip install poetry poetry-dynamic-versioning -qq
|
||||||
|
- poetry build
|
||||||
|
|
||||||
|
- name: checksum
|
||||||
|
image: quay.io/thegeeklab/alpine-tools
|
||||||
|
commands:
|
||||||
|
- cd dist/ && sha256sum * > ../sha256sum.txt
|
||||||
|
|
||||||
|
- name: changelog
|
||||||
|
image: quay.io/thegeeklab/git-sv
|
||||||
|
commands:
|
||||||
|
- git sv current-version
|
||||||
|
- git sv release-notes -t ${CI_COMMIT_TAG:-next} -o CHANGELOG.md
|
||||||
|
- cat CHANGELOG.md
|
||||||
|
|
||||||
|
- name: publish-github
|
||||||
|
image: docker.io/plugins/github-release
|
||||||
|
settings:
|
||||||
|
api_key:
|
||||||
|
from_secret: github_token
|
||||||
|
files:
|
||||||
|
- dist/*
|
||||||
|
- sha256sum.txt
|
||||||
|
note: CHANGELOG.md
|
||||||
|
overwrite: true
|
||||||
|
title: ${CI_COMMIT_TAG}
|
||||||
|
when:
|
||||||
|
- event: [tag]
|
||||||
|
|
||||||
|
- name: publish-pypi
|
||||||
|
image: docker.io/library/python:3.12
|
||||||
|
environment:
|
||||||
|
POETRY_HTTP_BASIC_PYPI_PASSWORD:
|
||||||
|
from_secret: pypi_password
|
||||||
|
POETRY_HTTP_BASIC_PYPI_USERNAME:
|
||||||
|
from_secret: pypi_username
|
||||||
|
commands:
|
||||||
|
- pip install poetry poetry-dynamic-versioning -qq
|
||||||
|
- poetry publish -n
|
||||||
|
when:
|
||||||
|
- event: [tag]
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- lint
|
||||||
|
- test
|
101
.woodpecker/docs.yml
Normal file
101
.woodpecker/docs.yml
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
---
|
||||||
|
when:
|
||||||
|
- event: [pull_request, tag]
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: assets
|
||||||
|
image: quay.io/thegeeklab/alpine-tools
|
||||||
|
commands:
|
||||||
|
- make doc
|
||||||
|
|
||||||
|
- name: markdownlint
|
||||||
|
image: quay.io/thegeeklab/markdownlint-cli
|
||||||
|
depends_on: [assets]
|
||||||
|
commands:
|
||||||
|
- markdownlint 'README.md' 'CONTRIBUTING.md'
|
||||||
|
|
||||||
|
- name: spellcheck
|
||||||
|
image: quay.io/thegeeklab/alpine-tools
|
||||||
|
depends_on: [assets]
|
||||||
|
commands:
|
||||||
|
- spellchecker --files 'docs/**/*.md' 'README.md' 'CONTRIBUTING.md' -d .dictionary -p spell indefinite-article syntax-urls
|
||||||
|
environment:
|
||||||
|
FORCE_COLOR: "true"
|
||||||
|
|
||||||
|
- name: link-validation
|
||||||
|
image: docker.io/lycheeverse/lychee
|
||||||
|
depends_on: [assets]
|
||||||
|
commands:
|
||||||
|
- lychee --no-progress --format detailed docs/content README.md
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
image: quay.io/thegeeklab/hugo:0.136.5
|
||||||
|
depends_on: [link-validation]
|
||||||
|
commands:
|
||||||
|
- hugo --panicOnWarning -s docs/
|
||||||
|
|
||||||
|
- name: beautify
|
||||||
|
image: quay.io/thegeeklab/alpine-tools
|
||||||
|
depends_on: [build]
|
||||||
|
commands:
|
||||||
|
- html-beautify -r -f 'docs/public/**/*.html'
|
||||||
|
|
||||||
|
- name: publish
|
||||||
|
image: quay.io/thegeeklab/wp-s3-action
|
||||||
|
depends_on: [beautify]
|
||||||
|
settings:
|
||||||
|
access_key:
|
||||||
|
from_secret: s3_access_key
|
||||||
|
bucket: geekdocs
|
||||||
|
delete: true
|
||||||
|
endpoint:
|
||||||
|
from_secret: s3_endpoint
|
||||||
|
path_style: true
|
||||||
|
secret_key:
|
||||||
|
from_secret: s3_secret_access_key
|
||||||
|
source: docs/public/
|
||||||
|
strip_prefix: docs/public/
|
||||||
|
target: /${CI_REPO_NAME}
|
||||||
|
when:
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
status: [success, failure]
|
||||||
|
|
||||||
|
- name: pushrm-dockerhub
|
||||||
|
image: docker.io/chko/docker-pushrm:1
|
||||||
|
depends_on: [publish]
|
||||||
|
environment:
|
||||||
|
DOCKER_PASS:
|
||||||
|
from_secret: docker_password
|
||||||
|
DOCKER_USER:
|
||||||
|
from_secret: docker_username
|
||||||
|
PUSHRM_FILE: README.md
|
||||||
|
PUSHRM_SHORT: Keep docker hosts tidy
|
||||||
|
PUSHRM_TARGET: ${CI_REPO}
|
||||||
|
when:
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
status: [success]
|
||||||
|
|
||||||
|
- name: pushrm-quay
|
||||||
|
image: docker.io/chko/docker-pushrm:1
|
||||||
|
depends_on: [publish]
|
||||||
|
environment:
|
||||||
|
APIKEY__QUAY_IO:
|
||||||
|
from_secret: quay_token
|
||||||
|
PUSHRM_FILE: README.md
|
||||||
|
PUSHRM_TARGET: quay.io/${CI_REPO}
|
||||||
|
when:
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
status: [success]
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- build-package
|
||||||
|
- build-container
|
27
.woodpecker/lint.yml
Normal file
27
.woodpecker/lint.yml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
when:
|
||||||
|
- event: [pull_request, tag]
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: check-format
|
||||||
|
image: docker.io/library/python:3.12
|
||||||
|
depends_on: []
|
||||||
|
commands:
|
||||||
|
- pip install poetry poetry-dynamic-versioning -qq
|
||||||
|
- poetry install
|
||||||
|
- poetry run ruff format --check --diff ./${CI_REPO_NAME//-/}
|
||||||
|
environment:
|
||||||
|
PY_COLORS: "1"
|
||||||
|
|
||||||
|
- name: check-coding
|
||||||
|
image: docker.io/library/python:3.12
|
||||||
|
depends_on: []
|
||||||
|
commands:
|
||||||
|
- pip install poetry poetry-dynamic-versioning -qq
|
||||||
|
- poetry install
|
||||||
|
- poetry run ruff check ./${CI_REPO_NAME//-/}
|
||||||
|
environment:
|
||||||
|
PY_COLORS: "1"
|
26
.woodpecker/notify.yml
Normal file
26
.woodpecker/notify.yml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
when:
|
||||||
|
- event: [tag]
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
runs_on: [success, failure]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: matrix
|
||||||
|
image: quay.io/thegeeklab/wp-matrix
|
||||||
|
settings:
|
||||||
|
homeserver:
|
||||||
|
from_secret: matrix_homeserver
|
||||||
|
room_id:
|
||||||
|
from_secret: matrix_room_id
|
||||||
|
user_id:
|
||||||
|
from_secret: matrix_user_id
|
||||||
|
access_token:
|
||||||
|
from_secret: matrix_access_token
|
||||||
|
when:
|
||||||
|
- status: [success, failure]
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- docs
|
39
.woodpecker/test.yml
Normal file
39
.woodpecker/test.yml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
---
|
||||||
|
when:
|
||||||
|
- event: [pull_request, tag]
|
||||||
|
- event: [push, manual]
|
||||||
|
branch:
|
||||||
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
variables:
|
||||||
|
- &pytest_base
|
||||||
|
depends_on: []
|
||||||
|
commands:
|
||||||
|
- pip install poetry poetry-dynamic-versioning -qq
|
||||||
|
- poetry install
|
||||||
|
- poetry run pytest --cov-append
|
||||||
|
- poetry version
|
||||||
|
- poetry run ${CI_REPO_NAME} --help
|
||||||
|
environment:
|
||||||
|
PY_COLORS: "1"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: python-312
|
||||||
|
image: docker.io/library/python:3.12
|
||||||
|
<<: *pytest_base
|
||||||
|
|
||||||
|
- name: python-311
|
||||||
|
image: docker.io/library/python:3.11
|
||||||
|
<<: *pytest_base
|
||||||
|
|
||||||
|
- name: python-310
|
||||||
|
image: docker.io/library/python:3.10
|
||||||
|
<<: *pytest_base
|
||||||
|
|
||||||
|
- name: python-39
|
||||||
|
image: docker.io/library/python:3.9
|
||||||
|
<<: *pytest_base
|
||||||
|
|
||||||
|
- name: python-38
|
||||||
|
image: docker.io/library/python:3.8
|
||||||
|
<<: *pytest_base
|
@ -3,7 +3,7 @@
|
|||||||
## Security
|
## Security
|
||||||
|
|
||||||
If you think you have found a **security issue**, please do not mention it in this repository.
|
If you think you have found a **security issue**, please do not mention it in this repository.
|
||||||
Instead, send an email to security@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
|
## Bug Reports and Feature Requests
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM python:3.9-alpine@sha256:1e8728b3d791b4caa4b2569670e7fc2dcbe07f485a2349c86dcf8f3e63d9b015
|
FROM python:3.12-alpine@sha256:38e179a0f0436c97ecc76bcd378d7293ab3ee79e4b8c440fdc7113670cb6e204
|
||||||
|
|
||||||
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
|
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
|
||||||
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
|
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
|
||||||
@ -12,8 +12,7 @@ ENV TZ=UTC
|
|||||||
|
|
||||||
ADD dist/docker_tidy-*.whl /
|
ADD dist/docker_tidy-*.whl /
|
||||||
|
|
||||||
RUN \
|
RUN apk --update add --virtual .build-deps build-base libffi-dev openssl-dev && \
|
||||||
apk --update add --virtual .build-deps gcc g++ && \
|
|
||||||
pip install --upgrade --no-cache-dir pip && \
|
pip install --upgrade --no-cache-dir pip && \
|
||||||
pip install --no-cache-dir $(find / -name "docker_tidy-*.whl") && \
|
pip install --no-cache-dir $(find / -name "docker_tidy-*.whl") && \
|
||||||
apk del .build-deps && \
|
apk del .build-deps && \
|
2
LICENSE
2
LICENSE
@ -187,7 +187,7 @@
|
|||||||
same "printed page" as the copyright notice for easier
|
same "printed page" as the copyright notice for easier
|
||||||
identification within third-party archives.
|
identification within third-party archives.
|
||||||
|
|
||||||
Copyright 2021 Robert Kaussow <mail@thegeeklab.de>
|
Copyright 2022 Robert Kaussow <mail@thegeeklab.de>
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
4
Makefile
4
Makefile
@ -1,5 +1,5 @@
|
|||||||
# renovate: datasource=github-releases depName=thegeeklab/hugo-geekdoc
|
# renovate: datasource=github-releases depName=thegeeklab/hugo-geekdoc
|
||||||
THEME_VERSION := v0.16.6
|
THEME_VERSION := v1.2.1
|
||||||
THEME := hugo-geekdoc
|
THEME := hugo-geekdoc
|
||||||
BASEDIR := docs
|
BASEDIR := docs
|
||||||
THEMEDIR := $(BASEDIR)/themes
|
THEMEDIR := $(BASEDIR)/themes
|
||||||
@ -17,4 +17,4 @@ doc-assets:
|
|||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(THEMEDIR) && \
|
rm -rf $(THEMEDIR)
|
||||||
|
@ -2,12 +2,11 @@
|
|||||||
|
|
||||||
Keep docker hosts tidy
|
Keep docker hosts tidy
|
||||||
|
|
||||||
[![Build Status](https://img.shields.io/drone/build/thegeeklab/docker-tidy?logo=drone&server=https%3A%2F%2Fdrone.thegeeklab.de)](https://drone.thegeeklab.de/thegeeklab/docker-tidy)
|
[![Build Status](https://ci.thegeeklab.de/api/badges/thegeeklab/docker-tidy/status.svg)](https://ci.thegeeklab.de/repos/thegeeklab/docker-tidy)
|
||||||
[![Docker Hub](https://img.shields.io/badge/docker-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/docker-tidy)
|
[![Docker Hub](https://img.shields.io/badge/docker-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/docker-tidy)
|
||||||
[![Python Version](https://img.shields.io/pypi/pyversions/docker-tidy.svg)](https://pypi.org/project/docker-tidy/)
|
[![Python Version](https://img.shields.io/pypi/pyversions/docker-tidy.svg)](https://pypi.org/project/docker-tidy/)
|
||||||
[![PyPI Status](https://img.shields.io/pypi/status/docker-tidy.svg)](https://pypi.org/project/docker-tidy/)
|
[![PyPI Status](https://img.shields.io/pypi/status/docker-tidy.svg)](https://pypi.org/project/docker-tidy/)
|
||||||
[![PyPI Release](https://img.shields.io/pypi/v/docker-tidy.svg)](https://pypi.org/project/docker-tidy/)
|
[![PyPI Release](https://img.shields.io/pypi/v/docker-tidy.svg)](https://pypi.org/project/docker-tidy/)
|
||||||
[![Codecov](https://img.shields.io/codecov/c/github/thegeeklab/docker-tidy)](https://codecov.io/gh/thegeeklab/docker-tidy)
|
|
||||||
[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/docker-tidy)](https://github.com/thegeeklab/docker-tidy/graphs/contributors)
|
[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/docker-tidy)](https://github.com/thegeeklab/docker-tidy/graphs/contributors)
|
||||||
[![Source: GitHub](https://img.shields.io/badge/source-github-blue.svg?logo=github&logoColor=white)](https://github.com/thegeeklab/docker-tidy)
|
[![Source: GitHub](https://img.shields.io/badge/source-github-blue.svg?logo=github&logoColor=white)](https://github.com/thegeeklab/docker-tidy)
|
||||||
[![License: Apache-2.0](https://img.shields.io/github/license/thegeeklab/docker-tidy)](https://github.com/thegeeklab/docker-tidy/blob/main/LICENSE)
|
[![License: Apache-2.0](https://img.shields.io/github/license/thegeeklab/docker-tidy)](https://github.com/thegeeklab/docker-tidy/blob/main/LICENSE)
|
||||||
@ -18,7 +17,7 @@ You can find the full documentation at [https://docker-tidy.geekdocs.de](https:/
|
|||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
Special thanks goes to all [contributors](https://github.com/thegeeklab/docker-tidy/graphs/contributors). If you would like to contribute,
|
Special thanks to all [contributors](https://github.com/thegeeklab/docker-tidy/graphs/contributors). If you would like to contribute,
|
||||||
please see the [instructions](https://github.com/thegeeklab/docker-tidy/blob/main/CONTRIBUTING.md).
|
please see the [instructions](https://github.com/thegeeklab/docker-tidy/blob/main/CONTRIBUTING.md).
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
FROM arm32v7/python:3.9-alpine@sha256:4beb9f3fbab2635229fda7bbb17375e48ac0e2ead959774939b80371cc20300f
|
|
||||||
|
|
||||||
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
|
|
||||||
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
|
|
||||||
LABEL org.opencontainers.image.title="docker-tidy"
|
|
||||||
LABEL org.opencontainers.image.url="https://docker-tidy.geekdocs.de/"
|
|
||||||
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/docker-tidy"
|
|
||||||
LABEL org.opencontainers.image.documentation="https://docker-tidy.geekdocs.de/"
|
|
||||||
|
|
||||||
ENV PY_COLORS=1
|
|
||||||
ENV TZ=UTC
|
|
||||||
|
|
||||||
ADD dist/docker_tidy-*.whl /
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
apk --update add --virtual .build-deps gcc g++ && \
|
|
||||||
pip install --upgrade --no-cache-dir pip && \
|
|
||||||
pip install --no-cache-dir $(find / -name "docker_tidy-*.whl") && \
|
|
||||||
apk del .build-deps && \
|
|
||||||
rm -f docker_tidy-*.whl && \
|
|
||||||
rm -rf /var/cache/apk/* && \
|
|
||||||
rm -rf /root/.cache/ && \
|
|
||||||
rm -rf /tmp/*
|
|
||||||
|
|
||||||
USER root
|
|
||||||
CMD []
|
|
||||||
ENTRYPOINT ["/usr/local/bin/docker-tidy", "gc"]
|
|
@ -1,27 +0,0 @@
|
|||||||
FROM arm64v8/python:3.9-alpine@sha256:b527768758bafe82c3509e9c7b66094c1eb202e9d91047f59c577dce35899e9a
|
|
||||||
|
|
||||||
LABEL maintainer="Robert Kaussow <mail@thegeeklab.de>"
|
|
||||||
LABEL org.opencontainers.image.authors="Robert Kaussow <mail@thegeeklab.de>"
|
|
||||||
LABEL org.opencontainers.image.title="docker-tidy"
|
|
||||||
LABEL org.opencontainers.image.url="https://docker-tidy.geekdocs.de/"
|
|
||||||
LABEL org.opencontainers.image.source="https://github.com/thegeeklab/docker-tidy"
|
|
||||||
LABEL org.opencontainers.image.documentation="https://docker-tidy.geekdocs.de/"
|
|
||||||
|
|
||||||
ENV PY_COLORS=1
|
|
||||||
ENV TZ=UTC
|
|
||||||
|
|
||||||
ADD dist/docker_tidy-*.whl /
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
apk --update add --virtual .build-deps gcc g++ && \
|
|
||||||
pip install --upgrade --no-cache-dir pip && \
|
|
||||||
pip install --no-cache-dir $(find / -name "docker_tidy-*.whl") && \
|
|
||||||
apk del .build-deps && \
|
|
||||||
rm -f docker_tidy-*.whl && \
|
|
||||||
rm -rf /var/cache/apk/* && \
|
|
||||||
rm -rf /root/.cache/ && \
|
|
||||||
rm -rf /tmp/*
|
|
||||||
|
|
||||||
USER root
|
|
||||||
CMD []
|
|
||||||
ENTRYPOINT ["/usr/local/bin/docker-tidy", "gc"]
|
|
@ -1,24 +0,0 @@
|
|||||||
image: quay.io/thegeeklab/docker-tidy:{{#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/docker-tidy:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}amd64
|
|
||||||
platform:
|
|
||||||
architecture: amd64
|
|
||||||
os: linux
|
|
||||||
|
|
||||||
- image: quay.io/thegeeklab/docker-tidy:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm64
|
|
||||||
platform:
|
|
||||||
architecture: arm64
|
|
||||||
os: linux
|
|
||||||
variant: v8
|
|
||||||
|
|
||||||
- image: quay.io/thegeeklab/docker-tidy:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm
|
|
||||||
platform:
|
|
||||||
architecture: arm
|
|
||||||
os: linux
|
|
||||||
variant: v7
|
|
@ -1,24 +0,0 @@
|
|||||||
image: thegeeklab/docker-tidy:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
|
|
||||||
{{#if build.tags}}
|
|
||||||
tags:
|
|
||||||
{{#each build.tags}}
|
|
||||||
- {{this}}
|
|
||||||
{{/each}}
|
|
||||||
{{/if}}
|
|
||||||
manifests:
|
|
||||||
- image: thegeeklab/docker-tidy:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}amd64
|
|
||||||
platform:
|
|
||||||
architecture: amd64
|
|
||||||
os: linux
|
|
||||||
|
|
||||||
- image: thegeeklab/docker-tidy:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm64
|
|
||||||
platform:
|
|
||||||
architecture: arm64
|
|
||||||
os: linux
|
|
||||||
variant: v8
|
|
||||||
|
|
||||||
- image: thegeeklab/docker-tidy:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}arm
|
|
||||||
platform:
|
|
||||||
architecture: arm
|
|
||||||
os: linux
|
|
||||||
variant: v7
|
|
@ -2,10 +2,10 @@
|
|||||||
"""Stop long running docker iamges."""
|
"""Stop long running docker iamges."""
|
||||||
|
|
||||||
import dateutil.parser
|
import dateutil.parser
|
||||||
|
import docker
|
||||||
import docker.errors
|
import docker.errors
|
||||||
import requests.exceptions
|
import requests.exceptions
|
||||||
|
|
||||||
import docker
|
|
||||||
from dockertidy.config import SingleConfig
|
from dockertidy.config import SingleConfig
|
||||||
from dockertidy.logger import SingleLog
|
from dockertidy.logger import SingleLog
|
||||||
from dockertidy.parser import timedelta
|
from dockertidy.parser import timedelta
|
||||||
@ -45,9 +45,7 @@ class AutoStop:
|
|||||||
) or (not prefix and self._has_been_running_since(container, max_run_time)):
|
) or (not prefix and self._has_been_running_since(container, max_run_time)):
|
||||||
self.logger.info(
|
self.logger.info(
|
||||||
"Stopping container {id} {name}: running since {started}".format(
|
"Stopping container {id} {name}: running since {started}".format(
|
||||||
id=container["Id"][:16],
|
id=container["Id"][:16], name=name, started=container["State"]["StartedAt"]
|
||||||
name=name,
|
|
||||||
started=container["State"]["StartedAt"]
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -58,12 +56,11 @@ class AutoStop:
|
|||||||
try:
|
try:
|
||||||
client.stop(cid)
|
client.stop(cid)
|
||||||
except requests.exceptions.Timeout as e:
|
except requests.exceptions.Timeout as e:
|
||||||
self.logger.warn("Failed to stop container {id}: {msg}".format(id=cid, msg=str(e)))
|
self.logger.warning(f"Failed to stop container {cid}: {e!s}")
|
||||||
except docker.errors.APIError as e:
|
except docker.errors.APIError as e:
|
||||||
self.logger.warn("Error stopping {id}: {msg}".format(id=cid, msg=str(e)))
|
self.logger.warning(f"Error stopping {cid}: {e!s}")
|
||||||
|
|
||||||
def _build_container_matcher(self, prefixes):
|
def _build_container_matcher(self, prefixes):
|
||||||
|
|
||||||
def matcher(name):
|
def matcher(name):
|
||||||
return any(name.startswith(prefix) for prefix in prefixes)
|
return any(name.startswith(prefix) for prefix in prefixes)
|
||||||
|
|
||||||
@ -89,4 +86,4 @@ class AutoStop:
|
|||||||
self.stop_containers()
|
self.stop_containers()
|
||||||
|
|
||||||
if not config["stop"]["max_run_time"]:
|
if not config["stop"]["max_run_time"]:
|
||||||
self.logger.warn("Skipped, no arguments given")
|
self.logger.warning("Skipped, no arguments given")
|
||||||
|
@ -36,7 +36,7 @@ class DockerTidy:
|
|||||||
action="store_true",
|
action="store_true",
|
||||||
default=None,
|
default=None,
|
||||||
dest="dry_run",
|
dest="dry_run",
|
||||||
help="only log actions, don't stop anything"
|
help="only log actions, don't stop anything",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-t",
|
"-t",
|
||||||
@ -44,7 +44,7 @@ class DockerTidy:
|
|||||||
type=int,
|
type=int,
|
||||||
dest="http_timeout",
|
dest="http_timeout",
|
||||||
metavar="HTTP_TIMEOUT",
|
metavar="HTTP_TIMEOUT",
|
||||||
help="HTTP timeout in seconds for making docker API calls"
|
help="HTTP timeout in seconds for making docker API calls",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-v", dest="logging.level", action="append_const", const=-1, help="increase log level"
|
"-v", dest="logging.level", action="append_const", const=-1, help="increase log level"
|
||||||
@ -52,9 +52,7 @@ class DockerTidy:
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-q", dest="logging.level", action="append_const", const=1, help="decrease log level"
|
"-q", dest="logging.level", action="append_const", const=1, help="decrease log level"
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument("--version", action="version", version=f"%(prog)s {__version__}")
|
||||||
"--version", action="version", version="%(prog)s {}".format(__version__)
|
|
||||||
)
|
|
||||||
|
|
||||||
subparsers = parser.add_subparsers(dest="command", help="sub-command help")
|
subparsers = parser.add_subparsers(dest="command", help="sub-command help")
|
||||||
subparsers.required = True
|
subparsers.required = True
|
||||||
@ -66,7 +64,7 @@ class DockerTidy:
|
|||||||
dest="gc.max_container_age",
|
dest="gc.max_container_age",
|
||||||
metavar="MAX_CONTAINER_AGE",
|
metavar="MAX_CONTAINER_AGE",
|
||||||
help="maximum age for a container, containers older than this age "
|
help="maximum age for a container, containers older than this age "
|
||||||
"will be removed (dateparser value)"
|
"will be removed (dateparser value)",
|
||||||
)
|
)
|
||||||
parser_gc.add_argument(
|
parser_gc.add_argument(
|
||||||
"--max-image-age",
|
"--max-image-age",
|
||||||
@ -74,13 +72,13 @@ class DockerTidy:
|
|||||||
dest="gc.max_image_age",
|
dest="gc.max_image_age",
|
||||||
metavar="MAX_IMAGE_AGE",
|
metavar="MAX_IMAGE_AGE",
|
||||||
help="maxium age for an image, images older than this age will be "
|
help="maxium age for an image, images older than this age will be "
|
||||||
"removed (dateparser value)"
|
"removed (dateparser value)",
|
||||||
)
|
)
|
||||||
parser_gc.add_argument(
|
parser_gc.add_argument(
|
||||||
"--dangling-volumes",
|
"--dangling-volumes",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
dest="gc.dangling_volumes",
|
dest="gc.dangling_volumes",
|
||||||
help="dangling volumes will be removed"
|
help="dangling volumes will be removed",
|
||||||
)
|
)
|
||||||
parser_gc.add_argument(
|
parser_gc.add_argument(
|
||||||
"--exclude-image",
|
"--exclude-image",
|
||||||
@ -88,7 +86,7 @@ class DockerTidy:
|
|||||||
type=str,
|
type=str,
|
||||||
dest="gc.exclude_images",
|
dest="gc.exclude_images",
|
||||||
metavar="EXCLUDE_IMAGE",
|
metavar="EXCLUDE_IMAGE",
|
||||||
help="never remove images with this tag"
|
help="never remove images with this tag",
|
||||||
)
|
)
|
||||||
parser_gc.add_argument(
|
parser_gc.add_argument(
|
||||||
"--exclude-container-label",
|
"--exclude-container-label",
|
||||||
@ -96,8 +94,7 @@ class DockerTidy:
|
|||||||
type=str,
|
type=str,
|
||||||
dest="gc.exclude_container_labels",
|
dest="gc.exclude_container_labels",
|
||||||
metavar="EXCLUDE_CONTAINER_LABEL",
|
metavar="EXCLUDE_CONTAINER_LABEL",
|
||||||
help="never remove containers with this label key "
|
help="never remove containers with this label key or label key=value",
|
||||||
"or label key=value"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
parser_stop = subparsers.add_parser(
|
parser_stop = subparsers.add_parser(
|
||||||
@ -108,7 +105,7 @@ class DockerTidy:
|
|||||||
type=timedelta_validator,
|
type=timedelta_validator,
|
||||||
dest="stop.max_run_time",
|
dest="stop.max_run_time",
|
||||||
metavar="MAX_RUN_TIME",
|
metavar="MAX_RUN_TIME",
|
||||||
help="maximum time a container is allows to run (dateparser value)"
|
help="maximum time a container is allows to run (dateparser value)",
|
||||||
)
|
)
|
||||||
parser_stop.add_argument(
|
parser_stop.add_argument(
|
||||||
"--prefix",
|
"--prefix",
|
||||||
@ -116,7 +113,7 @@ class DockerTidy:
|
|||||||
type=str,
|
type=str,
|
||||||
dest="stop.prefix",
|
dest="stop.prefix",
|
||||||
metavar="PREFIX",
|
metavar="PREFIX",
|
||||||
help="only stop containers which match one of the prefix"
|
help="only stop containers which match one of the prefix",
|
||||||
)
|
)
|
||||||
|
|
||||||
return parser.parse_args().__dict__
|
return parser.parse_args().__dict__
|
||||||
@ -130,10 +127,10 @@ class DockerTidy:
|
|||||||
try:
|
try:
|
||||||
self.log.set_level(config.config["logging"]["level"])
|
self.log.set_level(config.config["logging"]["level"])
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
self.log.sysexit_with_message("Can not set log level.\n{}".format(str(e)))
|
self.log.sysexit_with_message(f"Can not set log level.\n{e!s}")
|
||||||
|
|
||||||
self.logger.info("Using config file {}".format(config.config_file))
|
self.logger.info(f"Using config file {config.config_file}")
|
||||||
self.logger.debug("Config dump: {}".format(config.config))
|
self.logger.debug(f"Config dump: {config.config}")
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
@ -13,15 +13,15 @@ from jsonschema._utils import format_as_index
|
|||||||
import dockertidy.exception
|
import dockertidy.exception
|
||||||
import dockertidy.parser
|
import dockertidy.parser
|
||||||
from dockertidy.parser import env
|
from dockertidy.parser import env
|
||||||
from dockertidy.utils import Singleton
|
from dockertidy.utils import Singleton, dict_intersect
|
||||||
from dockertidy.utils import dict_intersect
|
|
||||||
|
|
||||||
config_dir = AppDirs("docker-tidy").user_config_dir
|
config_dir = AppDirs("docker-tidy").user_config_dir
|
||||||
default_config_file = os.path.join(config_dir, "config.yml")
|
default_config_file = os.path.join(config_dir, "config.yml")
|
||||||
|
|
||||||
|
|
||||||
class Config():
|
class Config:
|
||||||
"""Create an object with all necessary settings.
|
"""
|
||||||
|
Create an object with all necessary settings.
|
||||||
|
|
||||||
Settings are loade from multiple locations in defined order (last wins):
|
Settings are loade from multiple locations in defined order (last wins):
|
||||||
- default settings defined by `self._get_defaults()`
|
- default settings defined by `self._get_defaults()`
|
||||||
@ -36,77 +36,77 @@ class Config():
|
|||||||
"config_file": {
|
"config_file": {
|
||||||
"default": "",
|
"default": "",
|
||||||
"env": "CONFIG_FILE",
|
"env": "CONFIG_FILE",
|
||||||
"type": environs.Env().str
|
"type": environs.Env().str,
|
||||||
},
|
},
|
||||||
"dry_run": {
|
"dry_run": {
|
||||||
"default": False,
|
"default": False,
|
||||||
"env": "DRY_RUN",
|
"env": "DRY_RUN",
|
||||||
"file": True,
|
"file": True,
|
||||||
"type": environs.Env().bool
|
"type": environs.Env().bool,
|
||||||
},
|
},
|
||||||
"http_timeout": {
|
"http_timeout": {
|
||||||
"default": 60,
|
"default": 60,
|
||||||
"env": "HTTP_TIMEOUT",
|
"env": "HTTP_TIMEOUT",
|
||||||
"file": True,
|
"file": True,
|
||||||
"type": environs.Env().int
|
"type": environs.Env().int,
|
||||||
},
|
},
|
||||||
"logging.level": {
|
"logging.level": {
|
||||||
"default": "WARNING",
|
"default": "WARNING",
|
||||||
"env": "LOG_LEVEL",
|
"env": "LOG_LEVEL",
|
||||||
"file": True,
|
"file": True,
|
||||||
"type": environs.Env().str
|
"type": environs.Env().str,
|
||||||
},
|
},
|
||||||
"logging.json": {
|
"logging.json": {
|
||||||
"default": False,
|
"default": False,
|
||||||
"env": "LOG_JSON",
|
"env": "LOG_JSON",
|
||||||
"file": True,
|
"file": True,
|
||||||
"type": environs.Env().bool
|
"type": environs.Env().bool,
|
||||||
},
|
},
|
||||||
"gc.max_container_age": {
|
"gc.max_container_age": {
|
||||||
"default": "",
|
"default": "",
|
||||||
"env": "GC_MAX_CONTAINER_AGE",
|
"env": "GC_MAX_CONTAINER_AGE",
|
||||||
"file": True,
|
"file": True,
|
||||||
"type": env.timedelta_validator
|
"type": env.timedelta_validator,
|
||||||
},
|
},
|
||||||
"gc.max_image_age": {
|
"gc.max_image_age": {
|
||||||
"default": "",
|
"default": "",
|
||||||
"env": "GC_MAX_IMAGE_AGE",
|
"env": "GC_MAX_IMAGE_AGE",
|
||||||
"file": True,
|
"file": True,
|
||||||
"type": env.timedelta_validator
|
"type": env.timedelta_validator,
|
||||||
},
|
},
|
||||||
"gc.dangling_volumes": {
|
"gc.dangling_volumes": {
|
||||||
"default": False,
|
"default": False,
|
||||||
"env": "GC_DANGLING_VOLUMES",
|
"env": "GC_DANGLING_VOLUMES",
|
||||||
"file": True,
|
"file": True,
|
||||||
"type": environs.Env().bool
|
"type": environs.Env().bool,
|
||||||
},
|
},
|
||||||
"gc.exclude_images": {
|
"gc.exclude_images": {
|
||||||
"default": [],
|
"default": [],
|
||||||
"env": "GC_EXCLUDE_IMAGES",
|
"env": "GC_EXCLUDE_IMAGES",
|
||||||
"file": True,
|
"file": True,
|
||||||
"type": environs.Env().list
|
"type": environs.Env().list,
|
||||||
},
|
},
|
||||||
"gc.exclude_container_labels": {
|
"gc.exclude_container_labels": {
|
||||||
"default": [],
|
"default": [],
|
||||||
"env": "GC_EXCLUDE_CONTAINER_LABELS",
|
"env": "GC_EXCLUDE_CONTAINER_LABELS",
|
||||||
"file": True,
|
"file": True,
|
||||||
"type": environs.Env().list
|
"type": environs.Env().list,
|
||||||
},
|
},
|
||||||
"stop.max_run_time": {
|
"stop.max_run_time": {
|
||||||
"default": "",
|
"default": "",
|
||||||
"env": "STOP_MAX_RUN_TIME",
|
"env": "STOP_MAX_RUN_TIME",
|
||||||
"file": True,
|
"file": True,
|
||||||
"type": env.timedelta_validator
|
"type": env.timedelta_validator,
|
||||||
},
|
},
|
||||||
"stop.prefix": {
|
"stop.prefix": {
|
||||||
"default": [],
|
"default": [],
|
||||||
"env": "STOP_PREFIX",
|
"env": "STOP_PREFIX",
|
||||||
"file": True,
|
"file": True,
|
||||||
"type": environs.Env().list
|
"type": environs.Env().list,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, args={}):
|
def __init__(self, args=None):
|
||||||
"""
|
"""
|
||||||
Initialize a new settings class.
|
Initialize a new settings class.
|
||||||
|
|
||||||
@ -115,7 +115,10 @@ class Config():
|
|||||||
:returns: None
|
:returns: None
|
||||||
|
|
||||||
"""
|
"""
|
||||||
self._args = args
|
if args is None:
|
||||||
|
self._args = {}
|
||||||
|
else:
|
||||||
|
self._args = args
|
||||||
self._schema = None
|
self._schema = None
|
||||||
self.config_file = default_config_file
|
self.config_file = default_config_file
|
||||||
self.config = None
|
self.config = None
|
||||||
@ -159,12 +162,12 @@ class Config():
|
|||||||
value = item["type"](envname)
|
value = item["type"](envname)
|
||||||
normalized = self._add_dict_branch(normalized, key.split("."), value)
|
normalized = self._add_dict_branch(normalized, key.split("."), value)
|
||||||
except environs.EnvError as e:
|
except environs.EnvError as e:
|
||||||
if '"{}" not set'.format(envname) in str(e):
|
if f'"{envname}" not set' in str(e):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
raise dockertidy.exception.ConfigError(
|
raise dockertidy.exception.ConfigError(
|
||||||
"Unable to read environment variable", str(e)
|
"Unable to read environment variable", str(e)
|
||||||
)
|
) from e
|
||||||
|
|
||||||
return normalized
|
return normalized
|
||||||
|
|
||||||
@ -188,15 +191,15 @@ class Config():
|
|||||||
source_files.append(os.path.join(os.getcwd(), ".dockertidy.yaml"))
|
source_files.append(os.path.join(os.getcwd(), ".dockertidy.yaml"))
|
||||||
|
|
||||||
for config in [i for i in source_files if os.path.exists(i)]:
|
for config in [i for i in source_files if os.path.exists(i)]:
|
||||||
with open(config, "r", encoding="utf8") as stream:
|
with open(config, encoding="utf8") as stream:
|
||||||
s = stream.read()
|
s = stream.read()
|
||||||
try:
|
try:
|
||||||
normalized = ruamel.yaml.safe_load(s)
|
normalized = ruamel.yaml.YAML(typ="safe", pure=True).load(s)
|
||||||
except (ruamel.yaml.composer.ComposerError, ruamel.yaml.scanner.ScannerError) as e:
|
except (ruamel.yaml.composer.ComposerError, ruamel.yaml.scanner.ScannerError) as e:
|
||||||
message = "{} {}".format(e.context, e.problem)
|
message = f"{e.context} {e.problem}"
|
||||||
raise dockertidy.exception.ConfigError(
|
raise dockertidy.exception.ConfigError(
|
||||||
"Unable to read config file {}".format(config), message
|
f"Unable to read config file {config}", message
|
||||||
)
|
) from e
|
||||||
|
|
||||||
if self._validate(normalized):
|
if self._validate(normalized):
|
||||||
anyconfig.merge(files_raw, normalized, ac_merge=anyconfig.MS_DICTS)
|
anyconfig.merge(files_raw, normalized, ac_merge=anyconfig.MS_DICTS)
|
||||||
@ -224,27 +227,26 @@ class Config():
|
|||||||
if not os.path.isabs(path):
|
if not os.path.isabs(path):
|
||||||
base = os.path.join(os.getcwd(), path)
|
base = os.path.join(os.getcwd(), path)
|
||||||
return os.path.abspath(os.path.expanduser(os.path.expandvars(base)))
|
return os.path.abspath(os.path.expanduser(os.path.expandvars(base)))
|
||||||
else:
|
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def _validate(self, config):
|
def _validate(self, config):
|
||||||
try:
|
try:
|
||||||
anyconfig.validate(config, self.schema, ac_schema_safe=False)
|
anyconfig.validate(config, self.schema, ac_schema_safe=False)
|
||||||
except jsonschema.exceptions.ValidationError as e:
|
except jsonschema.exceptions.ValidationError as e:
|
||||||
schema_error = "Failed validating '{validator}' in schema{schema}\n{message}".format(
|
schema = format_as_index(list(e.relative_schema_path)[:-1])
|
||||||
validator=e.validator,
|
schema_error = f"Failed validating '{e.validator}' in schema {schema}\n{e.message}"
|
||||||
schema=format_as_index(list(e.relative_schema_path)[:-1]),
|
raise dockertidy.exception.ConfigError("Configuration error", schema_error) from e
|
||||||
message=e.message
|
|
||||||
)
|
|
||||||
raise dockertidy.exception.ConfigError("Configuration error", schema_error)
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _add_dict_branch(self, tree, vector, value):
|
def _add_dict_branch(self, tree, vector, value):
|
||||||
key = vector[0]
|
key = vector[0]
|
||||||
tree[key] = value \
|
tree[key] = (
|
||||||
if len(vector) == 1 \
|
value
|
||||||
else self._add_dict_branch(tree[key] if key in tree else {}, vector[1:], value)
|
if len(vector) == 1
|
||||||
|
else self._add_dict_branch(tree.get(key, {}), vector[1:], value)
|
||||||
|
)
|
||||||
return tree
|
return tree
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ class TidyError(Exception):
|
|||||||
"""Generic exception class for docker-tidy."""
|
"""Generic exception class for docker-tidy."""
|
||||||
|
|
||||||
def __init__(self, msg, original_exception=""):
|
def __init__(self, msg, original_exception=""):
|
||||||
super(TidyError, self).__init__("{msg}\n{org}".format(msg=msg, org=original_exception))
|
super().__init__(f"{msg}\n{original_exception}")
|
||||||
self.original_exception = original_exception
|
self.original_exception = original_exception
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,10 +5,10 @@ import fnmatch
|
|||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
import dateutil.parser
|
import dateutil.parser
|
||||||
|
import docker
|
||||||
import docker.errors
|
import docker.errors
|
||||||
import requests.exceptions
|
import requests.exceptions
|
||||||
|
|
||||||
import docker
|
|
||||||
from dockertidy.config import SingleConfig
|
from dockertidy.config import SingleConfig
|
||||||
from dockertidy.logger import SingleLog
|
from dockertidy.logger import SingleLog
|
||||||
from dockertidy.parser import timedelta
|
from dockertidy.parser import timedelta
|
||||||
@ -55,7 +55,8 @@ class GarbageCollector:
|
|||||||
self.logger.info(
|
self.logger.info(
|
||||||
"Removing container {} {} {}".format(
|
"Removing container {} {} {}".format(
|
||||||
container["Id"][:16],
|
container["Id"][:16],
|
||||||
container.get("Name", "").lstrip("/"), container["State"]["FinishedAt"]
|
container.get("Name", "").lstrip("/"),
|
||||||
|
container["State"]["FinishedAt"],
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -73,9 +74,7 @@ class GarbageCollector:
|
|||||||
return containers
|
return containers
|
||||||
|
|
||||||
def include_container(container):
|
def include_container(container):
|
||||||
if self._should_exclude_container_with_labels(container):
|
return not self._should_exclude_container_with_labels(container)
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
return filter(include_container, containers)
|
return filter(include_container, containers)
|
||||||
|
|
||||||
@ -163,7 +162,6 @@ class GarbageCollector:
|
|||||||
self._remove_image(image_summary, timedelta(config["gc"]["max_image_age"]))
|
self._remove_image(image_summary, timedelta(config["gc"]["max_image_age"]))
|
||||||
|
|
||||||
def _filter_excluded_images(self, images, exclude_set):
|
def _filter_excluded_images(self, images, exclude_set):
|
||||||
|
|
||||||
def include_image(image_summary):
|
def include_image(image_summary):
|
||||||
image_tags = image_summary.get("RepoTags")
|
image_tags = image_summary.get("RepoTags")
|
||||||
if self._no_image_tags(image_tags):
|
if self._no_image_tags(image_tags):
|
||||||
@ -176,12 +174,11 @@ class GarbageCollector:
|
|||||||
return filter(include_image, images)
|
return filter(include_image, images)
|
||||||
|
|
||||||
def _filter_images_in_use(self, images, image_tags_in_use):
|
def _filter_images_in_use(self, images, image_tags_in_use):
|
||||||
|
|
||||||
def get_tag_set(image_summary):
|
def get_tag_set(image_summary):
|
||||||
image_tags = image_summary.get("RepoTags")
|
image_tags = image_summary.get("RepoTags")
|
||||||
if self._no_image_tags(image_tags):
|
if self._no_image_tags(image_tags):
|
||||||
# The repr of the image Id used by client.containers()
|
# The repr of the image Id used by client.containers()
|
||||||
return set(["{id}:latest".format(id=image_summary["Id"][:12])])
|
return {"{id}:latest".format(id=image_summary["Id"][:12])}
|
||||||
return set(image_tags)
|
return set(image_tags)
|
||||||
|
|
||||||
def image_not_in_use(image_summary):
|
def image_not_in_use(image_summary):
|
||||||
@ -190,7 +187,6 @@ class GarbageCollector:
|
|||||||
return filter(image_not_in_use, images)
|
return filter(image_not_in_use, images)
|
||||||
|
|
||||||
def _filter_images_in_use_by_id(self, images, image_ids_in_use):
|
def _filter_images_in_use_by_id(self, images, image_ids_in_use):
|
||||||
|
|
||||||
def image_not_in_use(image_summary):
|
def image_not_in_use(image_summary):
|
||||||
return image_summary["Id"] not in image_ids_in_use
|
return image_summary["Id"] not in image_ids_in_use
|
||||||
|
|
||||||
@ -210,9 +206,7 @@ class GarbageCollector:
|
|||||||
if not image or not self._is_image_old(image, min_date):
|
if not image or not self._is_image_old(image, min_date):
|
||||||
return
|
return
|
||||||
|
|
||||||
self.logger.info(
|
self.logger.info(f"Removing image {self._format_image(image, image_summary)}")
|
||||||
"Removing image {name}".format(name=self._format_image(image, image_summary))
|
|
||||||
)
|
|
||||||
if config["dry_run"]:
|
if config["dry_run"]:
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -251,22 +245,13 @@ class GarbageCollector:
|
|||||||
try:
|
try:
|
||||||
return func(**kwargs)
|
return func(**kwargs)
|
||||||
except requests.exceptions.Timeout as e:
|
except requests.exceptions.Timeout as e:
|
||||||
params = ",".join("%s=%s" % item for item in kwargs.items()) # noqa
|
params = ",".join("%s=%s" % item for item in kwargs.items()) # noqa:UP031
|
||||||
self.logger.warn(
|
self.logger.warning(f"Failed to call {func.__name__} {params} {e!s}")
|
||||||
"Failed to call {name} {params} {msg}".format(
|
|
||||||
name=func.__name__, params=params, msg=str(e)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
except docker.errors.APIError as e:
|
except docker.errors.APIError as e:
|
||||||
params = ",".join("%s=%s" % item for item in kwargs.items()) # noqa
|
params = ",".join("%s=%s" % item for item in kwargs.items()) # noqa:UP031
|
||||||
self.logger.warn(
|
self.logger.warning(f"Error calling {func.__name__} {params} {e!s}")
|
||||||
"Error calling {name} {params} {msg}".format(
|
|
||||||
name=func.__name__, params=params, msg=str(e)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
def _format_image(self, image, image_summary):
|
def _format_image(self, image, image_summary):
|
||||||
|
|
||||||
def get_tags():
|
def get_tags():
|
||||||
tags = image_summary.get("RepoTags")
|
tags = image_summary.get("RepoTags")
|
||||||
if not tags or tags == ["<none>:<none>"]:
|
if not tags or tags == ["<none>:<none>"]:
|
||||||
@ -277,12 +262,11 @@ class GarbageCollector:
|
|||||||
|
|
||||||
def _build_exclude_set(self):
|
def _build_exclude_set(self):
|
||||||
config = self.config.config
|
config = self.config.config
|
||||||
exclude_set = set(config["gc"]["exclude_images"])
|
|
||||||
|
|
||||||
def is_image_tag(line):
|
def is_image_tag(line):
|
||||||
return line and not line.startswith("#")
|
return line and not line.startswith("#")
|
||||||
|
|
||||||
return exclude_set
|
return set(config["gc"]["exclude_images"])
|
||||||
|
|
||||||
def _format_exclude_labels(self):
|
def _format_exclude_labels(self):
|
||||||
config = self.config.config
|
config = self.config.config
|
||||||
@ -291,10 +275,7 @@ class GarbageCollector:
|
|||||||
for exclude_label_arg in config["gc"]["exclude_container_labels"]:
|
for exclude_label_arg in config["gc"]["exclude_container_labels"]:
|
||||||
split_exclude_label = exclude_label_arg.split("=", 1)
|
split_exclude_label = exclude_label_arg.split("=", 1)
|
||||||
exclude_label_key = split_exclude_label[0]
|
exclude_label_key = split_exclude_label[0]
|
||||||
if len(split_exclude_label) == 2:
|
exclude_label_value = split_exclude_label[1] if len(split_exclude_label) == 2 else None
|
||||||
exclude_label_value = split_exclude_label[1]
|
|
||||||
else:
|
|
||||||
exclude_label_value = None
|
|
||||||
exclude_labels.append(
|
exclude_labels.append(
|
||||||
self.ExcludeLabel(
|
self.ExcludeLabel(
|
||||||
key=exclude_label_key,
|
key=exclude_label_key,
|
||||||
@ -308,7 +289,7 @@ class GarbageCollector:
|
|||||||
try:
|
try:
|
||||||
return docker.APIClient(version="auto", timeout=config["http_timeout"])
|
return docker.APIClient(version="auto", timeout=config["http_timeout"])
|
||||||
except docker.errors.DockerException as e:
|
except docker.errors.DockerException as e:
|
||||||
self.log.sysexit_with_message("Can't create docker client\n{}".format(e))
|
self.log.sysexit_with_message(f"Can't create docker client\n{e}")
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""Garbage collector main method."""
|
"""Garbage collector main method."""
|
||||||
@ -327,7 +308,8 @@ class GarbageCollector:
|
|||||||
self.cleanup_volumes()
|
self.cleanup_volumes()
|
||||||
|
|
||||||
if (
|
if (
|
||||||
not config["gc"]["max_container_age"] and not config["gc"]["max_image_age"]
|
not config["gc"]["max_container_age"]
|
||||||
|
and not config["gc"]["max_image_age"]
|
||||||
and not config["gc"]["dangling_volumes"]
|
and not config["gc"]["dangling_volumes"]
|
||||||
):
|
):
|
||||||
self.logger.warn("Skipped, no arguments given")
|
self.logger.ing("Skipped, no arguments given")
|
||||||
|
@ -8,11 +8,10 @@ import sys
|
|||||||
import colorama
|
import colorama
|
||||||
from pythonjsonlogger import jsonlogger
|
from pythonjsonlogger import jsonlogger
|
||||||
|
|
||||||
from dockertidy.utils import Singleton
|
from dockertidy.utils import Singleton, to_bool
|
||||||
from dockertidy.utils import to_bool
|
|
||||||
|
|
||||||
CONSOLE_FORMAT = "{}[%(levelname)s]{} %(message)s"
|
CONSOLE_FORMAT = "{}[%(levelname)s]{} %(message)s"
|
||||||
JSON_FORMAT = "(asctime) (levelname) (message)"
|
JSON_FORMAT = "%(asctime)s %(levelname)s %(message)s"
|
||||||
|
|
||||||
|
|
||||||
def _should_do_markup():
|
def _should_do_markup():
|
||||||
@ -26,7 +25,7 @@ def _should_do_markup():
|
|||||||
colorama.init(autoreset=True, strip=not _should_do_markup())
|
colorama.init(autoreset=True, strip=not _should_do_markup())
|
||||||
|
|
||||||
|
|
||||||
class LogFilter(object):
|
class LogFilter:
|
||||||
"""A custom log filter which excludes log messages above the logged level."""
|
"""A custom log filter which excludes log messages above the logged level."""
|
||||||
|
|
||||||
def __init__(self, level):
|
def __init__(self, level):
|
||||||
@ -47,15 +46,15 @@ class LogFilter(object):
|
|||||||
class MultilineFormatter(logging.Formatter):
|
class MultilineFormatter(logging.Formatter):
|
||||||
"""Logging Formatter to reset color after newline characters."""
|
"""Logging Formatter to reset color after newline characters."""
|
||||||
|
|
||||||
def format(self, record): # noqa
|
def format(self, record):
|
||||||
record.msg = record.msg.replace("\n", "\n{}... ".format(colorama.Style.RESET_ALL))
|
record.msg = record.msg.replace("\n", f"\n{colorama.Style.RESET_ALL}... ")
|
||||||
return logging.Formatter.format(self, record)
|
return logging.Formatter.format(self, record)
|
||||||
|
|
||||||
|
|
||||||
class MultilineJsonFormatter(jsonlogger.JsonFormatter):
|
class MultilineJsonFormatter(jsonlogger.JsonFormatter):
|
||||||
"""Logging Formatter to remove newline characters."""
|
"""Logging Formatter to remove newline characters."""
|
||||||
|
|
||||||
def format(self, record): # noqa
|
def format(self, record):
|
||||||
record.msg = record.msg.replace("\n", " ")
|
record.msg = record.msg.replace("\n", " ")
|
||||||
return jsonlogger.JsonFormatter.format(self, record)
|
return jsonlogger.JsonFormatter.format(self, record)
|
||||||
|
|
||||||
@ -63,11 +62,11 @@ class MultilineJsonFormatter(jsonlogger.JsonFormatter):
|
|||||||
class Log:
|
class Log:
|
||||||
"""Base logging object."""
|
"""Base logging object."""
|
||||||
|
|
||||||
def __init__(self, level=logging.WARN, name="dockertidy", json=False):
|
def __init__(self, level=logging.WARNING, name="dockertidy", json=False):
|
||||||
self.logger = logging.getLogger(name)
|
self.logger = logging.getLogger(name)
|
||||||
self.logger.setLevel(level)
|
self.logger.setLevel(level)
|
||||||
self.logger.addHandler(self._get_error_handler(json=json))
|
self.logger.addHandler(self._get_error_handler(json=json))
|
||||||
self.logger.addHandler(self._get_warn_handler(json=json))
|
self.logger.addHandler(self._get_warning_handler(json=json))
|
||||||
self.logger.addHandler(self._get_info_handler(json=json))
|
self.logger.addHandler(self._get_info_handler(json=json))
|
||||||
self.logger.addHandler(self._get_critical_handler(json=json))
|
self.logger.addHandler(self._get_critical_handler(json=json))
|
||||||
self.logger.addHandler(self._get_debug_handler(json=json))
|
self.logger.addHandler(self._get_debug_handler(json=json))
|
||||||
@ -88,13 +87,13 @@ class Log:
|
|||||||
|
|
||||||
return handler
|
return handler
|
||||||
|
|
||||||
def _get_warn_handler(self, json=False):
|
def _get_warning_handler(self, json=False):
|
||||||
handler = logging.StreamHandler(sys.stdout)
|
handler = logging.StreamHandler(sys.stdout)
|
||||||
handler.setLevel(logging.WARN)
|
handler.setLevel(logging.WARNING)
|
||||||
handler.addFilter(LogFilter(logging.WARN))
|
handler.addFilter(LogFilter(logging.WARNING))
|
||||||
handler.setFormatter(
|
handler.setFormatter(
|
||||||
MultilineFormatter(
|
MultilineFormatter(
|
||||||
self.warn(CONSOLE_FORMAT.format(colorama.Fore.YELLOW, colorama.Style.RESET_ALL))
|
self.warning(CONSOLE_FORMAT.format(colorama.Fore.YELLOW, colorama.Style.RESET_ALL))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -164,8 +163,8 @@ class Log:
|
|||||||
"""Format error messages and return string."""
|
"""Format error messages and return string."""
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
def warn(self, msg):
|
def warning(self, msg):
|
||||||
"""Format warn messages and return string."""
|
"""Format warning messages and return string."""
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
def info(self, msg):
|
def info(self, msg):
|
||||||
@ -181,7 +180,7 @@ class Log:
|
|||||||
:returns: string
|
:returns: string
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return "{}{}{}".format(color, msg, colorama.Style.RESET_ALL)
|
return f"{color}{msg}{colorama.Style.RESET_ALL}"
|
||||||
|
|
||||||
def sysexit(self, code=1):
|
def sysexit(self, code=1):
|
||||||
"""Exit running program with given exit code."""
|
"""Exit running program with given exit code."""
|
||||||
|
@ -10,7 +10,8 @@ env = environs.Env()
|
|||||||
|
|
||||||
|
|
||||||
def timedelta_validator(value):
|
def timedelta_validator(value):
|
||||||
"""Return the dateparser string for a time in the past.
|
"""
|
||||||
|
Return the dateparser string for a time in the past.
|
||||||
|
|
||||||
:param value: a string containing a time format supported by
|
:param value: a string containing a time format supported by
|
||||||
mod:`dateparser`
|
mod:`dateparser`
|
||||||
@ -19,13 +20,14 @@ def timedelta_validator(value):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
if not dateparser.parse(value):
|
if not dateparser.parse(value):
|
||||||
raise ArgumentTypeError("'{}' is not a valid timedelta string".format(value))
|
raise ArgumentTypeError(f"'{value}' is not a valid timedelta string")
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
def timedelta(value, dt_format=None):
|
def timedelta(value, dt_format=None):
|
||||||
"""Return the :class:`datetime.datetime.DateTime` for a time in the past.
|
"""
|
||||||
|
Return the :class:`datetime.datetime.DateTime` for a time in the past.
|
||||||
|
|
||||||
:param value: a string containing a time format supported by
|
:param value: a string containing a time format supported by
|
||||||
mod:`dateparser`
|
mod:`dateparser`
|
||||||
@ -34,10 +36,7 @@ def timedelta(value, dt_format=None):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
timedelta = dateparser.parse(
|
timedelta = dateparser.parse(
|
||||||
value, settings={
|
value, settings={"TO_TIMEZONE": "UTC", "RETURN_AS_TIMEZONE_AWARE": True}
|
||||||
"TO_TIMEZONE": "UTC",
|
|
||||||
"RETURN_AS_TIMEZONE_AWARE": True
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if dt_format:
|
if dt_format:
|
||||||
@ -52,4 +51,4 @@ def timedelta_parser(value):
|
|||||||
timedelta_validator(value)
|
timedelta_validator(value)
|
||||||
return value
|
return value
|
||||||
except ArgumentTypeError as e:
|
except ArgumentTypeError as e:
|
||||||
raise environs.EnvError(e)
|
raise environs.EnvError(e) from e
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
"""Test Autostop class."""
|
"""Test Autostop class."""
|
||||||
|
|
||||||
|
import docker
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
import docker
|
|
||||||
from dockertidy import autostop
|
from dockertidy import autostop
|
||||||
|
|
||||||
pytest_plugins = [
|
pytest_plugins = [
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
"""Test GarbageCollector class."""
|
"""Test GarbageCollector class."""
|
||||||
|
|
||||||
|
import docker
|
||||||
import pytest
|
import pytest
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
import docker
|
|
||||||
from dockertidy import garbage_collector
|
from dockertidy import garbage_collector
|
||||||
|
|
||||||
pytest_plugins = [
|
pytest_plugins = [
|
||||||
@ -358,7 +358,7 @@ def test_api_call_with_timeout(mocker, gc):
|
|||||||
gc._api_call(func, image=image)
|
gc._api_call(func, image=image)
|
||||||
|
|
||||||
func.assert_called_once_with(image="abcd")
|
func.assert_called_once_with(image="abcd")
|
||||||
mock_log.warn.assert_called_once_with("Failed to call remove_image " + "image=abcd msg")
|
mock_log.warning.assert_called_once_with("Failed to call remove_image " + "image=abcd msg")
|
||||||
|
|
||||||
|
|
||||||
def test_api_call_with_api_error(mocker, gc):
|
def test_api_call_with_api_error(mocker, gc):
|
||||||
@ -376,7 +376,7 @@ def test_api_call_with_api_error(mocker, gc):
|
|||||||
gc._api_call(func, image=image)
|
gc._api_call(func, image=image)
|
||||||
|
|
||||||
func.assert_called_once_with(image="abcd")
|
func.assert_called_once_with(image="abcd")
|
||||||
mock_log.warn.assert_called_once_with(
|
mock_log.warning.assert_called_once_with(
|
||||||
"Error calling remove_image image=abcd "
|
"Error calling remove_image image=abcd "
|
||||||
'409 Client Error for dummy: Conflict ("failed")'
|
'409 Client Error for dummy: Conflict ("failed")'
|
||||||
)
|
)
|
||||||
|
@ -1,7 +1,29 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""Global utility methods and classes."""
|
"""Global utility methods and classes."""
|
||||||
|
|
||||||
from distutils.util import strtobool
|
|
||||||
|
def strtobool(value):
|
||||||
|
"""Convert a string representation of truth to true or false."""
|
||||||
|
|
||||||
|
_map = {
|
||||||
|
"y": True,
|
||||||
|
"yes": True,
|
||||||
|
"t": True,
|
||||||
|
"true": True,
|
||||||
|
"on": True,
|
||||||
|
"1": True,
|
||||||
|
"n": False,
|
||||||
|
"no": False,
|
||||||
|
"f": False,
|
||||||
|
"false": False,
|
||||||
|
"off": False,
|
||||||
|
"0": False,
|
||||||
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
return _map[str(value).lower()]
|
||||||
|
except KeyError as err:
|
||||||
|
raise ValueError(f'"{value}" is not a valid bool value') from err
|
||||||
|
|
||||||
|
|
||||||
def to_bool(string):
|
def to_bool(string):
|
||||||
@ -20,8 +42,7 @@ class Singleton(type):
|
|||||||
|
|
||||||
_instances = {}
|
_instances = {}
|
||||||
|
|
||||||
def __call__(cls, *args, **kwargs): # noqa
|
def __call__(cls, *args, **kwargs):
|
||||||
|
|
||||||
if cls not in cls._instances:
|
if cls not in cls._instances:
|
||||||
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
|
cls._instances[cls] = super().__call__(*args, **kwargs)
|
||||||
return cls._instances[cls]
|
return cls._instances[cls]
|
||||||
|
@ -18,11 +18,16 @@ markup:
|
|||||||
startLevel: 1
|
startLevel: 1
|
||||||
|
|
||||||
params:
|
params:
|
||||||
|
description: >
|
||||||
|
Keep docker hosts tidy. docker-tidy is a tool to remove outdated and unused docker resources based on filters.
|
||||||
|
images:
|
||||||
|
- "socialmedia2.png"
|
||||||
|
|
||||||
geekdocMenuBundle: true
|
geekdocMenuBundle: true
|
||||||
geekdocToC: 3
|
geekdocToC: 3
|
||||||
|
|
||||||
geekdocRepo: https://github.com/thegeeklab/docker-tidy
|
geekdocRepo: https://github.com/thegeeklab/docker-tidy
|
||||||
geekdocEditPath: edit/main/docs/content
|
geekdocEditPath: edit/main/docs
|
||||||
|
|
||||||
geekdocDateFormat: "Jan 2, 2006"
|
geekdocDateFormat: "Jan 2, 2006"
|
||||||
geekdocSearch: true
|
geekdocSearch: true
|
||||||
|
@ -2,12 +2,11 @@
|
|||||||
title: Documentation
|
title: Documentation
|
||||||
---
|
---
|
||||||
|
|
||||||
[![Build Status](https://img.shields.io/drone/build/thegeeklab/docker-tidy?logo=drone&server=https%3A%2F%2Fdrone.thegeeklab.de)](https://drone.thegeeklab.de/thegeeklab/docker-tidy)
|
[![Build Status](https://ci.thegeeklab.de/api/badges/thegeeklab/docker-tidy/status.svg)](https://ci.thegeeklab.de/repos/thegeeklab/docker-tidy)
|
||||||
[![Docker Hub](https://img.shields.io/badge/docker-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/docker-tidy)
|
[![Docker Hub](https://img.shields.io/badge/docker-latest-blue.svg?logo=docker&logoColor=white)](https://hub.docker.com/r/thegeeklab/docker-tidy)
|
||||||
[![Python Version](https://img.shields.io/pypi/pyversions/docker-tidy.svg)](https://pypi.org/project/docker-tidy/)
|
[![Python Version](https://img.shields.io/pypi/pyversions/docker-tidy.svg)](https://pypi.org/project/docker-tidy/)
|
||||||
[![PyPI Status](https://img.shields.io/pypi/status/docker-tidy.svg)](https://pypi.org/project/docker-tidy/)
|
[![PyPI Status](https://img.shields.io/pypi/status/docker-tidy.svg)](https://pypi.org/project/docker-tidy/)
|
||||||
[![PyPI Release](https://img.shields.io/pypi/v/docker-tidy.svg)](https://pypi.org/project/docker-tidy/)
|
[![PyPI Release](https://img.shields.io/pypi/v/docker-tidy.svg)](https://pypi.org/project/docker-tidy/)
|
||||||
[![Codecov](https://img.shields.io/codecov/c/github/thegeeklab/docker-tidy)](https://codecov.io/gh/thegeeklab/docker-tidy)
|
|
||||||
[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/docker-tidy)](https://github.com/thegeeklab/docker-tidy/graphs/contributors)
|
[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/docker-tidy)](https://github.com/thegeeklab/docker-tidy/graphs/contributors)
|
||||||
[![Source: GitHub](https://img.shields.io/badge/source-github-blue.svg?logo=github&logoColor=white)](https://github.com/thegeeklab/docker-tidy)
|
[![Source: GitHub](https://img.shields.io/badge/source-github-blue.svg?logo=github&logoColor=white)](https://github.com/thegeeklab/docker-tidy)
|
||||||
[![License: Apache-2.0](https://img.shields.io/github/license/thegeeklab/docker-tidy)](https://github.com/thegeeklab/docker-tidy/blob/main/LICENSE)
|
[![License: Apache-2.0](https://img.shields.io/github/license/thegeeklab/docker-tidy)](https://github.com/thegeeklab/docker-tidy/blob/main/LICENSE)
|
||||||
|
@ -2,9 +2,11 @@
|
|||||||
title: Setup
|
title: Setup
|
||||||
---
|
---
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
<!-- spellchecker-disable -->
|
<!-- spellchecker-disable -->
|
||||||
{{< toc >}}
|
{{< toc >}}
|
||||||
<!-- spellchecker-enable -->
|
<!-- spellchecker-enable -->
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
|
||||||
## Pip
|
## Pip
|
||||||
|
|
||||||
@ -46,8 +48,7 @@ docker run \
|
|||||||
|
|
||||||
<!-- prettier-ignore-start -->
|
<!-- prettier-ignore-start -->
|
||||||
<!-- markdownlint-disable -->
|
<!-- markdownlint-disable -->
|
||||||
{{< hint info >}}
|
{{< hint type=note >}}
|
||||||
**Info**\
|
|
||||||
Keep in mind, that you have to pass SELinux labels (:Z or :z) to your mount option if you are working on SELinux enabled systems.
|
Keep in mind, that you have to pass SELinux labels (:Z or :z) to your mount option if you are working on SELinux enabled systems.
|
||||||
{{< /hint >}}
|
{{< /hint >}}
|
||||||
<!-- markdownlint-restore -->
|
<!-- markdownlint-restore -->
|
||||||
|
162
docs/static/socialmedia.svg
vendored
Normal file
162
docs/static/socialmedia.svg
vendored
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 20 KiB |
BIN
docs/static/socialmedia2.png
vendored
Normal file
BIN
docs/static/socialmedia2.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
1819
poetry.lock
generated
1819
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
151
pyproject.toml
151
pyproject.toml
@ -10,10 +10,11 @@ classifiers = [
|
|||||||
"Natural Language :: English",
|
"Natural Language :: English",
|
||||||
"Operating System :: POSIX",
|
"Operating System :: POSIX",
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
"Programming Language :: Python :: 3.6",
|
|
||||||
"Programming Language :: Python :: 3.7",
|
|
||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
|
"Programming Language :: Python :: 3.10",
|
||||||
|
"Programming Language :: Python :: 3.11",
|
||||||
|
"Programming Language :: Python :: 3.12",
|
||||||
"Topic :: System :: Systems Administration",
|
"Topic :: System :: Systems Administration",
|
||||||
"Topic :: Utilities",
|
"Topic :: Utilities",
|
||||||
"Topic :: Software Development",
|
"Topic :: Software Development",
|
||||||
@ -21,80 +22,57 @@ classifiers = [
|
|||||||
description = "Keep docker hosts tidy."
|
description = "Keep docker hosts tidy."
|
||||||
documentation = "https://docker-tidy.geekdocs.de/"
|
documentation = "https://docker-tidy.geekdocs.de/"
|
||||||
homepage = "https://docker-tidy.geekdocs.de/"
|
homepage = "https://docker-tidy.geekdocs.de/"
|
||||||
include = [
|
include = ["LICENSE"]
|
||||||
"LICENSE",
|
|
||||||
]
|
|
||||||
keywords = ["docker", "gc", "prune", "garbage"]
|
keywords = ["docker", "gc", "prune", "garbage"]
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
name = "docker-tidy"
|
name = "docker-tidy"
|
||||||
packages = [
|
packages = [{ include = "dockertidy" }]
|
||||||
{include = "dockertidy"},
|
|
||||||
]
|
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
repository = "https://github.com/thegeeklab/docker-tidy/"
|
repository = "https://github.com/thegeeklab/docker-tidy/"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
anyconfig = "0.11.0"
|
anyconfig = "0.14.0"
|
||||||
appdirs = "1.4.4"
|
appdirs = "1.4.4"
|
||||||
certifi = "2021.5.30"
|
certifi = "2024.8.30"
|
||||||
colorama = "0.4.4"
|
colorama = "0.4.6"
|
||||||
dateparser = "1.0.0"
|
dateparser = "1.2.0"
|
||||||
docker = "5.0.0"
|
docker = "7.1.0"
|
||||||
docker-pycreds = "0.4.0"
|
docker-pycreds = "0.4.0"
|
||||||
environs = "9.3.3"
|
environs = "11.0.0"
|
||||||
idna = "3.2"
|
idna = "3.10"
|
||||||
ipaddress = "1.0.23"
|
ipaddress = "1.0.23"
|
||||||
jsonschema = "3.2.0"
|
jsonschema = "4.23.0"
|
||||||
nested-lookup = "0.2.22"
|
nested-lookup = "0.2.25"
|
||||||
pathspec = "0.9.0"
|
pathspec = "0.12.1"
|
||||||
python = "^3.6.0"
|
python = "^3.8.0"
|
||||||
python-dateutil = "2.8.2"
|
python-dateutil = "2.9.0.post0"
|
||||||
python-json-logger = "2.0.2"
|
python-json-logger = "2.0.7"
|
||||||
requests = "2.26.0"
|
requests = "2.32.3"
|
||||||
"ruamel.yaml" = "0.17.10"
|
"ruamel.yaml" = "0.18.6"
|
||||||
websocket_client = "1.2.0"
|
websocket_client = "1.8.0"
|
||||||
zipp = "3.5.0"
|
zipp = "3.20.2"
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
|
||||||
bandit = "1.7.0"
|
|
||||||
flake8 = "3.9.2"
|
|
||||||
flake8-blind-except = "0.2.0"
|
|
||||||
flake8-builtins = "1.5.3"
|
|
||||||
flake8-docstrings = "1.6.0"
|
|
||||||
flake8-eradicate = "1.1.0"
|
|
||||||
flake8-isort = "4.0.0"
|
|
||||||
flake8-logging-format = "0.6.0"
|
|
||||||
flake8-pep3101 = "1.3.0"
|
|
||||||
flake8-polyfill = "1.0.2"
|
|
||||||
flake8-quotes = "3.2.0"
|
|
||||||
pep8-naming = "0.12.1"
|
|
||||||
pydocstyle = "6.1.1"
|
|
||||||
pytest = "6.2.4"
|
|
||||||
pytest-cov = "2.12.1"
|
|
||||||
pytest-mock = "3.6.1"
|
|
||||||
yapf = "0.31.0"
|
|
||||||
|
|
||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
docker-tidy = "dockertidy.cli:main"
|
docker-tidy = "dockertidy.cli:main"
|
||||||
|
|
||||||
|
[tool.poetry.group.dev.dependencies]
|
||||||
|
ruff = "0.7.2"
|
||||||
|
pytest = "8.3.3"
|
||||||
|
pytest-mock = "3.14.0"
|
||||||
|
pytest-cov = "5.0.0"
|
||||||
|
toml = "0.10.2"
|
||||||
|
|
||||||
[tool.poetry-dynamic-versioning]
|
[tool.poetry-dynamic-versioning]
|
||||||
enable = true
|
enable = true
|
||||||
style = "semver"
|
style = "semver"
|
||||||
vcs = "git"
|
vcs = "git"
|
||||||
|
|
||||||
[tool.isort]
|
|
||||||
default_section = "THIRDPARTY"
|
|
||||||
force_single_line = true
|
|
||||||
line_length = 99
|
|
||||||
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
|
|
||||||
skip_glob = ["**/.env*", "**/env/*", "**/.venv/*", "**/docs/*"]
|
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
addopts = "dockertidy --cov=dockertidy --cov-report=xml:coverage.xml --cov-report=term --cov-append --no-cov-on-fail"
|
addopts = "dockertidy --cov=dockertidy --cov-report=xml:coverage.xml --cov-report=term --no-cov-on-fail"
|
||||||
filterwarnings = [
|
filterwarnings = [
|
||||||
"ignore::FutureWarning",
|
"ignore::FutureWarning",
|
||||||
"ignore:.*collections.*:DeprecationWarning",
|
"ignore::DeprecationWarning",
|
||||||
"ignore:.*pep8.*:FutureWarning",
|
"ignore:.*pep8.*:FutureWarning",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -102,5 +80,70 @@ filterwarnings = [
|
|||||||
omit = ["**/test/*"]
|
omit = ["**/test/*"]
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
build-backend = "poetry.core.masonry.api"
|
build-backend = "poetry_dynamic_versioning.backend"
|
||||||
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
|
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
|
||||||
|
|
||||||
|
[tool.ruff]
|
||||||
|
exclude = [
|
||||||
|
".git",
|
||||||
|
"__pycache__",
|
||||||
|
"build",
|
||||||
|
"dist",
|
||||||
|
"test",
|
||||||
|
"*.pyc",
|
||||||
|
"*.egg-info",
|
||||||
|
".cache",
|
||||||
|
".eggs",
|
||||||
|
"env*",
|
||||||
|
]
|
||||||
|
|
||||||
|
line-length = 99
|
||||||
|
indent-width = 4
|
||||||
|
|
||||||
|
[tool.ruff.lint]
|
||||||
|
# Explanation of errors
|
||||||
|
#
|
||||||
|
# D102: Missing docstring in public method
|
||||||
|
# D103: Missing docstring in public function
|
||||||
|
# D105: Missing docstring in magic method
|
||||||
|
# D107: Missing docstring in __init__
|
||||||
|
# D202: No blank lines allowed after function docstring
|
||||||
|
# D203: One blank line required before class docstring
|
||||||
|
# D212: Multi-line docstring summary should start at the first line
|
||||||
|
ignore = [
|
||||||
|
"D102",
|
||||||
|
"D103",
|
||||||
|
"D105",
|
||||||
|
"D107",
|
||||||
|
"D202",
|
||||||
|
"D203",
|
||||||
|
"D212",
|
||||||
|
"UP038",
|
||||||
|
"RUF012",
|
||||||
|
]
|
||||||
|
select = [
|
||||||
|
"D",
|
||||||
|
"E",
|
||||||
|
"F",
|
||||||
|
"Q",
|
||||||
|
"W",
|
||||||
|
"I",
|
||||||
|
"S",
|
||||||
|
"BLE",
|
||||||
|
"N",
|
||||||
|
"UP",
|
||||||
|
"B",
|
||||||
|
"A",
|
||||||
|
"C4",
|
||||||
|
"T20",
|
||||||
|
"SIM",
|
||||||
|
"RET",
|
||||||
|
"ARG",
|
||||||
|
"ERA",
|
||||||
|
"RUF",
|
||||||
|
]
|
||||||
|
|
||||||
|
[tool.ruff.format]
|
||||||
|
quote-style = "double"
|
||||||
|
indent-style = "space"
|
||||||
|
line-ending = "lf"
|
||||||
|
@ -1,4 +1,12 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
"extends": ["github>thegeeklab/renovate-presets"]
|
"extends": ["github>thegeeklab/renovate-presets"],
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"matchManagers": ["woodpecker"],
|
||||||
|
"matchFileNames": [".woodpecker/test.yml"],
|
||||||
|
"matchPackageNames": ["docker.io/library/python"],
|
||||||
|
"enabled": false
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
20
setup.cfg
20
setup.cfg
@ -1,20 +0,0 @@
|
|||||||
[flake8]
|
|
||||||
# Explanation of errors
|
|
||||||
#
|
|
||||||
# D102: Missing docstring in public method
|
|
||||||
# D103: Missing docstring in public function
|
|
||||||
# D105: Missing docstring in magic method
|
|
||||||
# D107: Missing docstring in __init__
|
|
||||||
# D202: No blank lines allowed after function docstring
|
|
||||||
# W503:Line break occurred before a binary operator
|
|
||||||
ignore = D102, D103, D105, D107, D202, W503
|
|
||||||
max-line-length = 99
|
|
||||||
inline-quotes = double
|
|
||||||
exclude = .git, __pycache__, build, dist, test, *.pyc, *.egg-info, .cache, .eggs, env*
|
|
||||||
|
|
||||||
[yapf]
|
|
||||||
based_on_style = google
|
|
||||||
column_limit = 99
|
|
||||||
dedent_closing_brackets = true
|
|
||||||
coalesce_brackets = true
|
|
||||||
split_before_logical_operator = true
|
|
Loading…
Reference in New Issue
Block a user