Skip to content

Commit

Permalink
Merge pull request #1015 from infosiftr/repo-urls
Browse files Browse the repository at this point in the history
Update tools repo handling and update innovation to mysql-shell 8.2.1
  • Loading branch information
yosifkit authored Dec 13, 2023
2 parents dc35bed + 0097ab8 commit 64f9436
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 24 deletions.
6 changes: 2 additions & 4 deletions 5.7/Dockerfile.oracle

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions 8.0/Dockerfile.oracle

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion apply-templates.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -Eeuo pipefail
shopt -s extglob # support globs like !(foo)

[ -f versions.json ] # run "versions.sh" first

Expand Down Expand Up @@ -32,11 +33,14 @@ generated_warning() {
for version; do
export version

rm -f "$version"/Dockerfile.*
rm -f "$version"/!(config)
mkdir -p "$version"

for variant in oracle debian; do
export variant

echo "processing $version ($variant) ..."

variantVersion="$(jq -r '.[env.version][env.variant] // {} | .version // ""' versions.json)"
if [ -n "$variantVersion" ]; then
dockerfile="Dockerfile.$variant"
Expand Down
8 changes: 3 additions & 5 deletions innovation/Dockerfile.oracle
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@ ENV MYSQL_MAJOR innovation
ENV MYSQL_VERSION 8.2.0-1.el8

RUN set -eu; \
. /etc/os-release; \
{ \
echo '[mysqlinnovation-server-minimal]'; \
echo 'name=MySQL innovation Server Minimal'; \
echo 'enabled=1'; \
echo "baseurl=https://repo.mysql.com/yum/mysql-innovation-community/docker/el/${VERSION_ID%%[.-]*}/\$basearch/"; \
echo 'baseurl=https://repo.mysql.com/yum/mysql-innovation-community/docker/el/8/$basearch/'; \
echo 'gpgcheck=1'; \
echo 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql'; \
# https://github.com/docker-library/mysql/pull/680#issuecomment-825930524
Expand Down Expand Up @@ -95,18 +94,17 @@ RUN set -eux; \
mysql --version

RUN set -eu; \
. /etc/os-release; \
{ \
echo '[mysql-tools-community]'; \
echo 'name=MySQL Tools Community'; \
echo "baseurl=https://repo.mysql.com/yum/mysql-tools-community/el/${VERSION_ID%%[.-]*}/\$basearch/"; \
echo 'baseurl=https://repo.mysql.com/yum/mysql-tools-innovation-community/el/8/$basearch/'; \
echo 'enabled=1'; \
echo 'gpgcheck=1'; \
echo 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql'; \
# https://github.com/docker-library/mysql/pull/680#issuecomment-825930524
echo 'module_hotfixes=true'; \
} | tee /etc/yum.repos.d/mysql-community-tools.repo
ENV MYSQL_SHELL_VERSION 8.0.35-1.el8
ENV MYSQL_SHELL_VERSION 8.2.1-1.el8
RUN set -eux; \
microdnf install -y "mysql-shell-$MYSQL_SHELL_VERSION"; \
microdnf clean all; \
Expand Down
6 changes: 2 additions & 4 deletions template/Dockerfile.oracle
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,11 @@ ENV MYSQL_MAJOR {{ env.version }}
ENV MYSQL_VERSION {{ .oracle.version }}

RUN set -eu; \
. /etc/os-release; \
{ \
echo '[mysql{{ env.version }}-server-minimal]'; \
echo 'name=MySQL {{ env.version }} Server Minimal'; \
echo 'enabled=1'; \
echo "baseurl=https://repo.mysql.com/yum/mysql-{{ env.version }}-community/docker/el/${VERSION_ID%%[.-]*}/\$basearch/"; \
echo {{ "baseurl=" + .oracle.repo + "/$basearch/" | @sh }}; \
echo 'gpgcheck=1'; \
echo 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql'; \
# https://github.com/docker-library/mysql/pull/680#issuecomment-825930524
Expand Down Expand Up @@ -121,11 +120,10 @@ RUN set -eux; \
mysql --version

RUN set -eu; \
. /etc/os-release; \
{ \
echo '[mysql-tools-community]'; \
echo 'name=MySQL Tools Community'; \
echo "baseurl=https://repo.mysql.com/yum/mysql-tools-community/el/${VERSION_ID%%[.-]*}/\$basearch/"; \
echo {{ "baseurl=" + .["mysql-shell"].repo + "/$basearch/" | @sh }}; \
echo 'enabled=1'; \
echo 'gpgcheck=1'; \
echo 'gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql'; \
Expand Down
8 changes: 7 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"5.7": {
"mysql-shell": {
"repo": "https://repo.mysql.com/yum/mysql-tools-community/el/7",
"version": "8.0.35-1.el7"
},
"oracle": {
"architectures": [
"amd64"
],
"repo": "https://repo.mysql.com/yum/mysql-5.7-community/docker/el/7",
"variant": "7-slim",
"version": "5.7.44-1.el7"
},
Expand All @@ -21,27 +23,31 @@
"version": "8.0.35-1debian11"
},
"mysql-shell": {
"repo": "https://repo.mysql.com/yum/mysql-tools-community/el/8",
"version": "8.0.35-1.el8"
},
"oracle": {
"architectures": [
"amd64",
"arm64v8"
],
"repo": "https://repo.mysql.com/yum/mysql-8.0-community/docker/el/8",
"variant": "8-slim",
"version": "8.0.35-1.el8"
},
"version": "8.0.35"
},
"innovation": {
"mysql-shell": {
"version": "8.0.35-1.el8"
"repo": "https://repo.mysql.com/yum/mysql-tools-innovation-community/el/8",
"version": "8.2.1-1.el8"
},
"oracle": {
"architectures": [
"amd64",
"arm64v8"
],
"repo": "https://repo.mysql.com/yum/mysql-innovation-community/docker/el/8",
"variant": "8-slim",
"version": "8.2.0-1.el8"
},
Expand Down
20 changes: 15 additions & 5 deletions versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,22 @@ for version in "${versions[@]}"; do

oracleVariant="${oracleVariants[$version]:-$defaultOracleVariant}"
oracleVersion="${oracleVariant%%-*}" # "7", etc

rpmRepo="https://repo.mysql.com/yum/mysql-$version-community/docker/el/$oracleVersion"
case "$version" in
innovation) toolsRepo="https://repo.mysql.com/yum/mysql-tools-innovation-community/el/$oracleVersion" ;;
*) toolsRepo="https://repo.mysql.com/yum/mysql-tools-community/el/$oracleVersion" ;;
esac
export rpmRepo toolsRepo

rpmVersion=
shellVersion=
doc="$(jq <<<"$doc" -c '. += { oracle: { architectures: [] } }')"
doc="$(jq <<<"$doc" -c '. += {
oracle: { architectures: [], repo: env.rpmRepo },
"mysql-shell": { repo: env.toolsRepo },
}')"
for bashbrewArch in $(xargs -n1 <<<"${!bashbrewArchToRpmArch[*]}" | sort | xargs); do
rpmArch="${bashbrewArchToRpmArch[$bashbrewArch]}"
rpmRepo="https://repo.mysql.com/yum/mysql-$version-community/docker/el/$oracleVersion"
archVersions="$(
fetch_rpm_versions "$rpmRepo" "$rpmArch" "$oracleVersion" 'mysql-community-server-minimal' \
|| :
Expand All @@ -121,7 +131,7 @@ for version in "${versions[@]}"; do
echo >&2 "error: $version architecture version mismatch! ('$rpmVersion' vs '$archVersion' on '$rpmArch'/'$bashbrewArch')"
exit 1
fi
shellArchVersions="$(fetch_rpm_versions "https://repo.mysql.com/yum/mysql-tools-community/el/$oracleVersion" "$rpmArch" "$oracleVersion" 'mysql-shell')"
shellArchVersions="$(fetch_rpm_versions "$toolsRepo" "$rpmArch" "$oracleVersion" 'mysql-shell')"
shellArchVersion="$(head -1 <<<"$shellArchVersions")"
if [ -z "$shellVersion" ]; then
shellVersion="$shellArchVersion"
Expand Down Expand Up @@ -152,9 +162,9 @@ for version in "${versions[@]}"; do
version: env.rpmVersion,
variant: env.oracleVariant,
}),
"mysql-shell": {
"mysql-shell": (.["mysql-shell"] + {
version: env.shellVersion,
},
}),
}
')"

Expand Down

0 comments on commit 64f9436

Please sign in to comment.