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

chore: changed naming convention to dash separated words

parent c88fe500
No related branches found
No related tags found
1 merge request!1Bump version: 0.4.1 → 0.4.2
Pipeline #63418 passed
......@@ -4,6 +4,6 @@ include:
ref: $CI_COMMIT_SHA
file: 'templates/pypi-to-docker-missing-version.yml'
inputs:
image_name: swepy/ruff
package_name: ruff
image-name: swepy/ruff
package-name: ruff
stage: test
......@@ -17,18 +17,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
* Variable `REPOSITORIES_API_URL` renamed `CONTAINER_REGISTRY_API_URL`
* Variable rename:
* `REPOSITORIES_API_URL` renamed `CONTAINER_REGISTRY_API_URL`
* `TAGS` renamed `TAG_EXCLUDE`
### Added
* Support [inputs](https://docs.gitlab.com/ci/yaml/inputs/):
* blocking: When no new version to publish, job fails, otherwise consider last release.
* container_registry_api_url: URL of the API to retrieve the container registry.
* image_name: Image name on Container Registry. Should be "<org|user>/<repo>".
* package_index_api_url: URL of the API to retrieve the package index.
* package_name: Name of the package on Package Registry.
* container-registry-api-url: URL of the API to retrieve the container registry.
* image-name: Image name on Container Registry. Should be "<org|user>/<repo>".
* package-index-api-url: URL of the API to retrieve the package index.
* package-name: Name of the package on Package Registry.
* stage: Stage of the job.
* tags: Image Tags to consider as already built. Used to exclude specific versions.
* tag-exclude: Image Tags to consider as already built. Used to exclude specific versions.
* Variable `BLOCKING`
## [0.4.1] - 2024-07-16
......
......@@ -21,29 +21,29 @@ include:
### Inputs
You can customize the job by overriding specific inputs.
| Name | Description | Default |
|------------------------------|----------------------------------------------------------------------------------|---------------------------------------------------|
| `blocking` | When no new version to publish, job fails, otherwise consider last release. | `false` |
| `container_registry_api_url` | URL of the API to retrieve the container registry. | `https://registry.hub.docker.com/v2/repositories` |
| `image_name` | **Mandatory** Image name on Container Registry. Should be "<org\|user>/\<repo>". | `""` |
| `package_index_api_url` | URL of the API to retrieve the package index. | `https://pypi.org/pypi` |
| `package_name` | Name of the package on Package Registry. | `$CI_PROJECT_NAME` |
| `sort_cmd` | The command to sort the versions. | `sort -V` |
| `stage` | Stage of the job. | `build` |
| `tags` | Image tags to consider as already built. Used to exclude specific versions. | `""` |
You can customize the job through [inputs](https://docs.gitlab.com/ci/components/#use-a-component).
| Name | Description | Default |
|------------------------------|---------------------------------------------------------------------------------|---------------------------------------------------|
| `blocking` | When no new version to publish, job fails, otherwise consider last release. | `false` |
| `container_registry_api_url` | URL of the API to retrieve the container registry. | `https://registry.hub.docker.com/v2/repositories` |
| `image_name` | **Mandatory** Image name on Container Registry. https://regex101.com/r/f0jdQS/1 | `""` |
| `package_index_api_url` | URL of the API to retrieve the package index. | `https://pypi.org/pypi` |
| `package_name` | Name of the package on Package Registry. | `$CI_PROJECT_NAME` |
| `sort_cmd` | Command to sort versions. | `sort -V` |
| `stage` | Stage of the job. | `build` |
| `tag-exclude` | Image tags to consider as already built. Used to exclude specific versions. | `""` |
## Variables
You can further customize the job by overriding the following variables:
| Name | Description | Default |
|------------------------------|----------------------------------------------------------------------------------|---------------------------------------------------|
| `BLOCKING` | When no new version to publish, job fails, otherwise consider last release. | `false` |
| `CONTAINER_REGISTRY_API_URL` | URL of the API to retrieve the container registry. | `https://registry.hub.docker.com/v2/repositories` |
| `IMAGE_NAME` | **Mandatory** Image name on Container Registry. Should be "<org\|user>/\<repo>". | `$[[ inputs.image_name ]]` |
| `PACKAGE_INDEX_API_URL` | URL of the API to retrieve the package index. | `$[[ inputs.package_index_api_url ]]` |
| `PACKAGE_NAME` | Name of the package on Package Registry. | `$[[ inputs.package_name ]]` |
| `SORT_CMD` | The command to sort the versions. | `sort -V` |
| `TAGS` | Image tags to consider as already built. Used to exclude specific versions. | `""` |
| Name | Description | Default |
|------------------------------|---------------------------------------------------------------------------------|--------------------------------------------|
| `BLOCKING` | When no new version to publish, job fails, otherwise consider last release. | `$[[ inputs.blocking ]]` |
| `CONTAINER_REGISTRY_API_URL` | URL of the API to retrieve the container registry. | `$[[ inputs.container-registry-api-url ]]` |
| `IMAGE_NAME` | **Mandatory** Image name on Container Registry. https://regex101.com/r/f0jdQS/1 | `$[[ inputs.image-name ]]` |
| `PACKAGE_INDEX_API_URL` | URL of the API to retrieve the package index. | `$[[ inputs.package-index-api-url ]]` |
| `PACKAGE_NAME` | Name of the package on Package Registry. | `$[[ inputs.package-name ]]` |
| `SORT_CMD` | The command to sort the versions. | `$[[ inputs.sort-cmd ]]` |
| `TAG_EXCLUDE` | Image tags to consider as already built. Used to exclude specific versions. | `$[[ inputs.tags ]]` |
......@@ -4,21 +4,25 @@ spec:
description: When no new version to publish, job fails, otherwise consider last release.
type: boolean
default: false
container_registry_api_url:
container-registry-api-url:
description: URL of the API to retrieve the container registry.
default: https://registry.hub.docker.com/v2/repositories
image_name:
image-name:
description: Image name on Container Registry. Should be "<org|user>/<repo>".
package_index_api_url:
regex: ^(?<image>[a-z0-9.\-_]+(?:/[a-z0-9.\-_]+|))(:(?<tag>[\w.\-_]{1,127})|)$
package-index-api-url:
description: URL of the API to retrieve the package index.
default: https://pypi.org/pypi
package_name:
package-name:
description: Name of the package on Package Registry.
default: $CI_PROJECT_NAME
sort-cmd:
description: Command to sort versions.
default: sort -V
stage:
description: Stage of the job.
default: build
tags:
tag-exclude:
description: Image Tags to consider as already built. Used to exclude specific versions.
default: ""
......@@ -28,12 +32,12 @@ pypi-to-docker-missing-version:
image: alpine:3.21.3
variables:
BLOCKING: $[[ inputs.blocking ]]
CONTAINER_REGISTRY_API_URL: $[[ inputs.container_registry_api_url ]]
IMAGE_NAME: $[[ inputs.image_name ]]
PACKAGE_INDEX_API_URL: $[[ inputs.package_index_api_url ]]
PACKAGE_NAME: $[[ inputs.package_name ]]
SORT_CMD: sort -V
TAGS: $[[ inputs.tags ]]
CONTAINER_REGISTRY_API_URL: $[[ inputs.container-registry-api-url ]]
IMAGE_NAME: $[[ inputs.image-name ]]
PACKAGE_INDEX_API_URL: $[[ inputs.package-index-api-url ]]
PACKAGE_NAME: $[[ inputs.package-name ]]
SORT_CMD: $[[ inputs.sort-cmd ]]
TAG_EXCLUDE: $[[ inputs.tag-exclude ]]
script:
#!/bin/bash
- apk update
......@@ -49,13 +53,13 @@ pypi-to-docker-missing-version:
- if [ "$(echo "$docker_response" | jq -r '.results | length')" -eq 0 ]; then
- break
- fi
- TAGS="$TAGS $(echo "$docker_response" | jq -r '.results[].name')"
- TAG_EXCLUDE="$TAG_EXCLUDE $(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"
- echo "tags on docker=$TAG_EXCLUDE"
# pypi
- pypi_url="$PACKAGE_INDEX_API_URL/$PACKAGE_NAME/json"
......@@ -68,7 +72,7 @@ pypi-to-docker-missing-version:
# find missing releases
- missing_releases=""
- eval 'for release in $pypi_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'
- eval 'for release in $pypi_releases; do found=0; for tag in $TAG_EXCLUDE; 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"
......
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