Created
August 25, 2016 16:43
-
-
Save gebv/abc596ff0362c0964d56ebabb026bc15 to your computer and use it in GitHub Desktop.
GitLab download the latest successful build
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
| #!/bin/bash | |
| set -e | |
| OUT_FILE="artifacts.zip" | |
| APP_LAST_BUILD=$(curl -H "PRIVATE-TOKEN: ${API_PRIVATE_TOKEN}" ${API_BASE_URL}/api/v3/projects/${APP_PROJECT}/builds?scope=success | jq ".[0] | select(.status==\"success\") | .id") | |
| curl -fksSL -o ${OUT_FILE} -H "PRIVATE-TOKEN: ${API_PRIVATE_TOKEN}" "${API_BASE_URL}/api/v3/projects/${APP_PROJECT}/builds/${APP_LAST_BUILD}/artifacts" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment