Multiple build numbers in workflow



We have a build with a workflow consisting of two jobs: one for generating API docs, and the other for testing, building and publishing. The jobs run in parallel.

The problem is, that now every time we fire up a build, there’s a build and build number for every job.

How can we force all jobs of the same workflow to be under the same build number?



Using $CIRCLE_SHA1 is your best option imo


What does that mean, and how will it cause all the jobs in a workflow to have the same build number?

Would you care to elaborate?


Each job in a workflow receives a different build number. Using $CIRCLE_SHA1 allows you to reference the commit ID, which is the same throughout the workflow.


Do you mean I should set the $CIRCLE_BUILD_NUM manually to be $CIRCLE_SHA1?


I mean to not use $CIRCLE_BUILD_NUM


Could you add a $CIRCLE_WORKFLOW_NUM that is the same across all jobs in a workflow. The $CIRCLE_SHA1 is fine, but it is also nice to encode a monotonically increasing build number into the version number of an artifacts(s) to quickly determine if it is a newer build?


I completely agree. +1.


This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.