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

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
[tool.bumpversion]
commit = true
current_version = "2.0.0"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
replace = "{new_version}"
search = "{current_version}"
serialize = [
"{major}.{minor}.{patch}",
]
tag = false
[[tool.bumpversion.files]]
filename = "CHANGELOG.md"
replace = """## [Unreleased]
## [{new_version}] - {now:%Y-%m-%d}
"""
search = """## [Unreleased]
"""
include:
- project: 'swepy/cicd-templates/release-by-changelog'
ref: '0.4.2'
file: 'templates/release-by-changelog.yml'
# Changelog
All notable changes to this job will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
* Initial version
# Contributing to PyPI to Docker missing version template
## Useful Commands for Development
This project relies on several commands to manage dependencies and versioning
effectively. Here's a breakdown of the most important commands you should be familiar
with.
### Installation
To set up your environment and install all necessary dependencies:
```sh
pip install --upgrade pip
pip install bump-my-version
```
### Bump version
To bump the version of the project, use the following command:
```sh
bump-my-version bump major
```
```sh
bump-my-version bump minor
```
```sh
bump-my-version bump patch
```
LICENSE 0 → 100644
MIT License
Copyright (c) 2024 Dorian Turba
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# PyPI to Docker missing version
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://lab.frogg.it/swepy/cicd-templates/pypi-to-docker-missing-version/-/blob/main/LICENSE)
## Objective
This template is used to retrieve all versions of a package from PyPI and compare it to
the version of the image in the registry. If the version of the image is missing, the
job will create an artefact with the lowest version of the package missing in the
registry, ready to be used for other jobs to build the image.
## How to use it
### Include the component/template
Add the following to your `.gitlab-ci.yml` file.
As a remote Template (recommended):
```yaml
include:
- remote: 'https://gitlab.com/swepy/cicd-templates/pypi-to-docker-missing-version/-/raw/0.0.0/templates/pypi-to-docker-missing-version.yml'
```
As a local Template (if the template is local to the instance):
```yaml
include:
- project: 'swepy/cicd-templates/pypi-to-docker-missing-version'
ref: '0.0.0'
file: 'templates/pypi-to-docker-missing-version.yml'
```
As a Component ([beta](https://gitlab.com/gitlab-org/gitlab/-/issues/407556) and if the
component is local to the instance):
```yaml
include:
- component: $CI_SERVER_FQDN/swepy/cicd-templates/pypi-to-docker-missing-version/pypi-to-docker-missing-version@0.2.0
```
### Customize job
You can customize the job by overriding specific keys. For example:
```yaml
pypi-to-docker-missing-version:
variables:
SORT_CMD: grep -E "^[0-9]+(\.[0-9]+)*$" | sort -t. -k1,1n -k2,2n -k3,3n
```
## Variables
You can customize the job by overriding the following variables:
| Name | Description | Default |
|-------------------------|----------------------------------------------------------------------------------------|---------------------------------------------------|
| `IMAGE_NAME` | The name of the image. Should be "<org\|user>/\<repo>". Mandatory. | `""` |
| `PACKAGE_INDEX_API_URL` | The URL of the API to retrieve the package index. | `https://pypi.org/pypi` |
| `PACKAGE_NAME` | The name of the package. | `"$CI_PROJECT_NAME"` |
| `REPOSITORIES_API_URL` | The URL of the API to retrieve the repositories. | `https://registry.hub.docker.com/v2/repositories` |
| `SORT_CMD` | The command to sort the versions. | `sort -V` |
| `TAGS` | The tags of the image to consider as already built. Used to exclude specific versions. | `""` |
files:
template: templates/pypi-to-docker-missing-version.yml
documentation: README.md
changelog: CHANGELOG.md
data:
description: "This template is used to find the next version to publish on docker registry based on the pypi releases."
icon: 🐳
labels:
- Utilities
license: MIT
deprecated: False
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