-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refacto: split profiles sync job (#432)
This PR is part of #343 and of a whole refactoring. In this PR: - deprecating `qprofiles-manager` - update related documentation and JSON schemas - remove some outdated source code ## Migration guide Before: ```yaml [...] steps: - name: Download profiles from remote git repository and synchronize with installed profiles uses: qprofiles-manager with: source: https://github.com/Guts/qgis-deployment-cli.git protocol: git_remote sync_mode: overwrite branch: main [...] ``` After: ```yaml [...] steps: - name: Download profiles from remote git repository uses: qprofiles-downloader with: source: https://github.com/Guts/qgis-deployment-cli.git protocol: git_remote branch: main - name: Synchronize downloaded profiles with installed ones uses: qprofiles-synchronizer with: sync_mode: overwrite [...] ```
- Loading branch information
Showing
30 changed files
with
514 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Profiles Downloader | ||
|
||
This job downloads remote profiles through different protocols to the local QDT working folder. | ||
|
||
---- | ||
|
||
## Use it | ||
|
||
Sample job configurations. | ||
|
||
### **Remote** HTTP repository | ||
|
||
```yaml | ||
- name: Download profiles from remote HTTP server | ||
uses: qprofiles-downloader | ||
with: | ||
branch: main | ||
protocol: http | ||
source: https://organization.intra/qgis/qdt/ | ||
``` | ||
:::{note} | ||
If you use the HTTP procotol, a `qdt-files.json` must be downloadable at the URL source. Typically: `https://organization.intra/qgis/qdt/qdt-files.json`. | ||
|
||
See this guide on [how to generate the qdt-files.json](../usage/profile.md#generate-the-qdt-filesjson-index-file). | ||
::: | ||
|
||
### Public **remote** git repository | ||
|
||
```yaml | ||
- name: Download profiles from remote Git server | ||
uses: qprofiles-downloader | ||
with: | ||
branch: main | ||
protocol: git_remote | ||
source: https://github.com/geotribu/profils-qgis.git | ||
``` | ||
|
||
### **Local** git repository | ||
|
||
```yaml | ||
- name: Download profiles from local Git repository | ||
uses: qprofiles-downloader | ||
with: | ||
branch: main | ||
protocol: git_local | ||
source: file:///home/jmo/Git/Geotribu/profils-qgis | ||
``` | ||
|
||
---- | ||
|
||
## Vocabulary | ||
|
||
### Profiles states | ||
|
||
- `remote`: a profile stored outside the end-user computer, on a git repository, an HTTP server or a LAN drive. Typically: `https://gitlab.com/Oslandia/qgis/profils_qgis_fr_2022.git`. | ||
- `downloaded`: a profile downloaded into the QDT local working folder. Typically: `~/.cache/qgis-deployment-toolbelt/Oslandia/`. | ||
- `installed`: a profile's folder located into the QGIS profiles folder and so accessible to the end-user through the QGIS interface. Typically: `~/.local/share/QGIS/QGIS3/profiles/default` or `%APPDATA%/QGIS/QGIS3/profiles/default` | ||
|
||
---- | ||
|
||
## Options | ||
|
||
### branch | ||
|
||
Name of the branch to use when working with a git repository. | ||
|
||
### protocol | ||
|
||
Set which protocol to use. | ||
|
||
Possible_values: | ||
|
||
- `git_local`: use git to clone or pull changes from a repository accessible through filesystem, on the same computer or a shared drive on local network. `source` must end with `.git` and `branch` should also be set. | ||
- `git_remote` (_default_): use git to clone or pull changes from a remote repository accessible through underlying HTTP protocol. `source` must end with `.git` and `branch` should also be set. | ||
- `http`: use HTTP to download remote profiles. Source must start with `http`. | ||
|
||
### source | ||
|
||
Location of profiles to use as reference. | ||
|
||
Must start with: | ||
|
||
- `file://`: for local disk or network | ||
- `git://` (_recomended_): for git repositories | ||
- `https://`: for profiles stored into git repositories accessible through HTTP or profiles downloadable through an HTTP server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Profiles Synchronizer | ||
|
||
This job synchronizes installed profiles (those stored in QGIS profiles folder) from the downloaded ones (those stored in QDT local folder). | ||
|
||
---- | ||
|
||
## Use it | ||
|
||
Sample job configurations. | ||
|
||
### Update or install profiles only with a newer version number | ||
|
||
```yaml | ||
- name: Synchronize installed profiles from downloaded ones | ||
uses: qprofiles-synchronizer | ||
with: | ||
sync_mode: only_new_version | ||
``` | ||
### Systematically overwrite installed profile with downloaded one | ||
```yaml | ||
- name: Synchronize installed profiles from downloaded ones | ||
uses: qprofiles-synchronizer | ||
with: | ||
sync_mode: overwrite | ||
``` | ||
---- | ||
## Vocabulary | ||
### Profiles states | ||
- `remote`: a profile stored outside the end-user computer, on a git repository, an HTTP server or a LAN drive. Typically: `https://gitlab.com/Oslandia/qgis/profils_qgis_fr_2022.git`. | ||
- `downloaded`: a profile downloaded into the QDT local working folder. Typically: `~/.cache/qgis-deployment-toolbelt/Oslandia/`. | ||
- `installed`: a profile's folder located into the QGIS profiles folder and so accessible to the end-user through the QGIS interface. Typically: `~/.local/share/QGIS/QGIS3/profiles/default` or `%APPDATA%/QGIS/QGIS3/profiles/default` | ||
|
||
---- | ||
|
||
## Options | ||
|
||
### sync_mode | ||
|
||
Synchronization mode to apply with profiles. | ||
|
||
Possible_values: | ||
|
||
- `only_missing` (_default_): only install profiles that does not exist locally | ||
- `only_different_version`: only install profiles that does not exist locally and update those with a different version number (lesser or upper) | ||
- `only_new_version`: only install profiles that does not exist locally and update those with a lesser version number | ||
- `overwrite`: systematically overwrite local profiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://raw.githubusercontent.com/Guts/qgis-deployment-cli/main/docs/schemas/scenario/jobs/qprofiles-downloader.json", | ||
"description": "Job to download remote profiles to local QDT working folder.", | ||
"title": "QProfiles Downloader", | ||
"type": "object", | ||
"properties": { | ||
"branch": { | ||
"default": "master", | ||
"description": "Name of the branch to use when working with a git repository.", | ||
"type": "string" | ||
}, | ||
"protocol": { | ||
"description": "Set which protocol to use for downloading profiles.", | ||
"enum": [ | ||
"http", | ||
"git_local", | ||
"git_remote" | ||
], | ||
"deprecated": [ | ||
"git" | ||
], | ||
"type": "string" | ||
}, | ||
"source": { | ||
"description": "Location of profiles. Typically: 'https://github.com/Guts/qgis-deployment-cli.git' or 'https://raw.githubusercontent.com/Guts/qgis-deployment-cli/examples/'", | ||
"type": "string" | ||
} | ||
}, | ||
"allOf": [ | ||
{ | ||
"if": { | ||
"properties": { | ||
"protocol": { | ||
"const": "git_local" | ||
} | ||
} | ||
}, | ||
"then": { | ||
"required": [ | ||
"branch" | ||
] | ||
} | ||
}, | ||
{ | ||
"if": { | ||
"properties": { | ||
"protocol": { | ||
"const": "git_remote" | ||
} | ||
} | ||
}, | ||
"then": { | ||
"required": [ | ||
"branch" | ||
] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.