2021-03-15 09:33:57 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
os="$1"
|
|
|
|
codename="$2"
|
2021-09-07 14:11:21 +02:00
|
|
|
build_tag="$3"
|
2021-03-15 09:33:57 +01:00
|
|
|
|
|
|
|
detect_package_format() {
|
|
|
|
package_format=rpm
|
|
|
|
if ls builder/dockerfile*"$os"* | grep -q .deb.build; then
|
|
|
|
package_format=deb
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2021-09-07 14:11:21 +02:00
|
|
|
warn_build_tag_not_supported_for_rpm_and_exit() {
|
|
|
|
if [[ "$build_tag" && "$package_format" = "rpm" ]]; then
|
|
|
|
echo >&2 "<build_tag> isn't supported for rpm"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2021-03-15 09:33:57 +01:00
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
|
|
|
detect_package_format
|
2021-09-07 14:11:21 +02:00
|
|
|
warn_build_tag_not_supported_for_rpm_and_exit
|
|
|
|
|
|
|
|
builder/build-tarball "$os" "$codename" "$build_tag"
|
|
|
|
builder/build-${package_format} "$os" "$codename" "$build_tag"
|