From 70016e69a2fef3e61a0313707e80ac837e9703a0 Mon Sep 17 00:00:00 2001 From: SerhiiGadzhilov <71632867+SerhiiGadzhilov@users.noreply.github.com> Date: Tue, 29 Dec 2020 15:42:07 +0300 Subject: [PATCH] SYNERGY-400 Make build for every merge (#6888) * SYNERGY-400 Generate build number and create release with tag * SYNERGY-400 Changes for Azure Piplines * Update ChangeLog * SYNERGY-400 Enable not manual build * SYNERGY-400 Removed extra space * SYNERGY-400 Removed extra bracket * SYNERGY-400 Correct conditions * SYNERGY-400 Fix additional condition * SYNERGY-400 Correct to run checks * SYNERGY-400 Fix windows and build number * SYNERGY-400 Fix for old python * SYNERGY-400 Set python version for linux * SYNERGY-400 Fix linux compilation * SYNERGY-400 Fix getting last version for old git * SYNERGY-400 Check python version * SYNERGY-400 Update image for centos8 --- CI/Linux/linux-build.yml | 2 +- CI/MacOS/mac-build.yml | 6 ------ CI/Windows/windows-build.yml | 2 +- CI/build_version.py | 11 +++-------- azure-pipelines.yml | 2 +- 5 files changed, 6 insertions(+), 17 deletions(-) diff --git a/CI/Linux/linux-build.yml b/CI/Linux/linux-build.yml index f67ce5a22..9ff5b9469 100644 --- a/CI/Linux/linux-build.yml +++ b/CI/Linux/linux-build.yml @@ -1,6 +1,6 @@ steps: - script: | - python3 CI/build_version.py + command -v python3 >/dev/null 2>&1 && python3 CI/build_version.py || python CI/build_version.py displayName: 'Update Version.cmake' - script: | diff --git a/CI/MacOS/mac-build.yml b/CI/MacOS/mac-build.yml index da8e7bc81..8bf72c637 100644 --- a/CI/MacOS/mac-build.yml +++ b/CI/MacOS/mac-build.yml @@ -11,12 +11,6 @@ steps: python3 CI/build_version.py displayName: 'Update Version.cmake' - - task: CmdLine@2 - inputs: - script: | - python3 CI/build_version.py - displayName: 'Update Version.cmake' - - task: CmdLine@2 inputs: script: | diff --git a/CI/Windows/windows-build.yml b/CI/Windows/windows-build.yml index 091ac8ce0..160eba06d 100644 --- a/CI/Windows/windows-build.yml +++ b/CI/Windows/windows-build.yml @@ -16,7 +16,7 @@ steps: displayName: 'Set python version' - script: | - python3 CI/build_version.py + python CI/build_version.py displayName: 'Update Version.cmake' - script: | diff --git a/CI/build_version.py b/CI/build_version.py index b3855271c..1c06a73d5 100644 --- a/CI/build_version.py +++ b/CI/build_version.py @@ -62,9 +62,6 @@ class Version: result += str(self.build) return result - def nextBuild(self): - self.build.number += 1 - class VersionFile: def __init__(self, file): self.file = file @@ -82,11 +79,10 @@ class VersionFile: def getVesionFromGit(): - cmd = ('git tag --sort=-creatordate').split() - try: - proccess = subprocess.run(cmd, stdout=subprocess.PIPE, text=True) - versions = proccess.stdout.split() + taggedRevision = subprocess.check_output(('git rev-list --tags --max-count=1').split(), universal_newlines=True) + cmd = ('git describe --tags ' + taggedRevision).split() + versions = subprocess.check_output(cmd, universal_newlines=True).split() print('INFO: Version '+ versions[0] + ' has been read from git') return versions[0] except subprocess.CalledProcessError: @@ -104,6 +100,5 @@ def updateVersionFile(number): if __name__ == '__main__': version = Version(getVesionFromGit()) - version.nextBuild() updateVersionFile(version.build.number) print('INFO: Generate build number is: <' + str(version) + '>') \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2da564a41..6a7ee1c50 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -51,7 +51,7 @@ jobs: packager: rpm name: centos76 centos8: - image: symless/synergy-core:centos8 + image: sgad/synergy-core:centos8 packager: rpm name: centos8