Merge pull request #1564 from flatcar-linux/jepio/fix-mirror-calico

.github: find latest calico tag when mirroring
This commit is contained in:
Jeremi Piotrowski 2022-01-14 11:05:47 +01:00 committed by GitHub
commit bdb48fd89a

View File

@ -6,7 +6,7 @@ on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
get-docker-release: mirror-calico:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -17,10 +17,19 @@ jobs:
run: | run: |
set -ex set -ex
git clone https://github.com/projectcalico/calico calico tigera_image=$(curl -sSL https://docs.projectcalico.org/manifests/tigera-operator.yaml \
# get latest version | awk '/image:/ && NF == 2 { print $2 }')
version=$(git -C "$_" tag | sort -V | tail -1) tigera_version=${tigera_image##*:}
versions=$(curl -sSL "https://raw.githubusercontent.com/tigera/operator/${tigera_version}/config/calico_versions.yml" \
| awk '/version:/ { print $2 }' \
| sort \
| uniq)
echo "Found versions: $versions"
pushd .github/workflows/ pushd .github/workflows/
./mirror-calico.sh $version for version in $versions; do
./mirror-calico.sh $version
done
popd popd