edgexfoundry / cd-management

Owner: DevOps WG
5 stars 14 forks source link

EdgeX DevOps: release automation fails to bump semver tag when re-releasing a repo with the same version #115

Open soda480 opened 3 years ago

soda480 commented 3 years ago

I have a git semver issue. I noticed on device-bacnet-c (https://github.com/edgexfoundry/device-bacnet-c/blob/semver/master) Jenkins didn't bump to 1.3.1-dev.1 after 1.3.0 was released back in Nov 18th so it has been stuck for a while.

The build fails to bump with this message: 14:37:23 [edgeXSemver]: ignoring command bump pre because GITSEMVER_HEAD_TAG is already set to 'v1.3.0'

https://jenkins.edgexfoundry.org/job/edgexfoundry/job/device-bacnet-c/job/master/13/consoleFull

The release build from cd-management tried bumping it too but says the same thing: [2020-11-18T21:38:04.818Z] [edgeXSemver]: ignoring command bump -pre=dev pre because GITSEMVER_HEAD_TAG is already set to 'v1.3.0'

https://jenkins.edgexfoundry.org/blue/organizations/jenkins/edgexfoundry%2Fcd-management/detail/release/40/pipeline/312 master 1.3.0

soda480 commented 3 years ago

I think this is happening because of cross-pollution of the GITSEMVER_HEAD_TAG environment variable. It is specifically happening when a release is re-run; HEAD is tagged with the release version and edgeXSemver sets the GITSEMVER_HEAD_TAG environment variable which essentially results in all subsequent edgeXSemver non-init commands to be ignored.

The GITSEMVER_HEAD_TAG environment variable should be unset prior to executing the "Bump Semver" in edgeXRelease.