Commit ec6e32f3 authored by Raphael Defosseux's avatar Raphael Defosseux

fix(ci): allowing the branch name to be in contributorName/branchName format

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent eedcf070
...@@ -266,7 +266,8 @@ class Cluster: ...@@ -266,7 +266,8 @@ class Cluster:
baseTag = 'develop' baseTag = 'develop'
forceBaseImageBuild = False forceBaseImageBuild = False
if self.ranAllowMerge: # merging MR branch into develop -> temporary image if self.ranAllowMerge: # merging MR branch into develop -> temporary image
imageTag = f'{self.ranBranch}-{self.ranCommitID[0:8]}' branchName = self.ranBranch.replace('/','-')
imageTag = f'{branchName}-{self.ranCommitID[0:8]}'
if self.ranTargetBranch == 'develop': if self.ranTargetBranch == 'develop':
ret = self.cmd.run(f'git diff HEAD..origin/develop -- cmake_targets/build_oai cmake_targets/tools/build_helper docker/Dockerfile.base.rhel9 | grep --colour=never -i INDEX') ret = self.cmd.run(f'git diff HEAD..origin/develop -- cmake_targets/build_oai cmake_targets/tools/build_helper docker/Dockerfile.base.rhel9 | grep --colour=never -i INDEX')
result = re.search('index', ret.stdout) result = re.search('index', ret.stdout)
......
...@@ -97,7 +97,9 @@ def CreateWorkspace(sshSession, sourcePath, ranRepository, ranCommitID, ranTarge ...@@ -97,7 +97,9 @@ def CreateWorkspace(sshSession, sourcePath, ranRepository, ranCommitID, ranTarge
def ImageTagToUse(imageName, ranCommitID, ranBranch, ranAllowMerge): def ImageTagToUse(imageName, ranCommitID, ranBranch, ranAllowMerge):
shortCommit = ranCommitID[0:8] shortCommit = ranCommitID[0:8]
if ranAllowMerge: if ranAllowMerge:
tagToUse = f'{ranBranch}-{shortCommit}' # Allowing contributor to have a name/branchName format
branchName = ranBranch.replace('/','-')
tagToUse = f'{branchName}-{shortCommit}'
else: else:
tagToUse = f'develop-{shortCommit}' tagToUse = f'develop-{shortCommit}'
fullTag = f'{imageName}:{tagToUse}' fullTag = f'{imageName}:{tagToUse}'
......
...@@ -106,7 +106,8 @@ class PhySim: ...@@ -106,7 +106,8 @@ class PhySim:
if self.ranCommitID != '': if self.ranCommitID != '':
mySSH.command('git checkout -f ' + self.ranCommitID, '\$', 30) mySSH.command('git checkout -f ' + self.ranCommitID, '\$', 30)
if self.ranAllowMerge: if self.ranAllowMerge:
imageTag = f'{self.ranBranch}-{self.ranCommitID[0:8]}' branchName = self.ranBranch.replace('/','-')
imageTag = f'{branchName}-{self.ranCommitID[0:8]}'
if self.ranTargetBranch == '': if self.ranTargetBranch == '':
if (self.ranBranch != 'develop') and (self.ranBranch != 'origin/develop'): if (self.ranBranch != 'develop') and (self.ranBranch != 'origin/develop'):
mySSH.command('git merge --ff origin/develop -m "Temporary merge for CI"', '\$', 30) mySSH.command('git merge --ff origin/develop -m "Temporary merge for CI"', '\$', 30)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment