Skip to content

Commit

Permalink
Merge pull request #40 from theohbrothers/refactor/use-range-constrai…
Browse files Browse the repository at this point in the history
…nt-in-apk-add-for-simpler-versions

Refactor: Use range constraint in `apk add` for simpler versions
  • Loading branch information
leojonathanoh authored Sep 12, 2023
2 parents ccb93df + ccb4586 commit 85bdabc
Show file tree
Hide file tree
Showing 20 changed files with 31 additions and 30 deletions.
23 changes: 12 additions & 11 deletions generate/definitions/VARIANTS.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Docker image variants' definitions
$local:VARIANTS_MATRIX = @(
# Since v2.10, ansible has been split into two packages, namely ansible and ansible-core. See: https://wiki.archlinux.org/index.php?title=Ansible&action=history
# Since v2.10, ansible has been split into two packages, namely ansible and ansible-core.
# See: https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#where-did-all-the-modules-go
# See: https://wiki.archlinux.org/index.php?title=Ansible&action=history
@{
package = 'ansible-core'
package_version = '2.14.5-r0'
package_version = '2.14.5'
distro = 'alpine'
distro_version = '3.18'
subvariants = @(
Expand All @@ -13,7 +15,7 @@ $local:VARIANTS_MATRIX = @(
}
@{
package = 'ansible-core'
package_version = '2.13.6-r0'
package_version = '2.13.6'
distro = 'alpine'
distro_version = '3.17'
subvariants = @(
Expand All @@ -23,7 +25,7 @@ $local:VARIANTS_MATRIX = @(
}
@{
package = 'ansible-core'
package_version = '2.11.6-r1'
package_version = '2.11.6'
distro = 'alpine'
distro_version = '3.15'
subvariants = @(
Expand All @@ -33,7 +35,7 @@ $local:VARIANTS_MATRIX = @(
}
@{
package = 'ansible'
package_version = '2.10.7-r0'
package_version = '2.10.7'
distro = 'alpine'
distro_version = '3.13'
subvariants = @(
Expand All @@ -43,7 +45,7 @@ $local:VARIANTS_MATRIX = @(
}
@{
package = 'ansible'
package_version = '2.9.18-r0'
package_version = '2.9.18'
distro = 'alpine'
distro_version = '3.11'
subvariants = @(
Expand All @@ -53,7 +55,7 @@ $local:VARIANTS_MATRIX = @(
}
@{
package = 'ansible'
package_version = '2.8.19-r0'
package_version = '2.8.19'
distro = 'alpine'
distro_version = '3.10'
subvariants = @(
Expand All @@ -63,7 +65,7 @@ $local:VARIANTS_MATRIX = @(
}
@{
package = 'ansible'
package_version = '2.7.17-r0'
package_version = '2.7.17'
distro = 'alpine'
distro_version = '3.9'
subvariants = @(
Expand All @@ -73,7 +75,7 @@ $local:VARIANTS_MATRIX = @(
}
@{
package = 'ansible'
package_version = '2.6.20-r0'
package_version = '2.6.20'
distro = 'alpine'
distro_version = '3.8'
subvariants = @(
Expand All @@ -83,7 +85,7 @@ $local:VARIANTS_MATRIX = @(
}
@{
package = 'ansible'
package_version = '2.4.6.0-r1'
package_version = '2.4.6.0'
distro = 'alpine'
distro_version = '3.7'
subvariants = @(
Expand All @@ -110,7 +112,6 @@ $VARIANTS = @(
_metadata = @{
package = $variant['package']
package_version = $variant['package_version']
package_version_semver = "v$( $variant['package_version'] )" -replace '-r\d+', '' # E.g. Strip out the '-r' in '2.3.0.0-r1'
distro = $variant['distro']
distro_version = $variant['distro_version']
platforms = & {
Expand Down
2 changes: 1 addition & 1 deletion generate/templates/Dockerfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN echo "I am running on `$BUILDPLATFORM, building for `$TARGETPLATFORM"
# Install ansible
RUN set -eux; \
apk add --no-cache $( $VARIANT['_metadata']['package'] )=$( $VARIANT['_metadata']['package_version'] ); \
apk add --no-cache $( $VARIANT['_metadata']['package'] )$( if ( $VARIANT['_metadata']['distro'] -eq 'alpine' -and $VARIANT['_metadata']['distro_version'] -eq '3.6' ) { '=' } else { '~=' } )$( $VARIANT['_metadata']['package_version'] ); \
ansible --version
RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.10.7-alpine-3.13/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible=2.10.7-r0; \
apk add --no-cache ansible~=2.10.7; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.10.7-sops-ssh-alpine-3.13/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible=2.10.7-r0; \
apk add --no-cache ansible~=2.10.7; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.11.6-alpine-3.15/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible-core=2.11.6-r1; \
apk add --no-cache ansible-core~=2.11.6; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.11.6-sops-ssh-alpine-3.15/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible-core=2.11.6-r1; \
apk add --no-cache ansible-core~=2.11.6; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.13.6-alpine-3.17/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible-core=2.13.6-r0; \
apk add --no-cache ansible-core~=2.13.6; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.13.6-sops-ssh-alpine-3.17/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible-core=2.13.6-r0; \
apk add --no-cache ansible-core~=2.13.6; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.14.5-alpine-3.18/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible-core=2.14.5-r0; \
apk add --no-cache ansible-core~=2.14.5; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.14.5-sops-ssh-alpine-3.18/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible-core=2.14.5-r0; \
apk add --no-cache ansible-core~=2.14.5; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.4.6.0-alpine-3.7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible=2.4.6.0-r1; \
apk add --no-cache ansible~=2.4.6.0; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.4.6.0-sops-ssh-alpine-3.7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible=2.4.6.0-r1; \
apk add --no-cache ansible~=2.4.6.0; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.6.20-alpine-3.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible=2.6.20-r0; \
apk add --no-cache ansible~=2.6.20; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.6.20-sops-ssh-alpine-3.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible=2.6.20-r0; \
apk add --no-cache ansible~=2.6.20; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.7.17-alpine-3.9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible=2.7.17-r0; \
apk add --no-cache ansible~=2.7.17; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.7.17-sops-ssh-alpine-3.9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible=2.7.17-r0; \
apk add --no-cache ansible~=2.7.17; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.8.19-alpine-3.10/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible=2.8.19-r0; \
apk add --no-cache ansible~=2.8.19; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.8.19-sops-ssh-alpine-3.10/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible=2.8.19-r0; \
apk add --no-cache ansible~=2.8.19; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.9.18-alpine-3.11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible=2.9.18-r0; \
apk add --no-cache ansible~=2.9.18; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.9.18-sops-ssh-alpine-3.11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"

# Install ansible
RUN set -eux; \
apk add --no-cache ansible=2.9.18-r0; \
apk add --no-cache ansible~=2.9.18; \
ansible --version

RUN apk add --no-cache ca-certificates
Expand Down

0 comments on commit 85bdabc

Please sign in to comment.