Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Circle Ci 2.0 artifacts url

Circle Ci 2.0 artifacts can be accessed with the following url

https://{BUILD_NUMBER}-{UNKNOWN_NUMBER}-gh.circle-artifacts.com/0

What does the number after CI build number represent.

like image 525
smndiaye Avatar asked Oct 23 '17 01:10

smndiaye


People also ask

How do I see artifacts in CircleCI?

Navigate to a pipeline's Job page on the CircleCI web app to find the Artifacts tab. Artifacts are stored on Amazon S3 and are protected with your CircleCI account for private projects.

Where are artifacts stored?

The artifacts are stored on the server "as is" without additional compression. By default, the artifacts are stored under the <TeamCity Data Directory\>/system/artifacts directory which can be changed. You can configure an external artifacts storage to replace the built-in one.


Video Answer


1 Answers

If, like me, you were looking for a way to programmatically reference CircleCI (2.0) artifacts, the following url structure works for me:

https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/:build_num/artifacts/0/:path-to-artifact?circle-token=:token&branch=:branch

For example:

https://circleci.com/api/v1.1/project/github/circleci/circleci-docs/latest/artifacts/0/run-results/build-results.txt?branch=realitycheck&filter=successful

resolves to the build-results.txt artifact on the latest, successful build of the circleci-docs project's realitycheck branch.

Constructing the :path-to-artifact can be done by inspecting your CircleCI artifacts directory structure:

enter image description here

From the above, the :path-to-artifact is 0/run-results/build-results.txt.

Reference:

  • https://circleci.com/docs/api/v1-reference/#build-artifacts
like image 172
eddies Avatar answered Oct 04 '22 04:10

eddies