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…
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.
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.
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.
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.
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.