diff --git a/README.md b/README.md index 7462b68..08ca188 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ pipeline: path: dist source_name: myproject max_retries: 2 + force_overwrite: true ``` __Parameters:__ @@ -54,6 +55,7 @@ __Parameters:__ - __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) - __max_retries:__ The number of retry in case of error calling the Aptly API (optional, default: no retry) +- __force_overwrite:__ When publishing, overwrite files in `pool/` directory without notice (optional, default: false) ## With Gitlab CI @@ -89,6 +91,7 @@ publish: APTLY_PATH: "dist" APTLY_SOURCE_NAME: "myproject" APTLY_MAX_RETRIES: 2 + APTLY_FORCE_OVERWRITE: true script: - echo "Publish Bullseye debian packages on APT repository..." - aptly-publish diff --git a/aptly-publish b/aptly-publish index 47ff573..7ff7a9c 100755 --- a/aptly-publish +++ b/aptly-publish @@ -47,6 +47,10 @@ PREFIX = from_env('PREFIX', '.') REPO_COMPONENT = from_env('REPO_COMPONENT', 'main') INPUT_PATH = from_env('PATH', 'dist') SOURCE_NAME = from_env('SOURCE_PACKAGE_NAME', None) +FORCE_OVERWRITE = ( + from_env('FORCE_OVERWRITE', "false").lower() + in ["1", "true", "yes"] +) # List changes files changes_files_regex = ( @@ -288,7 +292,8 @@ for changes_file in changes_files: 'Component': REPO_COMPONENT, 'Name': snap_name } - ] + ], + 'ForceOverwrite': FORCE_OVERWRITE, } result = session.put(url, json=payload) if (