OPRF Asset Updater¶
GitHub Action¶
The most common usage of this module is through the OPRF Asset Updater GitHub action. Documentation can be found in marketplace listing or the repository readme.
CLI Usage¶
A script which automatically updates OPRF standard asset files from the OpRedFlag repository
usage: oprf update [-h] [-d DIRECTORY] [-r REPOSITORY] [-b BRANCH]
[-v VERSION_JSON] [-i INCLUDE] [-e EXCLUDE]
[-c {major,minor,patch,none}] [-s]
[-u UPDATE_TIMESTAMP_AFTER]
Named Arguments¶
- -d, --directory
Local root directory
Default:
'.'- -r, --repository
Location of OpRedFlag asset GitHub repository, in User/Repo format. Default: “Op-RedFlag/OpRedFlag”
Default:
'Op-Redflag/OpRedFlag'- -b, --branch
The branch of the OpRedFlag repository to use. Default: “master”
Default:
'master'- -v, --version-json
Location of local versions.json file. Default: “oprf-versions.json”
Default:
'oprf-versions.json'- -i, --include
Files to update, separated by commas. Default: “*”
Default:
'*'- -e, --exclude
Files to skip, separated by commas. Default: “”
Default:
''- -c, --compatibility
Possible choices: major, minor, patch, none
Compatibility level, will only allow updates of this level or lower. Default: “minor”
Default:
minor- -s, --strict
Fail if local file versions are newer than remote
Default:
False- -u, --update-timestamp-after
Update the timestamp in the version file if this many days has passed. 0 for always and -1 for never. Default: 30
Default:
30
Code Reference¶
- class opredflag.updater.Updater(directory='.', version_json='oprf-versions.json', repository='Op-Redflag/OpRedFlag', branch='master', include='*', exclude='', compatibility=Compatibility.MINOR, strict=False, update_timestamp_after=30)[source]¶
The base updater class which handles the whole process.
- Parameters:
directory (
str) – Local root directoryversion_json (
str) – Location of local versions.json filerepository (
str) – Location of OpRedFlag asset GitHub repository, in User/Repo formatbranch (
str) – The branch of the repository to useinclude (
str) – Files to update, separated by commasexclude (
str) – Files to skip, separated by commascompatibility (
Compatibility) – Compatibility level, will only allow updates of this level or lowerstrict (
bool) – Fail if local file versions are newer than remoteupdate_timestamp_after (
int) –- Automatically update the last_updated key in the version file after this amount of days,
even when no changes have been made. Set to 0 for always or -1 for never.
- class opredflag.updater.Compatibility[source]¶
Represents a compatibility level between semantic versions.
- MAJOR¶
Compatibility with any major version, least strict.
- MINOR¶
Compatibility with any minor version with the same major version, less strict.
- PATCH¶
Compatibility with any patch version with the same major and minor version, most strict.