Skip to content

Commit

Permalink
Refactor (ci): Use range constraint in apk add for simpler versions
Browse files Browse the repository at this point in the history
  • Loading branch information
leojonathanoh committed Sep 25, 2023
1 parent 35bf0a3 commit e762f79
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 26 deletions.
25 changes: 12 additions & 13 deletions generate/definitions/VARIANTS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 = @(
Expand All @@ -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 = @(
Expand All @@ -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 = @(
Expand All @@ -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 = @(
Expand All @@ -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 = @(
Expand All @@ -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 = @(
Expand All @@ -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 = @(
Expand All @@ -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 = @(
Expand All @@ -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 = @(
Expand All @@ -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 = @(
Expand All @@ -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 = @(
Expand All @@ -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 = @(
Expand All @@ -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 = & {
Expand Down
2 changes: 1 addition & 1 deletion generate/templates/Dockerfile.ps1
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.3.18-alpine-3.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.3.18-alpine-3.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.3.18-alpine-3.5/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.4.11-alpine-3.10/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.4.11-alpine-3.11/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.4.12-alpine-3.12/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.4.4-alpine-3.6/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.4.4-alpine-3.7/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.4.6-alpine-3.8/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.4.6-alpine-3.9/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.5.8-alpine-3.17/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion variants/v2.6.5-alpine-3.18/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit e762f79

Please sign in to comment.