Refactor: extract bump-package-version-deb(1)

This commit is contained in:
Dmitry Maksyoma 2022-03-25 23:59:47 +13:00
parent 3ee95e3150
commit d6d13b59cb
2 changed files with 24 additions and 13 deletions

View File

@ -7,24 +7,12 @@ update_version_to_meet_packaging_standards() {
sed -e 's/\([0-9]\)-\([a-zA-Z]\)/\1~\2/')
}
add_debian_revision_to_new_version() {
echo "$new_version-1"
}
bump_rpm() {
builder/bump-package-version-rpm "$new_version"
}
bump_deb() {
local image="debbump_package_version:dev"
local L_UID=$(id -u)
local L_GID=$(id -g)
local debian_version=$(add_debian_revision_to_new_version)
docker build -t "$image" -f builder/dockerfile.bump-package-version .
docker run --rm -v "$PWD":/src --user "$L_UID:$L_GID" \
"$image" /bin/bash -c \
"cd /src && builder/bump-package-version-inside-docker-deb $debian_version"
builder/bump-package-version-deb "$new_version"
}
new_version="$1"

View File

@ -0,0 +1,23 @@
#!/bin/bash
set -eo pipefail
new_version="$1"
add_debian_revision_to_new_version() {
echo "$new_version-1"
}
bump_deb() {
local image="debbump_package_version:dev"
local L_UID=$(id -u)
local L_GID=$(id -g)
local debian_version=$(add_debian_revision_to_new_version)
docker build -t "$image" -f builder/dockerfile.bump-package-version .
docker run --rm -v "$PWD":/src --user "$L_UID:$L_GID" \
"$image" /bin/bash -c \
"cd /src && builder/bump-package-version-inside-docker-deb $debian_version"
}
bump_deb