# Can i reset circle build number?

**URL:** <https://discuss.circleci.com/t/can-i-reset-circle-build-number/1019>\
**Category:** Build Environment\
**Created:** [December 9, 2015, 11:21am UTC](https://discuss.circleci.com/t/can-i-reset-circle-build-number/1019 "2015-12-09T11:21:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![eyal\_rounds](https://avatars.discourse-cdn.com/v4/letter/e/73ab20/32.png) [@eyal\_rounds](https://discuss.circleci.com/u/eyal_rounds)\
**Post date:** [December 9, 2015, 11:21am UTC](https://discuss.circleci.com/t/can-i-reset-circle-build-number/1019/1 "2015-12-09T11:21:18Z")

</div>

i want to reset the circle build number every time i make a release.  
i can use mod $((CIRCLE\_BUILD\_NUM % 1000)) to limit it to my count, but i want it to be consistent from release to release (it’s not used for release just for dev builds, release has his own count).

BTW i believe if i close my project and reopen the build count will zero out, but i don’t really want to close and open projects on weekly basis…

---

<div class="post-metadata">

**Author:** ![alexey](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/alexey/32/42_2.png) [@alexey](https://discuss.circleci.com/u/alexey)\
**Post date:** [December 9, 2015, 2:40pm UTC](https://discuss.circleci.com/t/can-i-reset-circle-build-number/1019/2 "2015-12-09T14:40:47Z")

</div>

Why exactly would you like to reset the build number? Are you using it as an identifier for your build? Sorry, did not get your point from the `$((CIRCLE_BUILD_NUM % 1000))` part.

---

<div class="post-metadata">

**Author:** ![eyal\_rounds](https://avatars.discourse-cdn.com/v4/letter/e/73ab20/32.png) [@eyal\_rounds](https://discuss.circleci.com/u/eyal_rounds)\
**Post date:** [December 9, 2015, 2:43pm UTC](https://discuss.circleci.com/t/can-i-reset-circle-build-number/1019/3 "2015-12-09T14:43:54Z")

</div>

found a temp solution using cache, but the point is we have a release cycle every week (one week sprint) and the request was to have the version name of the file and app appended with a running number each sprint, it’s for development only so we can keep track of versions inside the sprint, they are meaningless once the sprint ends.  
a counter that runs on all builds and keep on running can be used but it will get too big too fast. i would rather have the number reset after 1-2 sprints max.

---

<div class="post-metadata">

**Author:** ![alexey](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/alexey/32/42_2.png) [@alexey](https://discuss.circleci.com/u/alexey)\
**Post date:** [December 9, 2015, 2:47pm UTC](https://discuss.circleci.com/t/can-i-reset-circle-build-number/1019/4 "2015-12-09T14:47:12Z")

</div>

I am afraid this is not possible right now. The only thing I can suggest is to either use an external service to generate the version numbers, or to use build URLs as version identifiers.

---

<div class="post-metadata">

**Author:** ![eyal\_rounds](https://avatars.discourse-cdn.com/v4/letter/e/73ab20/32.png) [@eyal\_rounds](https://discuss.circleci.com/u/eyal_rounds)\
**Post date:** [December 9, 2015, 3:25pm UTC](https://discuss.circleci.com/t/can-i-reset-circle-build-number/1019/5 "2015-12-09T15:25:30Z")

</div>

or to add to the cache a cache directory of my own, with ever increasing number, when i identifies version change in the code (after release the version in the manifest changes, and it’s cached too) i reset the count back to 0.  
it’s an ugly hack in my eyes but works.

---

<div class="post-metadata">

**Author:** ![alexey](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/alexey/32/42_2.png) [@alexey](https://discuss.circleci.com/u/alexey)\
**Post date:** [December 9, 2015, 7:21pm UTC](https://discuss.circleci.com/t/can-i-reset-circle-build-number/1019/6 "2015-12-09T19:21:46Z")

</div>

Yes, that’s an option as well, but please mind that if you have to run a rebuild without cache for technical reasons at some point, you might lose the build count.

---

<div class="post-metadata">

**Author:** ![drazisil](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/drazisil/32/24029_2.png) [@drazisil](https://discuss.circleci.com/u/drazisil)\
**Post date:** [June 5, 2017, 5:36pm UTC](https://discuss.circleci.com/t/can-i-reset-circle-build-number/1019/7 "2017-06-05T17:36:35Z")

</div>

Closed on June 5, 2017, 5:36pm UTC


