Multiple build numbers in workflow


#1

Hi,

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?

Thanks


#2

Using $CIRCLE_SHA1 is your best option imo


#3

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?


#4

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.
https://circleci.com/docs/2.0/env-vars/#build-details


#5

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


#6

I mean to not use $CIRCLE_BUILD_NUM


#7

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?


#8

I completely agree. +1.


#9

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