Skip to content
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

LAST_TAG not working #48

Open
asherungar-ceva opened this issue Jul 17, 2018 · 5 comments
Open

LAST_TAG not working #48

asherungar-ceva opened this issue Jul 17, 2018 · 5 comments

Comments

@asherungar-ceva
Copy link

Hi,

i might be using it wrong but i want to see all changes between current build and last build that has a tag (any tag?), and if i understand correctly the "LAST_TAG" is according to the jenkins builds tags, not the git tags?

using the syntax below still only gives me changes since last build, not since the last tag. am i using it wrong?
thanks
Asher

using:
def publisher = LastChanges.getLastChangesPublisher "LAST_TAG", "SIDE", "LINE", true, true, "", "", "", "", ""
publisher.publishLastChanges()
def changes = publisher.getLastChanges()
println(changes.getEscapedDiff())
for (commit in changes.getCommits()) {
println(commit)
def commitInfo = commit.getCommitInfo()
println(commitInfo)
println(commitInfo.getCommitMessage())
println(commit.getChanges())
}

@rmpestano
Copy link
Contributor

rmpestano commented Jul 17, 2018

Hi,

the "LAST_TAG" is according to the jenkins builds tags, not the git tags?

it is based on the git tags, do you have a public git repo which the plugin is failing to get LAST_TAG?

@rmpestano
Copy link
Contributor

rmpestano commented Jul 17, 2018

Also, can you try via declarative pipeline DSL:

 post {
        always {
               lastChanges(since: 'LAST_TAG')
         }
}

@asherungar-ceva
Copy link
Author

Hi,
no, the repo is not public. do i just use the command line as above? or do i need to tell it which tag name to search for?
and i want to get a list of commits since last tag. and lets say save them to a file for a different script to analyze them, if possible to also get which repo. something like:

repo 1 - 485ec8cb0b415119b99a29547530a3d0f6a01841
repo 2 - f4be30ebd93e35baaeb515947450723e61d9be8c

something like that.

@asherungar-ceva
Copy link
Author

but let's start from the last_tag not working.
i changed the lines i wrote in the first comment to just:
lastChanges(since: 'LAST_TAG')

and still it just shows me changes from last build, not since the last tag on this git repo.
i'm using the multi-branch pipeline plugin

@rmpestano
Copy link
Contributor

rmpestano commented Jul 17, 2018

i'm using the multi-branch pipeline plugin

Probably that's the issue, I don't have experience with multi-branch pipeline and never used nor tested the plugin in such situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants