allegro / allegro/axion-release-plugin

Cannot add branchName into git tag

Ouverte
#451 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
enhancement
Langage dominant
Groovy
Étoiles
641
Forks
165
Merge moyen
49 min
PR mergées (30 j)
9

Description

Hello!
We have used the plugin for some time with success, however had many issues with **git tags** when two developers were creating two feature branches from master and then having a build in similar time. Task 'release' fails because git tags are having the same name. Therefore, we wanted to add branch name into "tag" block, but there is no explicit option. Implementing serializer and deserializer handles the thing, however the solution is not elegant.

```
scmVersion {
tag {
prefix = 'prefix'
versionSeparator = '-'

serialize = { config, version ->
if (scmPosition.branch != 'master' && scmPosition.branch != 'HEAD') {
return prefix + versionSeparator + version + versionSeparator + scmPosition.branch
} else {
return prefix + versionSeparator + version
}
}

deserialize = { config, position, tagName ->
return tagName.substring(config.prefix.length() + config.versionSeparator.length())
}
}
branchVersionIncrementer = [
'master': 'incrementMinor',
'.*' : 'incrementPatch'
]
}

```
Would you care to create a method that adds git branchName into tag? or point me to the best class where I can create PR?

Thanks!

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.