Custom App Location

Hi everyone,

i want to move a custom app to another location in the pipeline directory of a project.

Lets say i want to move:
from
/pipeline/project_name/config/apps/tk-custom-app
to
/pipeline/project_name/custom/tk-custom-app

I used the following path description for the current app path:
apps.tk-custom-app.location:
type: path
path: '{CONFIG_FOLDER}/apps/tk-custom-app'

In the docs i found the special token {PIPELINE_ROOT} and i thought this token should represent ‘/pipeline/project_name’. So i changed the path description to:
path: '{PIPELINE_ROOT}/custom/tk-custom-app'

But now i get an error message:
Cannot start app! tk-custom-app Undefined does not exist on disk.

What did i miss? Are there any other tokens which represent the pipeline configuration root path?

Thanks!

2 Likes

I confess I don’t know about PIPELINE_ROOT but you could test with your own environment variable set to /pipeline/project_name?

2 Likes

That is actually a good idea, but in this case i have to set an environment variable for every project, right?

I also tried to use TANK_CURRENT_PC like:
${TANK_CURRENT_PC}/custom/tk-custom-app

That worked, but caused problems installing new projects, because TANK_CURRENT_PC could not be found, because it is only a “session” envrionment variable.

1 Like

Hi all –

This gets a bit confusing because the syntax for env vars and descriptor-specific tokens is extremely similar, but all the options are documented here. It looks like:

  • Env vars are supported, and they’re distinguished with a leading $ like: ${ENV_VAR}
  • {CONFIG_FOLDER} and {PIPELINE_CONFIG} are special tokens, specific to Toolkit descriptors. No $.
    • In a centralized config, where your entire pipeline configuration is in a central location on disk, {CONFIG_FOLDER} refers to the config/ folder in the config.
    • In a centralized config, {PIPELINE_CONFIG} refers to the root folder of the config.
  • {PIPELINE_ROOT} is neither – I believe it’s just a convention that was used in writing the documentation to refer to the root folder of a centralized pipeline configuration

Having said all that, @davtei, I think what you want to use is {PIPELINE_CONFIG},

First off, from your original post:

It should be noted that by default, apps live not in the config directory, but in the install directory in your config. For example, if an app is coming from the Toolkit App Store, it will be in install/app_store/tk-multi-appname/v1.0.0/.

Having said that, it looks like you want to put your app in a custom folder at the pipeline configuration root. So, I think you’ll want

path: '{PIPELINE_CONFIG}/custom/tk-custom-app'

Give that a try and see if it works?

3 Likes

Thanks for this clear explanation.
I have read the documentation of Descriptors several times and did not recognize that there is also a third token called {PIPELINE_CONFIG}.

Now it works perfectly!

One last thing i was wondering: if i add a name and version key additionally to the path for a dev/path type, i thought the path would be created like for apps of type app-store.

For example:

type: path
name: tk-custom-app
version: v0.1.1
path: ‘{PIPELINE_CONFIG}/custom’

expected path:

/pipeline/project_name/custom/tk-custom-app/v0.1.1

I understand that there are many things to consider and for some use cases it’s even bad if name and version will be append to the defined path, but it would be great if there was the possiblity to “link” the version and name key of an app-definition in the path (maybe via tokens)

Something like that, where {APP_NAME} refers to the value of name and {APP_VERSION} refers to the value of version:

type: path
name: tk-custom-app
version: v0.1.1
path: ‘{PIPELINE_CONFIG}/custom/{APP_NAME}/{APP_VERSION}’

It’s just an idea or is there actually a way to build an app path like this?

1 Like

Hey @davtei,

Not sure if it automatically assumes a versioned folder however I would suggest you take a look at Github and develop your applications via that so you can add version descriptors and have shotgun handle the downloading of the app to the correct location.

Think it will give you a lot less headache!

3 Likes

Hey @davtei

I’m glad it’s working!

To be clear, different descriptor types take different configuration settings. So, while an app_store descriptor supports version and name, the path descriptor does not. On the other hand, the app_store descriptor doesn’t support path; but the path descriptor does.

The path descriptor is not making any assumptions about the path you point it to.

As @Ricardo_Musch suggested (thanks, Ricardo!), if you want to do some more advanced organization of your Toolkit apps, Github and the git, git_branch, or github_release descriptor are a great way to go.

2 Likes

Thanks @Ricardo_Musch and @tannaz,

i will definitly have a look at github!

2 Likes