Created
February 29, 2020 00:43
-
-
Save jamieklassen/9b382138e71cf0a3e7b502072570643c to your computer and use it in GitHub Desktop.
resource-types-manifest-script
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 | |
| VERSION=$1 | |
| PIPELINE=release-$(echo $VERSION | sed 's/.$/x/') | |
| set -eo pipefail | |
| version_vid=$(fly -t ci curl /api/v1/teams/main/pipelines/$PIPELINE/resources/version/versions "filter=number:$VERSION" -- -s | | |
| jq .[0].id) | |
| shipit_build_id=$(fly -t ci curl /api/v1/teams/main/pipelines/$PIPELINE/resources/version/versions/$version_vid/output_of "" -- -s | | |
| jq '.[] | select(.job_name=="shipit").id') | |
| filter=$(fly -t ci curl /api/v1/builds/$shipit_build_id/plan "" -- -s | | |
| jq -c '.plan.do[0].in_parallel.steps | .[].get | select(.name=="linux-rc").version' | | |
| tr -d {}\") | |
| version_id=$(fly -t ci curl /api/v1/teams/main/pipelines/$PIPELINE/resources/linux-rc/versions "filter=$filter" -- -s | | |
| jq .[0].id) | |
| build_id=$(fly -t ci curl /api/v1/teams/main/pipelines/$PIPELINE/resources/linux-rc/versions/$version_id/output_of "" -- -s | | |
| jq .[-1].id) | |
| rt_filter=$(fly -t ci curl /api/v1/builds/$build_id/plan "" -- -s | | |
| jq -c '.plan.do[0].in_parallel.steps[] | select(.get.name=="resource-types-ubuntu-image").get.version' | | |
| tr -d {}\") | |
| rt_version_id=$(fly -t ci curl /api/v1/teams/main/pipelines/$PIPELINE/resources/resource-types-ubuntu-image/versions \ | |
| "filter=$rt_filter" -- -s | | |
| jq .[0].id) | |
| export rt_build_id=$(fly -t ci curl /api/v1/teams/main/pipelines/$PIPELINE/resources/resource-types-ubuntu-image/versions/$rt_version_id/output_of "" -- -s | | |
| jq .[0].id) | |
| fly -t ci curl /api/v1/builds/$rt_build_id/plan "" -- -s | | |
| jq -r '.plan.do[0].in_parallel.steps | .[].get | "\(.resource) \(.version.tag)"' | | |
| grep resource |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment