Compare commits

..

No commits in common. "247030216c309112249c7f81d09e0704a7dee12b" and "8b8c5032b1497645607bf31e1e6ed05c0997c545" have entirely different histories.

3 changed files with 8 additions and 9 deletions

View file

@ -1,4 +1,3 @@
[MESSAGES CONTROL]
disable=locally-disabled,
redefined-outer-name,
invalid-name,

View file

@ -6,14 +6,14 @@ This plugin will try to :
- List all changes files in the specified directory and filter on the specified source package name (if specified)
- Iter on detected changes files and 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). __Format:__ `{prefix}_{distribution}_{component}`. __Note:__ if the default prefix is specified (`.`), it will not be used to compute the repository name.
- the repository name is computed (if not specified). __Format:__ `{prefix}-{distribution}-{component}`. __Note:__ if the default prefix is specified (`.`), it will not be used to compute the repository name.
- 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}`
- 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 and keeping other components source snapshot.
@ -38,7 +38,7 @@ pipeline:
from_secret: aptly_api_password
prefix: debian
repo_component: main
repo_name: debian_stable_main
repo_name: debian-stable-main
path: dist
source_name: myproject
max_retries: 2
@ -85,7 +85,7 @@ publish:
APTLY_API_USERNAME: myproject
APTLY_PREFIX: "debian"
APTLY_REPO_COMPONENT: "main"
APTLY_REPO_NAME: "debian_stable_main"
APTLY_REPO_NAME: "debian-stable-main"
APTLY_PATH: "dist"
APTLY_SOURCE_NAME: "myproject"
APTLY_MAX_RETRIES: 2
@ -98,4 +98,4 @@ publish:
- if: $CI_COMMIT_TAG
```
The parameters are passed using environment variables as designed with a Woodpecker CI plugin. Consequently, you could refer to the previous section for details about these parameters. For the password to request Aptly API, you have to set the `APTLY_API_PASSWORD` CI variable in your Gitlab project configuration (be sure to check _Masked variable_).
The parameters are passed using environment variables as designed with a Woodpecker CI plugin. Consequently, you could refer to the previous section for details about these parameters. For the password to request Aptly API, you have to set the `APTLY_API_PASSWORD` CI variable in your Gitlab project configuration (be sure to check _Masked variable_).

View file

@ -90,9 +90,9 @@ def get_repo_name(dist):
""" Compute and retreive repository name """
if REPO_NAME:
return REPO_NAME
value = f'{dist}_{REPO_COMPONENT}'
value = f'{dist}-{REPO_COMPONENT}'
if PREFIX != ".":
value = f'{PREFIX}_{value}'
value = f'{PREFIX}-{value}'
return value
@ -251,7 +251,7 @@ for changes_file in changes_files:
sys.exit(1)
# Create a snapshot of the repository
snap_name = datetime.datetime.now().strftime(f'%Y%m%d-%H%M%S_{repo_name}')
snap_name = datetime.datetime.now().strftime(f'%Y%m%d-%H%M%S-{repo_name}')
print(f'Create new snapshot "{snap_name}" of repository "{repo_name}"')
url = f'{API_URL}/repos/{repo_name}/snapshots'