Skip to content

Commit

Permalink
release.sh: separate script for package versions list
Browse files Browse the repository at this point in the history
Signed-off-by: Thilo Fromm <[email protected]>
  • Loading branch information
t-lo committed May 30, 2024
1 parent a1545f9 commit 68edc5b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
22 changes: 22 additions & 0 deletions package_versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
#
# List versions of relevant packages in mailserver container.
#

set -euo pipefail

container="${1:-ghcr.io/t-lo/mailserver:latest}"
packages_file="${2:-release_package_versions.list}"

while read -u 9 line; do
name="${line%,*}"
cmd="${line#*,}"
echo -n "* ${name}: "
docker run --entrypoint /bin/bash --rm -i "${container}" -l -c "${cmd}"
done 9<"${packages_file}"

echo -n "* Postfix prometheus exporter: "
sed -n 's/.*postfix_exporter_version=//p' Dockerfile

echo -n "* Fail2Ban prometheus exporter: "
sed -n 's/.*fail2ban_exporter_version=//p' Dockerfile
15 changes: 1 addition & 14 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,7 @@ docker build --pull -t "${container}:${version}" .
docker tag "${container}:${version}" "${container}:latest"

yell "Querying version information"
{
while read -u 9 line; do
name="${line%,*}"
cmd="${line#*,}"
echo -n "* ${name}: "
docker run --entrypoint /bin/bash --rm -i "${container}:${version}" -l -c "${cmd}"
done 9<release_package_versions.list

echo -n "* Postfix prometheus exporter: "
sed -n 's/.*postfix_exporter_version=//p' Dockerfile

echo -n "* Fail2Ban prometheus exporter: "
sed -n 's/.*fail2ban_exporter_version=//p' Dockerfile
} > PACKAGE_VERSIONS
./package_versions.sh "${container}:${version}" release_package_versions.list | tee PACKAGE_VERSIONS

yell "Creating the release tarball"
echo "${version}" >VERSION
Expand Down

0 comments on commit 68edc5b

Please sign in to comment.