Merge pull request #4259 from yandex/manual_release_revision

Add ability to set version in release_lib.sh via env variables
This commit is contained in:
alexey-milovidov 2019-02-05 00:11:14 +03:00 committed by GitHub
commit 61e7ef31b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,6 +57,8 @@ function gen_revision_author {
fi fi
VERSION_PATCH=$(($VERSION_PATCH + 1)) VERSION_PATCH=$(($VERSION_PATCH + 1))
elif [ "$TYPE" == "env" ]; then
echo "Will build revision from env variables -- $VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH"
else else
echo "Unknown version type $TYPE" echo "Unknown version type $TYPE"
exit 1 exit 1
@ -98,27 +100,35 @@ function gen_revision_author {
gen_dockerfiles "$VERSION_STRING" gen_dockerfiles "$VERSION_STRING"
dbms/src/Storages/System/StorageSystemContributors.sh ||: dbms/src/Storages/System/StorageSystemContributors.sh ||:
git commit -m "$auto_message [$VERSION_STRING] [$VERSION_REVISION]" dbms/cmake/version.cmake debian/changelog docker/*/Dockerfile dbms/src/Storages/System/StorageSystemContributors.generated.cpp git commit -m "$auto_message [$VERSION_STRING] [$VERSION_REVISION]" dbms/cmake/version.cmake debian/changelog docker/*/Dockerfile dbms/src/Storages/System/StorageSystemContributors.generated.cpp
git push if [ -z $NO_PUSH ]; then
git push
fi
echo "Generated version: ${VERSION_STRING}, revision: ${VERSION_REVISION}." echo "Generated version: ${VERSION_STRING}, revision: ${VERSION_REVISION}."
# Second tag for correct version information in version.cmake inside tag # Second tag for correct version information in version.cmake inside tag
if git tag --force -a "$tag" -m "$tag" if git tag --force -a "$tag" -m "$tag"
then then
echo -e "\nTrying to push tag to origin: $tag" if [ -z $NO_PUSH ]; then
git push origin "$tag" echo -e "\nTrying to push tag to origin: $tag"
if [ $? -ne 0 ] git push origin "$tag"
then if [ $? -ne 0 ]
git tag -d "$tag" then
echo "Fail to create tag" git tag -d "$tag"
exit 1 echo "Fail to create tag"
exit 1
fi
fi fi
fi fi
# Reset testing branch to current commit. # Reset testing branch to current commit.
git checkout testing git checkout testing
git reset --hard "$tag" git reset --hard "$tag"
git push
if [ -z $NO_PUSH ]; then
git push
fi
else else
get_version get_version