-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use awk/sed to replace version #698
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a lot quicker so let's go with it.
@dduportal is fixing the bug in update cli which is making the shell script not work once you add SCM
here is a powershell version of it. Much more precise, works on pwsh.
$file = "./sample-plugin/pom.xml"
$pomXml = New-Object System.Xml.XmlDocument
$pomXml.PreserveWhitespace = $true
$pomXml.Load($file)
$existingVersion = $pomXml.project.properties.'jenkins.version'
$newVersion = $args[0]
if ($existingVersion -ine $newVersion) {
$pomXml.project.properties.'jenkins.version' = $newVersion
$pomXml.Save($file)
} |
sure go for it |
|
path is correct so maybe it is how updatecli parses arguments |
Most likely related to the scm thing not setting the correct working directory? |
you should be able to test this part locally just fine :) |
Working directory is off, the folder does not even exist.
|
to be fair, I never tried using powershell for the |
Well the issue seems to be that the scm part of it is not working ie. checking out the repo before trying to diff/apply |
A fix had been released: https://github.com/updatecli/updatecli/releases/tag/v0.12.0 (tested with the shell version, before this PR). |
the awk uses exit to match only first occurence and sed expects weekly to only be a major.minor version number.
If those condition are okay to assume this might be simpler than invoking maven.
Since this is running on a github runner, perl or powershell 7 (pwsh) might be a better tool to update the version number.