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 68870e3c authored by Dorian Turba's avatar Dorian Turba
Browse files

Merge branch 'trunk'

parents 4438eda9 fe223792
No related branches found
No related tags found
No related merge requests found
Pipeline #38618 failed
[tool.bumpversion]
commit = true
current_version = "2.0.0"
current_version = "2.0.1"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
replace = "{new_version}"
search = "{current_version}"
......
include:
- remote: 'https://gitlab.com/swepy/cicd-templates/docker-build/-/raw/0.2.0/templates/docker-build.yml'
- remote: 'https://gitlab.com/swepy/cicd-templates/release-by-changelog/-/raw/0.4.2/templates/release-by-changelog.yml'
- remote: 'https://gitlab.com/swepy/cicd-templates/pypi-to-docker-missing-version/-/raw/0.2.0/templates/pypi-to-docker-missing-version.yml'
release_by_changelog:
rules:
- if: '$CI_PIPELINE_SOURCE != "pipeline" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
next_version:
stage: build
image: alpine:latest
pypi-to-docker-missing-version:
variables:
PACKAGE_NAME: ruff
IMAGE_NAME: swepy/ruff
script:
#!/bin/bash
- apk update
- apk add --no-cache curl jq
# get docker tags
- echo "Image name=$IMAGE_NAME"
- docker_url="https://registry.hub.docker.com/v2/repositories/$IMAGE_NAME/tags"
- tags=""
# 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
- done
- echo "tags on docker=$tags"
# pypi
- pypi_url="https://pypi.org/pypi/$PACKAGE_NAME/json"
- pypi_response=$(curl -s "$pypi_url")
- releases=$(echo "$pypi_response" | jq -r '.releases | keys[]')
- echo "releases on pypi:"
- printf "%s " $releases
# find missing releases
- missing_releases=""
- eval 'for release in $releases; do found=0; for tag in $tags; do if [ "$release" = "$tag" ]; then found=1; break; fi; done; if [ $found -eq 0 ]; then missing_releases="$missing_releases $release"; fi; done'
- missing_releases=$(echo $missing_releases)
- echo "missing tags=$missing_releases"
# regex pattern for versioning (adjust if needed)
#regex='^[0-9]+(\.[0-9]+)*$'
- regex='^((0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*))(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$'
- sorted_releases=$(printf "%s\n" $missing_releases | grep -E "$regex" | sort -t. -k1,1n -k2,2n -k3,3n)
# print the sorted versions
- echo "Sorted releases:"
- printf "%s " $sorted_releases
- version_to_publish=$(echo $sorted_releases | awk '{print $1}')
- 'echo "Version to publish: $version_to_publish"'
- echo "$version_to_publish" > version.txt
- cat version.txt
artifacts:
name: "version"
paths:
- version.txt
expire_in: 1 day
PACKAGE_NAME: ruff
TAGS: 0.0.44 0.0.43 0.0.42 0.0.40 0.0.39 0.0.37 0.0.36 0.0.35 0.0.34 0.0.33 0.0.32 0.0.31 0.0.30 0.0.29 0.0.28 0.0.25 0.0.24 0.0.23 0.0.22 0.0.21 0.0.20 0.0.19 0.0.18 0.0.17 0.0.16 0.0.15 0.0.14 0.0.13
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
......
......@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [2.0.1] - 2024-06-26
### Fixed
* Prevent old images to be build when docker API fails to return all versions
## [2.0.0] - 2024-06-25
### Changed
......
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