Skip to content

Instantly share code, notes, and snippets.

@gebv
Created August 25, 2016 16:43
Show Gist options
  • Select an option

  • Save gebv/abc596ff0362c0964d56ebabb026bc15 to your computer and use it in GitHub Desktop.

Select an option

Save gebv/abc596ff0362c0964d56ebabb026bc15 to your computer and use it in GitHub Desktop.
GitLab download the latest successful build
#!/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