mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2024-11-25 01:24:04 +01:00
Merge branch 'improve-bump-package-version-to-update-rpm-changelog' into 'master'
Improve bump package version to update rpm changelog See merge request kasm-technologies/internal/KasmVNC!34
This commit is contained in:
commit
92c449d87b
@ -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() {
|
||||
sed -i "s/^Version:.\+/Version: $new_version/" centos/kasmvncserver.spec
|
||||
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"
|
||||
|
23
builder/bump-package-version-deb
Executable file
23
builder/bump-package-version-deb
Executable 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
|
31
builder/bump-package-version-rpm
Executable file
31
builder/bump-package-version-rpm
Executable file
@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
new_version="$1"
|
||||
specs="centos/kasmvncserver.spec
|
||||
oracle/kasmvncserver.spec"
|
||||
|
||||
bump_version() {
|
||||
sed -i "s/^Version:.\+/Version: $new_version/" "$1"
|
||||
}
|
||||
|
||||
detect_release_version() {
|
||||
release_version=$(sed -ne 's/^Release:\s\+//p' "$1" | sed -e 's/%.\+$//')
|
||||
}
|
||||
|
||||
bump_changelog() {
|
||||
detect_release_version "$1"
|
||||
|
||||
local date=$(date +'%a %b %d %Y')
|
||||
local changelog_version="$new_version-$release_version"
|
||||
local new_changelog_entry="* $date KasmTech <info@kasmweb.com> - $changelog_version\n- Upstream release"
|
||||
|
||||
sed -i -e "s/%changelog/%changelog\n$new_changelog_entry/" "$1"
|
||||
}
|
||||
|
||||
IFS=$'\n'
|
||||
for spec_file in $specs; do
|
||||
bump_version $spec_file
|
||||
bump_changelog $spec_file
|
||||
done
|
Loading…
Reference in New Issue
Block a user