Support using git addon version in makefile manage#114
Support using git addon version in makefile manage#114MustafaJafar wants to merge 4 commits intodevelopfrom
Conversation
| if ($env:AYON_USE_GIT_SUFFIX_FOR_ADDONS -eq "True") { | ||
| $AYON_ADDON_VERSION = Invoke-Expression -Command "python -c ""print('$($AYON_ADDON_VERSION)'.split('-')[0].split('+')[0] + '+git')""" | ||
| } | ||
| # Running Kitsu processor service script live requires the following environment variables to be set. | ||
| $env:AYON_ADDON_NAME = $AYON_ADDON_NAME | ||
| $env:AYON_ADDON_VERSION = $AYON_ADDON_VERSION |
There was a problem hiding this comment.
Not sure why to re-run the code and re-assign the variable
| if ($env:AYON_USE_GIT_SUFFIX_FOR_ADDONS -eq "True") { | |
| $AYON_ADDON_VERSION = Invoke-Expression -Command "python -c ""print('$($AYON_ADDON_VERSION)'.split('-')[0].split('+')[0] + '+git')""" | |
| } | |
| # Running Kitsu processor service script live requires the following environment variables to be set. | |
| $env:AYON_ADDON_NAME = $AYON_ADDON_NAME | |
| $env:AYON_ADDON_VERSION = $AYON_ADDON_VERSION | |
| $addon_version = $AYON_ADDON_VERSION | |
| if ($env:AYON_USE_GIT_SUFFIX_FOR_ADDONS -eq "True") { | |
| $addon_version = "($AYON_ADDON_VERSION)+git" | |
| } | |
| # Running Kitsu processor service script live requires the following environment variables to be set. | |
| $env:AYON_ADDON_NAME = $AYON_ADDON_NAME | |
| $env:AYON_ADDON_VERSION = $addon_version |
BTW we usually set AYON_ADDON_NAME and AYON_ADDON_VERSION ahead so you can define different version from .env file (which I think is what you should do to add the +git TBH).
There was a problem hiding this comment.
e.g. in ftrack it is set before any command is started, so e.g. RunDocker can also use custom version from .env file if needed.
There was a problem hiding this comment.
I don't think this one works.
$addon_version = "($AYON_ADDON_VERSION)+git"
because addon version according to the this line
ayon-kitsu/services/processor/manage.ps1
Line 11 in c8ecc3c
will be 1.2.6+dev and AYON expects the name to be 1.2.6+git not 1.2.6+dev+git
There was a problem hiding this comment.
e.g. in ftrack it is set before any command is started, so e.g. RunDocker can also use custom version from .env file if needed.
Which function I should move this piece of code to?
- main
- RunDocker
- RunService
There was a problem hiding this comment.
As far as I see, both main.sh and manage.ps1 are already reading .env file, so set AYON_ADDON_VERSION env only if is not set yet after load-env (include .env).
Changelog Description
An alternative to #94
This PR adds support for
AYON_USE_GIT_SUFFIX_FOR_ADDONSenv var for initializing the processor services with addon version with the+gitsuffix. This is the same env var used on the ayon-docker server.Additional details
when working with kitsu addon development, it's possible to develop from within the ayon-docker directly or from a separate directory.
Although, developing from within the
ayon-docker/addonsdirectly, if someone does, running servies live from source code won't work becasue the service is not initialized to work with the+gitvesion. so, it fails to fetch settings.I think such a solution can be adapted in other addons with services.
Testing notes:
AYON_USE_GIT_SUFFIX_FOR_ADDONSto true it should set the addon version to+git.