From 1cf80c3ba0e692234ebc2ebf39924ce8ca88fbfc Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Thu, 22 Nov 2018 21:44:32 +0100 Subject: [PATCH] Added release_info to build output instead of only in the debian package. --- build.sh | 14 ++++++++++++-- distribution/debian.sh | 1 - distribution/debian/install | 1 - 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 1f26a7534..0f3fbf7ac 100755 --- a/build.sh +++ b/build.sh @@ -42,11 +42,20 @@ ProgressEnd() UpdateVersionNumber() { if [ "$BUILD_NUMBER" != "" ]; then + echo "Updating Version Info" verMajorMinorRevision=`echo "$buildVersion" | cut -d. -f1,2,3` - verBuild=`echo "$BUILD_NUMBER" | cut -d. -f4` + verBuild=`echo "${BUILD_NUMBER}" | cut -d. -f4` BUILD_NUMBER=$verMajorMinorRevision.$verBuild echo "##teamcity[buildNumber '$BUILD_NUMBER']" - sed -i "s/^[[]assembly: Assembly\(File\|Informational\)\?Version[(]\"[0-9.*]\+\"[)]/[assembly: Assembly\1Version(\"$BUILD_NUMBER\")/g" ./src/**/Properties/AssemblyInfo.cs ./src/Common/CommonVersionInfo.cs + sed -i "s/^[[]assembly: Assembly\(File\|Informational\)\?Version[(]\"[0-9.*]\+\"[)]/[assembly: Assembly\1Version(\"$BUILD_NUMBER\")/g" ./src/NzbDrone*/Properties/AssemblyInfo.cs ./src/Sonarr*/Properties/AssemblyInfo.cs ./src/ServiceHelpers/Properties/AssemblyInfo.cs ./src/Common/CommonVersionInfo.cs + fi +} + +CreateReleaseInfo() +{ + if [ "$BUILD_NUMBER" != "" ]; then + echo "Create Release Info" + echo -e "# Do Not Edit\nReleaseVersion=$BUILD_NUMBER\nBranch=${BRANCH:-dev}" > $outputFolder/release_info fi } @@ -336,6 +345,7 @@ esac UpdateVersionNumber Build +CreateReleaseInfo RunGulp PackageMono PackageMacOS diff --git a/distribution/debian.sh b/distribution/debian.sh index eaf536134..d80022b3e 100644 --- a/distribution/debian.sh +++ b/distribution/debian.sh @@ -18,7 +18,6 @@ echo Updating changelog for $BuildVersion sed -i "s:{version}:$BuildVersion:g; s:{branch}:$BuildBranch:g;" debian/changelog sed -i "s:{version}:$BuildVersion:g; s:{updater}:$PackageUpdater:g" debian/preinst debian/postinst debian/postrm sed -i '/#BEGIN BUILTIN UPDATER/,/#END BUILTIN UPDATER/d' debian/preinst debian/postinst debian/postrm -echo "# Do Not Edit\nReleaseVersion=$BuildVersion\nBranch=$BuildBranch" > release_info echo "# Do Not Edit\nPackageVersion=$BuildVersion\nReleaseVersion=$BuildVersion\nUpdateMethod=$PackageUpdater\nBranch=$BuildBranch" > package_info echo Running debuild for $BuildVersion diff --git a/distribution/debian/install b/distribution/debian/install index 803796de0..a09cfdbad 100644 --- a/distribution/debian/install +++ b/distribution/debian/install @@ -1,3 +1,2 @@ sonarr_bin/* /usr/lib/sonarr/bin -release_info /usr/lib/sonarr/bin package_info /usr/lib/sonarr