Skip to content

fix: use docker v2 api #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install -U pip
sudo apt-get install wget grep
sudo apt-get install wget grep jq
- name: Compare version from pip and docker and set version
id: getversion
run: |
Expand Down
9 changes: 4 additions & 5 deletions scripts/auto_publish/compare-versions
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ pip_latest_version() {
python -m pip index versions commitizen | grep commitizen | grep -o -P '[0-9]+\.[0-9]+\.[0-9]+'
}

# requires wget, sed, gnu awk
# requires curl & jq
list_cz_docker_versions() {
image=commitizen/commitizen
wget -q "https://registry.hub.docker.com/v1/repositories/${image}/tags" -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}'
curl -L -s 'https://registry.hub.docker.com/v2/repositories/commitizen/commitizen/tags/' | jq -r '.results[].name'
}

PIP_LATEST=$(pip_latest_version)
echo "latest pip version found '$PIP_LATEST'"
printf "latest pip version found:\n%s\n\n" "$PIP_LATEST"

tags=$(list_cz_docker_versions)
printf "Docker hub tags found:\n%s\n\n" "$tags"

if echo "${tags}" | grep -q "$PIP_LATEST"; then
echo "Version already present, skipping other steps..."
Expand All @@ -28,4 +28,3 @@ else
echo "Setting variable 'version'"
echo "::set-output name=version::$PIP_LATEST"
fi