From e762f79c8a5044c5311b5f2d237fbcb22638d942 Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Mon, 25 Sep 2023 14:08:56 +0000 Subject: [PATCH] Refactor (ci): Use range constraint in `apk add` for simpler versions --- generate/definitions/VARIANTS.ps1 | 25 ++++++++++++------------- generate/templates/Dockerfile.ps1 | 2 +- variants/v2.3.18-alpine-3.3/Dockerfile | 2 +- variants/v2.3.18-alpine-3.4/Dockerfile | 2 +- variants/v2.3.18-alpine-3.5/Dockerfile | 2 +- variants/v2.4.11-alpine-3.10/Dockerfile | 2 +- variants/v2.4.11-alpine-3.11/Dockerfile | 2 +- variants/v2.4.12-alpine-3.12/Dockerfile | 2 +- variants/v2.4.4-alpine-3.6/Dockerfile | 2 +- variants/v2.4.4-alpine-3.7/Dockerfile | 2 +- variants/v2.4.6-alpine-3.8/Dockerfile | 2 +- variants/v2.4.6-alpine-3.9/Dockerfile | 2 +- variants/v2.5.8-alpine-3.17/Dockerfile | 2 +- variants/v2.6.5-alpine-3.18/Dockerfile | 2 +- 14 files changed, 25 insertions(+), 26 deletions(-) diff --git a/generate/definitions/VARIANTS.ps1 b/generate/definitions/VARIANTS.ps1 index e03f3e9..3d2f18e 100644 --- a/generate/definitions/VARIANTS.ps1 +++ b/generate/definitions/VARIANTS.ps1 @@ -2,7 +2,7 @@ $local:VARIANTS_MATRIX = @( @{ package = 'openvpn' - package_version = '2.6.5-r0' + package_version = '2.6.5' distro = 'alpine' distro_version = '3.18' subvariants = @( @@ -11,7 +11,7 @@ $local:VARIANTS_MATRIX = @( } @{ package = 'openvpn' - package_version = '2.5.8-r0' + package_version = '2.5.8' distro = 'alpine' distro_version = '3.17' subvariants = @( @@ -20,7 +20,7 @@ $local:VARIANTS_MATRIX = @( } @{ package = 'openvpn' - package_version = '2.4.12-r0' + package_version = '2.4.12' distro = 'alpine' distro_version = '3.12' subvariants = @( @@ -29,7 +29,7 @@ $local:VARIANTS_MATRIX = @( } @{ package = 'openvpn' - package_version = '2.4.11-r0' + package_version = '2.4.11' distro = 'alpine' distro_version = '3.11' subvariants = @( @@ -38,7 +38,7 @@ $local:VARIANTS_MATRIX = @( } @{ package = 'openvpn' - package_version = '2.4.11-r0' + package_version = '2.4.11' distro = 'alpine' distro_version = '3.10' subvariants = @( @@ -47,7 +47,7 @@ $local:VARIANTS_MATRIX = @( } @{ package = 'openvpn' - package_version = '2.4.6-r4' + package_version = '2.4.6' distro = 'alpine' distro_version = '3.9' subvariants = @( @@ -56,7 +56,7 @@ $local:VARIANTS_MATRIX = @( } @{ package = 'openvpn' - package_version = '2.4.6-r3' + package_version = '2.4.6' distro = 'alpine' distro_version = '3.8' subvariants = @( @@ -65,7 +65,7 @@ $local:VARIANTS_MATRIX = @( } @{ package = 'openvpn' - package_version = '2.4.4-r1' + package_version = '2.4.4' distro = 'alpine' distro_version = '3.7' subvariants = @( @@ -74,7 +74,7 @@ $local:VARIANTS_MATRIX = @( } @{ package = 'openvpn' - package_version = '2.4.4-r0' + package_version = '2.4.4' distro = 'alpine' distro_version = '3.6' subvariants = @( @@ -83,7 +83,7 @@ $local:VARIANTS_MATRIX = @( } @{ package = 'openvpn' - package_version = '2.3.18-r0' + package_version = '2.3.18' distro = 'alpine' distro_version = '3.5' subvariants = @( @@ -92,7 +92,7 @@ $local:VARIANTS_MATRIX = @( } @{ package = 'openvpn' - package_version = '2.3.18-r0' + package_version = '2.3.18' distro = 'alpine' distro_version = '3.4' subvariants = @( @@ -101,7 +101,7 @@ $local:VARIANTS_MATRIX = @( } @{ package = 'openvpn' - package_version = '2.3.18-r0' + package_version = '2.3.18' distro = 'alpine' distro_version = '3.3' subvariants = @( @@ -118,7 +118,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 = & { diff --git a/generate/templates/Dockerfile.ps1 b/generate/templates/Dockerfile.ps1 index ae75fb4..d0fbbc9 100644 --- a/generate/templates/Dockerfile.ps1 +++ b/generate/templates/Dockerfile.ps1 @@ -1,7 +1,7 @@ @" FROM $( $VARIANT['_metadata']['distro'] ):$( $VARIANT['_metadata']['distro_version'] ) -RUN apk add --no-cache $( $VARIANT['_metadata']['package'] )=$( $VARIANT['_metadata']['package_version'] ) iptables +RUN apk add --no-cache $( $VARIANT['_metadata']['package'] )~=$( $VARIANT['_metadata']['package_version'] ) iptables COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh diff --git a/variants/v2.3.18-alpine-3.3/Dockerfile b/variants/v2.3.18-alpine-3.3/Dockerfile index 318e1c6..4d92852 100644 --- a/variants/v2.3.18-alpine-3.3/Dockerfile +++ b/variants/v2.3.18-alpine-3.3/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.3 -RUN apk add --no-cache openvpn=2.3.18-r0 iptables +RUN apk add --no-cache openvpn~=2.3.18 iptables COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh diff --git a/variants/v2.3.18-alpine-3.4/Dockerfile b/variants/v2.3.18-alpine-3.4/Dockerfile index 9db5379..403c64d 100644 --- a/variants/v2.3.18-alpine-3.4/Dockerfile +++ b/variants/v2.3.18-alpine-3.4/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.4 -RUN apk add --no-cache openvpn=2.3.18-r0 iptables +RUN apk add --no-cache openvpn~=2.3.18 iptables COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh diff --git a/variants/v2.3.18-alpine-3.5/Dockerfile b/variants/v2.3.18-alpine-3.5/Dockerfile index 4e8701b..0641fb2 100644 --- a/variants/v2.3.18-alpine-3.5/Dockerfile +++ b/variants/v2.3.18-alpine-3.5/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.5 -RUN apk add --no-cache openvpn=2.3.18-r0 iptables +RUN apk add --no-cache openvpn~=2.3.18 iptables COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh diff --git a/variants/v2.4.11-alpine-3.10/Dockerfile b/variants/v2.4.11-alpine-3.10/Dockerfile index 04ad899..270c608 100644 --- a/variants/v2.4.11-alpine-3.10/Dockerfile +++ b/variants/v2.4.11-alpine-3.10/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.10 -RUN apk add --no-cache openvpn=2.4.11-r0 iptables +RUN apk add --no-cache openvpn~=2.4.11 iptables COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh diff --git a/variants/v2.4.11-alpine-3.11/Dockerfile b/variants/v2.4.11-alpine-3.11/Dockerfile index 0fe4267..74ccefc 100644 --- a/variants/v2.4.11-alpine-3.11/Dockerfile +++ b/variants/v2.4.11-alpine-3.11/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.11 -RUN apk add --no-cache openvpn=2.4.11-r0 iptables +RUN apk add --no-cache openvpn~=2.4.11 iptables COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh diff --git a/variants/v2.4.12-alpine-3.12/Dockerfile b/variants/v2.4.12-alpine-3.12/Dockerfile index ad9c380..9cfecd8 100644 --- a/variants/v2.4.12-alpine-3.12/Dockerfile +++ b/variants/v2.4.12-alpine-3.12/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.12 -RUN apk add --no-cache openvpn=2.4.12-r0 iptables +RUN apk add --no-cache openvpn~=2.4.12 iptables COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh diff --git a/variants/v2.4.4-alpine-3.6/Dockerfile b/variants/v2.4.4-alpine-3.6/Dockerfile index 2685070..4492ca5 100644 --- a/variants/v2.4.4-alpine-3.6/Dockerfile +++ b/variants/v2.4.4-alpine-3.6/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.6 -RUN apk add --no-cache openvpn=2.4.4-r0 iptables +RUN apk add --no-cache openvpn~=2.4.4 iptables COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh diff --git a/variants/v2.4.4-alpine-3.7/Dockerfile b/variants/v2.4.4-alpine-3.7/Dockerfile index 65a5ba2..0f65106 100644 --- a/variants/v2.4.4-alpine-3.7/Dockerfile +++ b/variants/v2.4.4-alpine-3.7/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.7 -RUN apk add --no-cache openvpn=2.4.4-r1 iptables +RUN apk add --no-cache openvpn~=2.4.4 iptables COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh diff --git a/variants/v2.4.6-alpine-3.8/Dockerfile b/variants/v2.4.6-alpine-3.8/Dockerfile index c04a1d9..d9458e7 100644 --- a/variants/v2.4.6-alpine-3.8/Dockerfile +++ b/variants/v2.4.6-alpine-3.8/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.8 -RUN apk add --no-cache openvpn=2.4.6-r3 iptables +RUN apk add --no-cache openvpn~=2.4.6 iptables COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh diff --git a/variants/v2.4.6-alpine-3.9/Dockerfile b/variants/v2.4.6-alpine-3.9/Dockerfile index d877e34..2d78498 100644 --- a/variants/v2.4.6-alpine-3.9/Dockerfile +++ b/variants/v2.4.6-alpine-3.9/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.9 -RUN apk add --no-cache openvpn=2.4.6-r4 iptables +RUN apk add --no-cache openvpn~=2.4.6 iptables COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh diff --git a/variants/v2.5.8-alpine-3.17/Dockerfile b/variants/v2.5.8-alpine-3.17/Dockerfile index 657e847..a6b27b2 100644 --- a/variants/v2.5.8-alpine-3.17/Dockerfile +++ b/variants/v2.5.8-alpine-3.17/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.17 -RUN apk add --no-cache openvpn=2.5.8-r0 iptables +RUN apk add --no-cache openvpn~=2.5.8 iptables COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh diff --git a/variants/v2.6.5-alpine-3.18/Dockerfile b/variants/v2.6.5-alpine-3.18/Dockerfile index 650a190..d54787e 100644 --- a/variants/v2.6.5-alpine-3.18/Dockerfile +++ b/variants/v2.6.5-alpine-3.18/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.18 -RUN apk add --no-cache openvpn=2.6.5-r0 iptables +RUN apk add --no-cache openvpn~=2.6.5 iptables COPY docker-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh