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.
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.
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:
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:
From the above, the :path-to-artifact
is 0/run-results/build-results.txt
.
Reference:
https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/:build_num/artifacts/0/:path-to-artifact?circle-token=:token&branch=:branch
and it worked beautifully! –
Dutyfree wget
and a different URL. Also, i was mistaken in my understanding of what an artifacts is because after 30 days it is deleted!? So, how can I use it in my other builds then?!? –
Idiocy The {UNKNOWN_NUMBER}
represents the Github id of the repository.
If you run the snippet below you can get the id you want for any organisation and repository as provided by the github rest API
function query_gh(){
var org = document.getElementById("org").value;
var repo = document.getElementById("repo").value;
async function query(org, repo) {
const response = await fetch("https://api.github.com/orgs/"+org+"/repos");
const outJson = await response.json();
for (var i = 0; i < outJson.length; i++){
var repository = outJson[i];
if (repository.name == repo) {
id = repository.id;
output.innerHTML = org +"/"+ repo + " has ID: " + id;
return true;
}
}
}
query(org, repo);
return true;
}
<!DOCTYPE html>
<html>
<body>
<p>Enter names of the GH organisation and repository</p>
<form onsubmit="query_gh(); return false;">
<label for="org">Organisation</label>
<input type="text" id="org" required="">
<br>
<label for="repo">Repository</label>
<input type="text" id="repo" required="">
<br>
<button type="submit">Query</button>
</form>
<div id="output">
<span id="output_text">...</span>
</div>
</body>
</html>
https://{BUILD_NUMBER}-{BB-id}-bb.circle-artifacts.com/
. You can print what's that URL with the ${CIRCLE_BUILD_URL}
variable. To get that id for a BB repository go to: https://api.bitbucket.org/2.0/repositories/{username}/{repo_slug}/
and look for: uuid
. Look at the bitbucket API for more details. –
Dislocation © 2022 - 2024 — McMap. All rights reserved.
{UNKNOWN_NUMBER}
is, I have no idea. ¯\_(ツ)_/¯ – Charland