I have two CircleCI projects and I would like to download the artifacts generated in project A into project B.
Here’s code I’m using:
dependencies:
pre:
# Install JQ - used when fetching automation artifacts
- sudo apt-get update; sudo apt-get install jq
post:
# Fetch our UI automation jar
- curl "https://circleci.com/api/v1.1/project/github/$org/$project/latest/artifacts?build=master&filter=successful&circle-token=$token" >> artifacts.txt
- cat artifacts.txt | jq
- url=$(cat artifacts.txt | jq '[.[]? | select(.url | contains("automation-ui-all.jar"))][0] | .url')
- mkdir automation
- wget -O ./automation/automation-ui-all.jar $url?circle-token=$token
When the project build I get the following:
cat artifacts.txt | jq
{
"message": "Project not found"
}
Which is odd because when I run the exact same code locally it works.