Skip to content

Commit 5373612

Browse files
authored
Merge pull request #262 from infosiftr/jq-template
Add initial jq-based templating engine
2 parents 66c83a5 + 12d1c27 commit 5373612

21 files changed

+489
-357
lines changed

.architectures-lib

Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Verify Templating
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
defaults:
8+
run:
9+
shell: 'bash -Eeuo pipefail -x {0}'
10+
11+
jobs:
12+
apply-templates:
13+
name: Check For Uncomitted Changes
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Apply Templates
18+
run: ./apply-templates.sh
19+
- name: Check Git Status
20+
run: |
21+
status="$(git status --short)"
22+
[ -z "$status" ]

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.jq-template.awk

19.03-rc/Dockerfile

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
17
FROM alpine:3.12
28

39
RUN apk add --no-cache \
@@ -11,32 +17,31 @@ RUN apk add --no-cache \
1117
# - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf
1218
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf
1319

14-
ENV DOCKER_CHANNEL test
1520
ENV DOCKER_VERSION 19.03.13-beta2
1621
# TODO ENV DOCKER_SHA256
1722
# https://github.com/docker/docker-ce/blob/5b073ee2cf564edee5adca05eee574142f7627bb/components/packaging/static/hash_files !!
1823
# (no SHA file artifacts on download.docker.com yet as of 2017-06-07 though)
1924

2025
RUN set -eux; \
2126
\
22-
# this "case" statement is generated via "update.sh"
2327
apkArch="$(apk --print-arch)"; \
2428
case "$apkArch" in \
25-
# amd64
26-
x86_64) dockerArch='x86_64' ;; \
27-
# arm32v6
28-
armhf) dockerArch='armel' ;; \
29-
# arm32v7
30-
armv7) dockerArch='armhf' ;; \
31-
# arm64v8
32-
aarch64) dockerArch='aarch64' ;; \
33-
*) echo >&2 "error: unsupported architecture ($apkArch)"; exit 1 ;;\
29+
'x86_64') \
30+
url='https://download.docker.com/linux/static/test/x86_64/docker-19.03.13-beta2.tgz'; \
31+
;; \
32+
'armhf') \
33+
url='https://download.docker.com/linux/static/test/armel/docker-19.03.13-beta2.tgz'; \
34+
;; \
35+
'armv7') \
36+
url='https://download.docker.com/linux/static/test/armhf/docker-19.03.13-beta2.tgz'; \
37+
;; \
38+
'aarch64') \
39+
url='https://download.docker.com/linux/static/test/aarch64/docker-19.03.13-beta2.tgz'; \
40+
;; \
41+
*) echo >&2 "error: unsupported architecture ($apkArch)"; exit 1 ;; \
3442
esac; \
3543
\
36-
if ! wget -O docker.tgz "https://download.docker.com/linux/static/${DOCKER_CHANNEL}/${dockerArch}/docker-${DOCKER_VERSION}.tgz"; then \
37-
echo >&2 "error: failed to download 'docker-${DOCKER_VERSION}' from '${DOCKER_CHANNEL}' for '${dockerArch}'"; \
38-
exit 1; \
39-
fi; \
44+
wget -O docker.tgz "$url"; \
4045
\
4146
tar --extract \
4247
--file docker.tgz \

19.03-rc/dind-rootless/Dockerfile

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
17
FROM docker:19.03-rc-dind
28

39
# busybox "ip" is insufficient:
@@ -15,24 +21,15 @@ RUN set -eux; \
1521

1622
RUN set -eux; \
1723
\
18-
# this "case" statement is generated via "update.sh"
1924
apkArch="$(apk --print-arch)"; \
2025
case "$apkArch" in \
21-
# amd64
22-
x86_64) dockerArch='x86_64' ;; \
23-
# arm32v6
24-
armhf) dockerArch='armel' ;; \
25-
# arm32v7
26-
armv7) dockerArch='armhf' ;; \
27-
# arm64v8
28-
aarch64) dockerArch='aarch64' ;; \
29-
*) echo >&2 "error: unsupported architecture ($apkArch)"; exit 1 ;;\
26+
'x86_64') \
27+
url='https://download.docker.com/linux/static/test/x86_64/docker-rootless-extras-19.03.13-beta2.tgz'; \
28+
;; \
29+
*) echo >&2 "error: unsupported architecture ($apkArch)"; exit 1 ;; \
3030
esac; \
3131
\
32-
if ! wget -O rootless.tgz "https://download.docker.com/linux/static/${DOCKER_CHANNEL}/${dockerArch}/docker-rootless-extras-${DOCKER_VERSION}.tgz"; then \
33-
echo >&2 "error: failed to download 'docker-rootless-extras-${DOCKER_VERSION}' from '${DOCKER_CHANNEL}' for '${dockerArch}'"; \
34-
exit 1; \
35-
fi; \
32+
wget -O rootless.tgz "$url"; \
3633
\
3734
tar --extract \
3835
--file rootless.tgz \

19.03-rc/dind/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
17
FROM docker:19.03-rc
28

39
# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#runtime-dependencies

19.03-rc/git/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
17
FROM docker:19.03-rc
28

39
RUN apk add --no-cache git

19.03/Dockerfile

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
17
FROM alpine:3.12
28

39
RUN apk add --no-cache \
@@ -11,32 +17,31 @@ RUN apk add --no-cache \
1117
# - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf
1218
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf
1319

14-
ENV DOCKER_CHANNEL stable
1520
ENV DOCKER_VERSION 19.03.13
1621
# TODO ENV DOCKER_SHA256
1722
# https://github.com/docker/docker-ce/blob/5b073ee2cf564edee5adca05eee574142f7627bb/components/packaging/static/hash_files !!
1823
# (no SHA file artifacts on download.docker.com yet as of 2017-06-07 though)
1924

2025
RUN set -eux; \
2126
\
22-
# this "case" statement is generated via "update.sh"
2327
apkArch="$(apk --print-arch)"; \
2428
case "$apkArch" in \
25-
# amd64
26-
x86_64) dockerArch='x86_64' ;; \
27-
# arm32v6
28-
armhf) dockerArch='armel' ;; \
29-
# arm32v7
30-
armv7) dockerArch='armhf' ;; \
31-
# arm64v8
32-
aarch64) dockerArch='aarch64' ;; \
33-
*) echo >&2 "error: unsupported architecture ($apkArch)"; exit 1 ;;\
29+
'x86_64') \
30+
url='https://download.docker.com/linux/static/stable/x86_64/docker-19.03.13.tgz'; \
31+
;; \
32+
'armhf') \
33+
url='https://download.docker.com/linux/static/stable/armel/docker-19.03.13.tgz'; \
34+
;; \
35+
'armv7') \
36+
url='https://download.docker.com/linux/static/stable/armhf/docker-19.03.13.tgz'; \
37+
;; \
38+
'aarch64') \
39+
url='https://download.docker.com/linux/static/stable/aarch64/docker-19.03.13.tgz'; \
40+
;; \
41+
*) echo >&2 "error: unsupported architecture ($apkArch)"; exit 1 ;; \
3442
esac; \
3543
\
36-
if ! wget -O docker.tgz "https://download.docker.com/linux/static/${DOCKER_CHANNEL}/${dockerArch}/docker-${DOCKER_VERSION}.tgz"; then \
37-
echo >&2 "error: failed to download 'docker-${DOCKER_VERSION}' from '${DOCKER_CHANNEL}' for '${dockerArch}'"; \
38-
exit 1; \
39-
fi; \
44+
wget -O docker.tgz "$url"; \
4045
\
4146
tar --extract \
4247
--file docker.tgz \

19.03/dind-rootless/Dockerfile

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
17
FROM docker:19.03-dind
28

39
# busybox "ip" is insufficient:
@@ -15,24 +21,15 @@ RUN set -eux; \
1521

1622
RUN set -eux; \
1723
\
18-
# this "case" statement is generated via "update.sh"
1924
apkArch="$(apk --print-arch)"; \
2025
case "$apkArch" in \
21-
# amd64
22-
x86_64) dockerArch='x86_64' ;; \
23-
# arm32v6
24-
armhf) dockerArch='armel' ;; \
25-
# arm32v7
26-
armv7) dockerArch='armhf' ;; \
27-
# arm64v8
28-
aarch64) dockerArch='aarch64' ;; \
29-
*) echo >&2 "error: unsupported architecture ($apkArch)"; exit 1 ;;\
26+
'x86_64') \
27+
url='https://download.docker.com/linux/static/stable/x86_64/docker-rootless-extras-19.03.13.tgz'; \
28+
;; \
29+
*) echo >&2 "error: unsupported architecture ($apkArch)"; exit 1 ;; \
3030
esac; \
3131
\
32-
if ! wget -O rootless.tgz "https://download.docker.com/linux/static/${DOCKER_CHANNEL}/${dockerArch}/docker-rootless-extras-${DOCKER_VERSION}.tgz"; then \
33-
echo >&2 "error: failed to download 'docker-rootless-extras-${DOCKER_VERSION}' from '${DOCKER_CHANNEL}' for '${dockerArch}'"; \
34-
exit 1; \
35-
fi; \
32+
wget -O rootless.tgz "$url"; \
3633
\
3734
tar --extract \
3835
--file rootless.tgz \

19.03/dind/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
17
FROM docker:19.03
28

39
# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#runtime-dependencies

0 commit comments

Comments
 (0)