Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit ff0aa907 authored by Dorian Turba's avatar Dorian Turba
Browse files

fix: add exit when no new versions

parent 781fd039
No related branches found
No related tags found
No related merge requests found
Pipeline #39516 failed
......@@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[![Pipeline](https://lab.frogg.it/swepy/cicd-templates/pypi-to-docker-missing-version/badges/trunk/pipeline.svg)](https://lab.frogg.it/swepy/cicd-templates/pypi-to-docker-missing-version/-/pipelines?ref=trunk)
### Fixed
* Job now exit 1 when there is no version to release
## [0.2.0] - 2024-06-26
[![Pipeline](https://lab.frogg.it/swepy/cicd-templates/pypi-to-docker-missing-version/badges/0.2.0/pipeline.svg)](https://lab.frogg.it/swepy/cicd-templates/pypi-to-docker-missing-version/-/pipelines?ref=0.2.0)
......
......@@ -19,15 +19,15 @@ pypi-to-docker-missing-version:
# get all tags
- while [ -n "$docker_url" ]; do
- docker_response=$(curl -s "$docker_url")
- if [ "$(echo "$docker_response" | jq -r '.results | length')" -eq 0 ]; then
- break
- fi
- TAGS="$TAGS $(echo "$docker_response" | jq -r '.results[].name')"
- docker_url=$(echo "$docker_response" | jq -r '.next')
- if [ "$docker_url" = "null" ]; then
- docker_url=""
- fi
- docker_response=$(curl -s "$docker_url")
- if [ "$(echo "$docker_response" | jq -r '.results | length')" -eq 0 ]; then
- break
- fi
- TAGS="$TAGS $(echo "$docker_response" | jq -r '.results[].name')"
- docker_url=$(echo "$docker_response" | jq -r '.next')
- if [ "$docker_url" = "null" ]; then
- docker_url=""
- fi
- done
- echo "tags on docker=$TAGS"
......@@ -45,9 +45,6 @@ pypi-to-docker-missing-version:
- missing_releases=$(echo $missing_releases)
- echo "missing tags=$missing_releases"
# regex pattern for versioning (adjust if needed)
# sorted_releases=$(printf "%s\n" $missing_releases | grep -E "$regex" | sort -t. -k1,1n -k2,2n -k3,3n)
# templated version is simpler
- sorted_releases=$(printf "%s\n" $missing_releases | $SORT_CMD)
# print the sorted versions
......@@ -59,6 +56,12 @@ pypi-to-docker-missing-version:
- echo "$version_to_publish" > version.txt
- cat version.txt
- if [ -n "$version_to_publish" ]; then
- exit 0
- else
- exit 1
- fi
artifacts:
name: "version"
paths:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment