Skip to content

Commit

Permalink
Feature: plugins synchronization - part 1/2 (#172)
Browse files Browse the repository at this point in the history
Following #168
  • Loading branch information
Guts committed Jan 20, 2023
2 parents e85c247 + 97cca06 commit 5c28c58
Show file tree
Hide file tree
Showing 15 changed files with 619 additions and 233 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -135,3 +135,4 @@ _logs/
*.pfx
docs/misc/licenses.md
QGISDeploymentToolbelt_*Ubuntu*
tests/fixtures/tmp/*
3 changes: 2 additions & 1 deletion docs/jobs/index.md
Expand Up @@ -5,6 +5,7 @@
caption: Jobs
maxdepth: 1
---
plugins_manager.md
plugins_downloader.md
plugins_synchronizer.md
splash_screen_manager.md
```
35 changes: 6 additions & 29 deletions docs/jobs/plugins_manager.md → docs/jobs/plugins_downloader.md
@@ -1,6 +1,6 @@
# Plugins manager
# Plugins downloader

This job download plugins into QDT local folder and synchronize them with installed profiles.
This job download plugins into QDT local folder.

----

Expand All @@ -10,25 +10,15 @@ Sample job configuration in your scenario file:

```yaml
- name: Synchronize plugins
uses: qplugins-manager
uses: qplugins-downloader
with:
action: create_or_restore
force: false
```

----

## Options

### action

Tell the job what to do with plugins in **installed profiles**:

Possible_values:

- `create`: add plugins if they are not present
- `create_or_restore`: add plugins if not present and replace eventual existing one
- `remove`: remove plugins which are not listed

### force

Controls download mode.
Expand Down Expand Up @@ -63,6 +53,7 @@ Add the image file to the profile folder and specify the relative filepath under
"name": "french_locator_filter",
"version": "1.0.4",
"official_repository": true,
"plugin_id": 1846
},
{
"name": "pg_metadata",
Expand All @@ -83,23 +74,9 @@ Add the image file to the profile folder and specify the relative filepath under
}
```

### Store the image file under the default path

If the path is not specified into the `profile.json`, the job looks for the default filepath `images/splash.png`. If the file exists, it will be used as splash screen image.

### Workflow

1. Create a subfolder `plugins` into the local QDT working directory. Default: `~/.cache/qgis-deployment-toolbelt/plugins`
1. Parse profiles downloaded by QDT (not the installed)
1. Create an unified list of used plugins
1. Download, if not already existing, every plugin into the plugins subfolder with this structure: `plugins/{plugin-name-slufigied}/{plugin-version}/{plugin-name-version}.zip`
1. Unzip plugins in installed profiles

```mermaid
graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
C -->|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
```
1. Download, if not already existing, every plugin into the plugins subfolder with this structure: `plugins/{plugin-id}_{plugin-name-slufigied}_{plugin-version}.zip`
49 changes: 49 additions & 0 deletions docs/jobs/plugins_synchronizer.md
@@ -0,0 +1,49 @@
# Plugins synchronizer

This job synchronize plugins between those stored locally (typically downloaded by the Plugins Downloader job) and the installed plugins.

----

## Use it

Sample job configuration in your scenario file:

```yaml
- name: Synchronize plugins
uses: qplugins-synchronizer
with:
force: false
```

----

## Options

### action

Tell the job what to do with plugins in **installed profiles**:

Possible_values:

- `create`: add plugins if they are not present
- `create_or_restore`: add plugins if not present and replace eventual existing one
- `remove`: remove plugins which are not listed

### source

Where to find plugins zip files.

Possible_values: a valid path to an existing folder

Default: `~/.cache/qgis-deployment-toolbelt/plugins`

----

## How does it work

### Workflow

1. List plugins archives into the source folder. Default: `~/.cache/qgis-deployment-toolbelt/plugins`
1. Parse profiles installed
1. Compare plugin versions between referenced in profile.json and the one installed
1. If version plugin in installed profile is inferior, unzip the download plugin in installed profiles

0 comments on commit 5c28c58

Please sign in to comment.