build-labels 0.0.74 → 0.0.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e07ba52e792206553d99181964dcba23b52eb2f2b79e76a4ba3cab25eea5c85
4
- data.tar.gz: b460ec4c2511d350b0280ccbd00fa2f513f862008f200a1ce0955c13ec45ddf1
3
+ metadata.gz: 9ecd674454bd34e82b1e1d45099b54e103789ea67e652dffe72768a435bdbb12
4
+ data.tar.gz: 4b85d9c6f682ad319a578e516e501d5858ffad8d45e5c5dc25164c1e6693cdd2
5
5
  SHA512:
6
- metadata.gz: 4b413f2d86c5572cf6d26a3a8e61e692f68d8c6d784c6d3e6abdcffc2e78cd7d39e987ba6edfca6d8bc123a509b933a8facc94a5ba8c70e3ebcd7b77e0ce88f0
7
- data.tar.gz: 06deac4c012f1da1e4f2ddf5d9a9b454666f87b15c3c4a9568093c61191d9322538fa36bac7d7c58cc0288488962424d1ae0bf7ea5c33a292d8f2feee37db5df
6
+ metadata.gz: 0e3b0bf903e26ec82fb5e87c85fd45d5750098cad96618364c934f81790e25a1d816dc3e493045da133350ae4587c347cc81b5955c448639d0412b668b4880a4
7
+ data.tar.gz: 6a0e285f6b9f5cef615f6d0b9d23b2f04bb285b436c247685b378d1c76850b6114b402605725c58074e96751fdf5456ba4767fe37fdb7d3f450effd2141d1dc8
@@ -6,6 +6,40 @@ exec "sh", "-eux", "-c", shell, "sh", *ARGV
6
6
  __END__
7
7
  set -eux
8
8
 
9
+ detect_arch() {
10
+ arch="$(uname -m)"
11
+ case "$arch" in
12
+ x86_64|amd64)
13
+ docker_arch="x86_64"
14
+ buildx_arch="amd64"
15
+ ;;
16
+ aarch64|arm64)
17
+ docker_arch="aarch64"
18
+ buildx_arch="arm64"
19
+ ;;
20
+ armv7l|armv7)
21
+ docker_arch="armhf"
22
+ buildx_arch="arm-v7"
23
+ ;;
24
+ armv6l|armv6)
25
+ docker_arch="armel"
26
+ buildx_arch="arm-v6"
27
+ ;;
28
+ ppc64le)
29
+ docker_arch="ppc64le"
30
+ buildx_arch="ppc64le"
31
+ ;;
32
+ s390x)
33
+ docker_arch="s390x"
34
+ buildx_arch="s390x"
35
+ ;;
36
+ *)
37
+ echo "Unsupported architecture: $arch" >&2
38
+ exit 1
39
+ ;;
40
+ esac
41
+ }
42
+
9
43
  # Dockerfile:
10
44
  #FROM ruby:3.4.4-slim-bookworm AS base
11
45
  #FROM ruby:3.2.10-alpine AS base
@@ -26,19 +60,7 @@ set -eux
26
60
  # && docker -v
27
61
 
28
62
  install_docker_static() {
29
- arch="$(uname -m)"
30
- case "$arch" in
31
- x86_64|amd64) docker_arch="x86_64" ;;
32
- aarch64|arm64) docker_arch="aarch64" ;;
33
- armv7l|armv7) docker_arch="armhf" ;;
34
- armv6l|armv6) docker_arch="armel" ;;
35
- ppc64le) docker_arch="ppc64le" ;;
36
- s390x) docker_arch="s390x" ;;
37
- *)
38
- echo "Unsupported architecture: $arch" >&2
39
- exit 1
40
- ;;
41
- esac
63
+ detect_arch
42
64
  base_url="https://download.docker.com/linux/static/stable/$docker_arch/"
43
65
  latest_version="$(
44
66
  curl -fsSL "$base_url" \
@@ -57,14 +79,38 @@ install_docker_static() {
57
79
  rm -rf "$tmp_dir"
58
80
  }
59
81
 
82
+ install_buildx() {
83
+ detect_arch
84
+ buildx_version="${BUILDX_VERSION:-}"
85
+ if [ -z "$buildx_version" ]; then
86
+ buildx_version="$(
87
+ curl -fsSL https://api.github.com/repos/docker/buildx/releases/latest \
88
+ | sed -n 's/.*"tag_name": "\(v[0-9.]*\)".*/\1/p' \
89
+ | head -n 1
90
+ )"
91
+ fi
92
+ if [ -z "$buildx_version" ]; then
93
+ echo "Unable to determine latest buildx version" >&2
94
+ exit 1
95
+ fi
96
+ plugin_dir="/usr/local/lib/docker/cli-plugins"
97
+ mkdir -p "$plugin_dir"
98
+ curl -fsSL \
99
+ -o "$plugin_dir/docker-buildx" \
100
+ "https://github.com/docker/buildx/releases/download/${buildx_version}/buildx-${buildx_version}.linux-${buildx_arch}"
101
+ chmod 0755 "$plugin_dir/docker-buildx"
102
+ }
103
+
60
104
  if command -v apt-get >/dev/null 2>&1; then
61
105
  apt-get update
62
106
  apt-get install -y --no-install-recommends git ca-certificates curl tar
63
107
  install_docker_static
108
+ install_buildx
64
109
  rm -rf /var/lib/apt/lists/*
65
110
  elif command -v apk >/dev/null 2>&1; then
66
111
  apk add --no-cache git ca-certificates curl tar
67
112
  install_docker_static
113
+ install_buildx
68
114
  else
69
115
  echo "Unsupported package manager: expected apt or apk." >&2
70
116
  exit 1
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module BuildLabels
2
2
  class Builder
3
- VERSION = '0.0.74'
3
+ VERSION = '0.0.75'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build-labels
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.74
4
+ version: 0.0.75
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artyom B