Differentiate "build" and "rebuild"


#1

How can we differentiate “build” and “rebuild”?
For example:
if build then statement1;
if rebuild then statement2;

Any ideas? Thanks.


#2

I’m not sure the best way to do something like this. This feature request is asking for an environment variable for rebuilds. If/when that gets done, then this would be much easier. You can show your support for that feature request by clicking ‘like’ on the original post.

For now, utilizing the CircleCI API to check if the current build’s hash has already been built might be a way to do this but a fair amount of work.


#3

Thanks for your response. Gonna try it via API.


#4