runfile-tasks 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/docker.runfile +17 -2
  3. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d92aedb996f39b43aac546e5965d370fa52fd047cea58d7bab29f8018217fc3
4
- data.tar.gz: 20cea24b2910446df432366a8c9ab89b02c1b2179382f28e53beb765b4b3a665
3
+ metadata.gz: 4f89325e6fa987c92d5a0524756882da6cde621871d29b6b8c1aae2eb2876d56
4
+ data.tar.gz: 8637c30a8e73a5ee5ed6d21999f857f9dfd141212124801d2ef9b027c9dba4b5
5
5
  SHA512:
6
- metadata.gz: fe42ad814a78022b49b6428e4a7f5a8d402a0928bc9c4f71afd1272431196d53d24a884d0c28effa0a5ac3be272d2b177424f13f5ca42eef9ebf1d67224900de
7
- data.tar.gz: ced49d5275af7f273a337e187e1fa1de68596bc816591cbb126d2c216e9d1525113735534d2176b6b174265e123f508f268ae7a687253b86cf7cd830e351e774
6
+ metadata.gz: be90a2e42f99fd2265309d076d23dc0f0756bc36442d3fe7f61490c25bdaaca648d8b08828ec0b39dcb87f4f5f896d6bbef030445b926c335b0595dea5004aba
7
+ data.tar.gz: 0d7650b544489d60b0579b3d52ae492eaf27f376373607cf475cc3ae0172a3c49feacf5bb5962916dcbea240fbeacfa865d5debf6b8cdfdc5bbcf7a7f04dbc3b
data/docker.runfile CHANGED
@@ -8,11 +8,11 @@ action :build, :b do
8
8
  say "g`Building docker image #{image}`"
9
9
  run "docker build -t #{image} ."
10
10
  run "docker tag #{image} #{image}:#{version}"
11
- run "docker images | grep #{image}"
11
+ run "docker images |grep #{image}"
12
12
  end
13
13
 
14
14
  help 'Run the image with --version and compare it with the provided version'
15
- action :test, :t do |_args|
15
+ action :test, :t do
16
16
  docker_version = `docker run --rm #{image} --version`.chomp
17
17
  if docker_version == version
18
18
  say "g`PASS: docker version is #{docker_version}`"
@@ -31,6 +31,21 @@ action :push, :p do
31
31
  run "docker push #{image}:#{version}"
32
32
  end
33
33
 
34
+ help 'Build the image for multiple platforms and push'
35
+ usage '(multi | m) [PLATFORMS...]'
36
+ param 'PLATFORMS', 'List of platforms [default: linux/amd64 linux/arm64v8]'
37
+ action :multi, :m do |args|
38
+ platforms = args['PLATFORMS']
39
+ platforms = %w[linux/amd64 linux/arm64v8] if platforms.empty?
40
+
41
+ say "g`Building and pushing docker image #{image}`"
42
+ say "g`Platforms: #{platforms}`"
43
+ run "docker buildx build --push --platform #{platforms.join ','} -t #{image} -t #{image}:#{version} ."
44
+
45
+ say "g`Inspecting platforms for #{image}`"
46
+ run "docker buildx imagetools inspect #{image}:#{version} |grep Platform"
47
+ end
48
+
34
49
  helpers do
35
50
  def image
36
51
  context[:image]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runfile-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-27 00:00:00.000000000 Z
11
+ date: 2024-02-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A collection of tasks for Runfile
14
14
  email: db@dannyben.com
@@ -25,7 +25,7 @@ licenses:
25
25
  - MIT
26
26
  metadata:
27
27
  rubygems_mfa_required: 'true'
28
- post_install_message:
28
+ post_install_message:
29
29
  rdoc_options: []
30
30
  require_paths:
31
31
  - lib
@@ -40,8 +40,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  requirements: []
43
- rubygems_version: 3.4.9
44
- signing_key:
43
+ rubygems_version: 3.5.6
44
+ signing_key:
45
45
  specification_version: 4
46
46
  summary: Runfile tasks collection
47
47
  test_files: []