Commit graph

8 commits

Author SHA1 Message Date
Benjamin Renard 4d4a3839fa Introduce pre-commit hooks and code cleaning 2024-01-22 00:34:17 +01:00
Benjamin Renard 5aa1664636
Add force_overwrite parameter 2023-07-19 19:26:50 +02:00
Benjamin Renard 65a6445ce7 Use underscore instead of dash to compute repository/snapshot name
Dash are commonly used in distribution, prefix and component name.
Prefer using underscore to easily split distribution/prefix/component
from names.
2022-12-14 12:49:04 +01:00
Benjamin Renard 51511e9746 Remove unsed DISTRIBUTIONS variable 2022-12-13 21:19:57 +01:00
Benjamin Renard ce4d6a65e3 Improvments to correctly handle prefix, component name & distribution to compute repository and snapshot name
The repository name could now be computed from prefix, distribution and
component names. Format:
  {prefix}-{distribution}-{component}

Note: if the default prefix is specified ("."), it will not be used to
compute the repository name.

So, all works is now done by itering on detected changes files. Foreach
of then:
 - the changes file is parsed to detect the source package name, the
   distribution and included files
 - the repository name is computed (if not specified in environment)
 - the current published distribution is retreived using APTLY publish
   API to:
   - check it was already manally published a first time
   - check it used a snapshot kind of sources
   - retreive other components source snapshot
 - Upload the changes file and all its included files using APTLY File
   Upload API in a directory named as the source package
 - Include the changes file using APTLY Local Repos API
 - Compute a snapshot name for the repository based on the current date
   and the repository name. Format: YYYYMMDD-HHMMSS-{repository name}
 - Create a snapshot of the repository using APTLY Local Repos API
 - Update the published distribution with this new snapshot as source of
   the specified component (default: main) and keeping other components
   source snapshot.
2022-12-13 20:14:01 +01:00
Benjamin Renard 6d7c03fb3d Fix publishing snapshot
When calling APTLY publish API, we have to pass the distribution name
and not the repository name. Distribution names are now collected from
changes files and a call to the APTLY publish API will be made for all
updated distribution.

Also add a PREFIX parameter to permit to specify the APTLY prefix (and
storage if it need to be specified).
2022-11-30 20:23:41 +01:00
Benjamin Renard 59214019ba Allow to set parameter using environment variables PLUGIN_* or APTLY_* 2022-11-30 20:15:37 +01:00
Benjamin Renard 4529061bc4 Rename entrypoint.py to aptly-publish 2022-11-30 20:13:57 +01:00
Renamed from entrypoint.py (Browse further)