Created
April 16, 2018 20:30
-
-
Save iurisilvio/0184179a7a2beba2789b70f5caae230d to your computer and use it in GitHub Desktop.
CircleCI download artifacts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- run: | |
name: Download Coverage Artifacts | |
command: | | |
LAST_SUCCESSFUL_BUILD=`curl -u $CIRCLE_TOKEN: "https://circleci.com/api/v1.1/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME?filter=successful&limit=1" | grep '"build_url"' | grep -oE '[0-9]+'` | |
curl -u $CIRCLE_TOKEN: "https://circleci.com/api/v1.1/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/$LAST_SUCCESSFUL_BUILD/artifacts" | grep -o 'https://[^"]*.json' | xargs -P4 -I % wget --force-directories --cut-dirs=1 --no-host-directories %?circle-token=$CIRCLE_TOKEN | |
for file in `find . -name '*\?*'`; do mv "$file" "${file%%\?*}"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment