Woodpecker CI plugin to publish Debian packages using on Aptly API
Go to file
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
.gitignore First release 2022-05-02 00:39:47 +02:00
.pylintrc Fix some pylint warnings 2022-05-02 16:12:37 +02:00
.woodpecker.yml Fix install dependencies in pylint test 2022-05-02 16:22:19 +02:00
aptly-publish Improvments to correctly handle prefix, component name & distribution to compute repository and snapshot name 2022-12-13 20:14:01 +01:00
Dockerfile Rename entrypoint.py to aptly-publish 2022-11-30 20:13:57 +01:00
README.md Add CI badge to README 2022-05-02 16:15:10 +02:00

Woodpecker CI plugin to publish Debian package on a Aptly repository

This docker image could be used as an Woodpecker CI plugin to publish one (or more) Debian package on a Aptly repository using its API.

This plugin will try to :

  • locate all changes files in the dist directory (that matched source_name if provided)
  • extract files that are mentioned by the changes files and upload it using Aptly files API. Files are published on a subdirectory of the name of the source package
  • include all processed changes files using Aplty repos API
  • create a snapshot of the repository named using current datetime and repository name (format: YYYYMMDD-HHMMSS-repo) using Aptly snapshot API
  • update the published snapshot of the repository using Aptly publish API

status-badge

Usage

The below pipeline configuration demonstrates simple usage:

pipeline:
  publish:
    image: brenard/aptly-publish
    settings:
      api_url: https://your.aptly.tld/api
      api_username: myproject
      api_password:
        from_secret: aptly_api_password
      repo_name: stable
      path: dist
      source_name: myproject

Parameters:

  • api_url: Your Aptly API URL (required)
  • api_username: Username to authenticate on your Aptly API (required)
  • api_password: Password to authenticate on your Aptly API (required)
  • repo_name: Repository name to publish on (optional, default: stable)
  • path: Path to the directory where files to publish are stored (optional, default: dist)
  • source_name: Name of the source package to publish (optional, default: all changes files are will be publish)