update.sh: Bake GPG key, sha256 and version directly into Dockerfiles

Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
This commit is contained in:
Daniel Rudolf
2023-06-01 16:22:09 +02:00
parent f650628a76
commit 5239485cfc
3 changed files with 9 additions and 6 deletions
+3 -3
View File
@@ -78,7 +78,7 @@ LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
org.opencontainers.image.vendor="phpMyAdmin" \
org.opencontainers.image.documentation="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.licenses="GPL-2.0-only" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.version="%%VERSION%%" \
org.opencontainers.image.url="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git"
@@ -89,10 +89,10 @@ RUN set -ex; \
; \
\
export GNUPGHOME="$(mktemp -d)"; \
export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \
export GPGKEY="%%GPG_KEY%%"; \
curl -fsSL -o phpMyAdmin.tar.xz "%%DOWNLOAD_URL%%"; \
curl -fsSL -o phpMyAdmin.tar.xz.asc "%%DOWNLOAD_URL_ASC%%"; \
echo "$SHA256 *phpMyAdmin.tar.xz" | sha256sum -c -; \
echo "%%SHA256%% *phpMyAdmin.tar.xz" | sha256sum -c -; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPGKEY" \
+3 -3
View File
@@ -80,7 +80,7 @@ LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
org.opencontainers.image.vendor="phpMyAdmin" \
org.opencontainers.image.documentation="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.licenses="GPL-2.0-only" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.version="%%VERSION%%" \
org.opencontainers.image.url="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git"
@@ -96,10 +96,10 @@ RUN set -ex; \
; \
\
export GNUPGHOME="$(mktemp -d)"; \
export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \
export GPGKEY="%%GPG_KEY%%"; \
curl -fsSL -o phpMyAdmin.tar.xz "%%DOWNLOAD_URL%%"; \
curl -fsSL -o phpMyAdmin.tar.xz.asc "%%DOWNLOAD_URL_ASC%%"; \
echo "$SHA256 *phpMyAdmin.tar.xz" | sha256sum -c -; \
echo "%%SHA256%% *phpMyAdmin.tar.xz" | sha256sum -c -; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPGKEY" \
+3
View File
@@ -19,6 +19,8 @@ declare -A base=(
[fpm-alpine]='alpine'
)
gpg_key='3D06A59ECE730EB71B511C17CE752F178259BD92'
function download_url() {
echo "https://files.phpmyadmin.net/phpMyAdmin/$1/phpMyAdmin-$1-all-languages.tar.xz"
}
@@ -43,6 +45,7 @@ function create_variant() {
s/%%SHA256%%/'"$sha256"'/;
s/%%DOWNLOAD_URL%%/'"$(sed -e 's/[\/&]/\\&/g' <<< "$url")"'/;
s/%%DOWNLOAD_URL_ASC%%/'"$(sed -e 's/[\/&]/\\&/g' <<< "$ascUrl")"'/;
s/%%GPG_KEY%%/'"$gpg_key"'/g;
s/%%VARIANT%%/'"$variant"'/;
s/%%CMD%%/'"${cmd[$variant]}"'/;
' "$variant/Dockerfile"