Build Number seems stuck.

10 views
Skip to first unread message

Ken Corey

unread,
Oct 6, 2017, 12:38:12 PM10/6/17
to Jenkins Users
Hi All,

First off, I hope this is the right place for silly questions from Jenkins newbies.  If not, please redirect me.

I'm behind a proxy that requires authentication, and I spent a couple days fighting to compile an Android project. I needed gradle to understand how to drill through my proxy.  (solution: in my account's .bash_profile: export http_proxy=http://user:pass@proxyip:proxyport).  I had tried lots of other things to no avail.

Anyway, so when I launch a build, I'm repeatedly told that it's "Build Number 3".  This is strange, as I had over 20 builds in my build history, and those were increasing as expected.  Further, the nextBuildNumber file in the jobs directory seemed to indicate the number I'd expect.

 

If I run this groovy script (hostname:8080/script):
item = Jenkins.instance.getItemByFullName("projectname")
//THIS WILL REMOVE ALL BUILD HISTORY
item.builds.each() { build ->
  build.delete()
}
item.updateNextBuildNumber(1)

The 'nextBuildNumber' is correct, do a build, and get my output email about the BUILD_NUMBER being 3 still.

So, where does BUILD_NUMBER get populated?  If the output from the console output always says 3, and the resulting ${BUILD_NUMBER} in the email sent when the project ends is always 3, how does the rest of the build process function properly?

I've restarted Jenkins a few times, and even restarted the machine.  I can verify that the date/timestamp on the machine is set correctly.

Anyone know how to diagnose/fix this one?

Thanks,

-Ken
Reply all
Reply to author
Forward
0 new messages