Skip to content

Commit e68cbb8

Browse files
committed
Add versions.json
'versions.json' contains information about the latest branches (currently phpMyAdmin 5.2 only) and variants. It was inspired by PHP's official Docker image and is managed by `update.sh`. There's no need to edit this file manually, just run `update.sh`. Signed-off-by: Daniel Rudolf <[email protected]>
1 parent 5ee9a9c commit e68cbb8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

update.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ function create_variant() {
6868

6969
# Copy config.inc.php
7070
cp config.inc.php "$variant/config.inc.php"
71+
72+
# Add variant to versions.json
73+
versionVariantsJson="$(jq -e \
74+
--arg branch "$branch" --arg variant "$variant" --arg base "${base[$variant]}" --arg phpVersion "$phpVersion" \
75+
'.[$branch].variants[$variant] = {"variant": $variant, "base": $base, "phpVersion": $phpVersion}' versions.json)"
76+
versionJson="$(jq -e \
77+
--arg branch "$branch" --arg version "$version" --arg sha256 "$sha256" --arg url "$url" --arg ascUrl "$ascUrl" --argjson variants "$versionVariantsJson" \
78+
'.[$branch] = {"branch": $branch, "version": $version, "sha256": $sha256, "url": $url, "ascUrl": $ascUrl, "variants": $variants[$branch].variants}' versions.json)"
79+
printf '%s\n' "$versionJson" > versions.json
7180
}
7281

7382
# Check script dependencies
@@ -77,6 +86,8 @@ command -v jq >/dev/null 2>&1 || { echo >&2 "'jq' is required but not found. Abo
7786
|| { echo >&2 "Bash 4.0 or greater is required. Aborting."; exit 1; }
7887

7988
# Create variants
89+
printf '%s\n' "{}" > versions.json
90+
8091
latest="$(curl -fsSL "https://www.phpmyadmin.net/home_page/version.json" | jq -r '.version')"
8192
sha256="$(curl -fsSL "$(download_url "$latest").sha256" | cut -f1 -d ' ' | tr -cd 'a-f0-9' | cut -c 1-64)"
8293

versions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)