Persisting Artifacts through a workflow


So I have a fairly straightforward process:

  • build & test
  • approve
  • deploy

I’ve just migrated from 1.0, where everything happens in one go, so the artifacts are retrievable from the build number of the whole thing. For my deploy I’m calling a Lambda in AWS, through API Gateway, with a build number.

Now in 2.0 my artifacts are generated in the build phase. Currently I store the build number of that first phase to the workspace (echo $CIRCLE_BUILD_NUM > /tmp/workspace/BUILD_NUM). I’m just wondering if this is the best/correct way to do this?