gitlab-janitor 1.0.3.92955 → 1.0.4.94895
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile +6 -1
- data/Gemfile.lock +6 -5
- data/lib/gitlab_janitor/cache_cleaner.rb +16 -2
- data/lib/gitlab_janitor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14f26d242228d00c0f522100f187ce589117719d33317d98108d261f2d1e3fe9
|
4
|
+
data.tar.gz: fb6db353ef3800a2336678c2ca09d60914c6cce9c2d3c0368eec65e2d866c677
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21c792b8a83b65dd62b1a33f11db7c7b5bb6dfce85395e8eeec2a6ca325a78b1c936b39155a7dd5d63364a4ca6c33af42bcc7a489e04ad23abe944ba614841ad
|
7
|
+
data.tar.gz: 56796debf5eead9f11b4e60ef31e1a242b2f673019812d25dd0b429fc8685d2a5fe7f321b7095a699230b7c14fe5bf886c743908567fad8a7db5b6eabdcc550f
|
data/Dockerfile
CHANGED
@@ -11,10 +11,15 @@ RUN mkdir -p /usr/local/etc \
|
|
11
11
|
} >> /usr/local/etc/gemrc \
|
12
12
|
&& echo 'gem: --no-document' > ~/.gemrc
|
13
13
|
|
14
|
+
ENV \
|
15
|
+
BUILDKIT_INLINE_CACHE="1" \
|
16
|
+
BUILDKIT_PROGRESS="plain" \
|
17
|
+
DOCKER_BUILDKIT="1" \
|
18
|
+
DOCKER_CLI_EXPERIMENTAL="1"
|
19
|
+
|
14
20
|
RUN set -ex \
|
15
21
|
&& apk add --no-cache docker-cli
|
16
22
|
|
17
|
-
|
18
23
|
ADD Gemfile Gemfile.lock gitlab-janitor.gemspec /home/app/
|
19
24
|
ADD lib/gitlab_janitor/version.rb /home/app/lib/gitlab_janitor/
|
20
25
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gitlab-janitor (1.0.
|
4
|
+
gitlab-janitor (1.0.4.94895)
|
5
5
|
activesupport (~> 6.0)
|
6
6
|
docker-api
|
7
7
|
fugit
|
@@ -34,12 +34,12 @@ GEM
|
|
34
34
|
raabro (~> 1.4)
|
35
35
|
i18n (1.12.0)
|
36
36
|
concurrent-ruby (~> 1.0)
|
37
|
-
minitest (5.16.
|
37
|
+
minitest (5.16.3)
|
38
38
|
multi_json (1.15.0)
|
39
39
|
optparse (0.2.0)
|
40
40
|
raabro (1.4.0)
|
41
41
|
rake (13.0.6)
|
42
|
-
redis (4.
|
42
|
+
redis (4.8.0)
|
43
43
|
rspec (3.11.0)
|
44
44
|
rspec-core (~> 3.11.0)
|
45
45
|
rspec-expectations (~> 3.11.0)
|
@@ -69,12 +69,13 @@ GEM
|
|
69
69
|
unicode-display_width (>= 1.1.1, < 3)
|
70
70
|
tzinfo (2.0.5)
|
71
71
|
concurrent-ruby (~> 1.0)
|
72
|
-
tzinfo-data (1.2022.
|
72
|
+
tzinfo-data (1.2022.3)
|
73
73
|
tzinfo (>= 1.0.0)
|
74
74
|
unicode-display_width (2.2.0)
|
75
75
|
zeitwerk (2.6.0)
|
76
76
|
|
77
77
|
PLATFORMS
|
78
|
+
ruby
|
78
79
|
x86_64-linux
|
79
80
|
|
80
81
|
DEPENDENCIES
|
@@ -88,4 +89,4 @@ DEPENDENCIES
|
|
88
89
|
simplecov-console
|
89
90
|
|
90
91
|
BUNDLED WITH
|
91
|
-
2.3.
|
92
|
+
2.3.20
|
@@ -10,14 +10,28 @@ module GitlabJanitor
|
|
10
10
|
def do_clean(keep_size: '10G', remove: false)
|
11
11
|
logger.info 'Removing cache...'
|
12
12
|
if remove
|
13
|
-
|
14
|
-
|
13
|
+
prune_builder(keep_size)
|
14
|
+
prune_buildx(keep_size)
|
15
15
|
else
|
16
16
|
logger.info 'Skip removal due to dry run'
|
17
17
|
end
|
18
18
|
out, _status = Open3.capture2e('docker system df')
|
19
19
|
logger.info(out)
|
20
20
|
end
|
21
|
+
|
22
|
+
def prune_builder(keep_size)
|
23
|
+
out, _status = Open3.capture2e("docker builder prune --keep-storage #{keep_size} -f")
|
24
|
+
logger.info(out)
|
25
|
+
rescue StandardError =>e
|
26
|
+
logger.warn("Unable to clean BUILDER: #{e.inspect}")
|
27
|
+
end
|
28
|
+
|
29
|
+
def prune_buildx(keep_size)
|
30
|
+
out, _status = Open3.capture2e("docker buildx prune --keep-storage #{keep_size} -f")
|
31
|
+
logger.info(out)
|
32
|
+
rescue StandardError =>e
|
33
|
+
logger.warn("Unable to clean BUILDX: #{e.inspect}")
|
34
|
+
end
|
21
35
|
|
22
36
|
end
|
23
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-janitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4.94895
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samoilenko Yuri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|