Stash Software API  2.0.0
sStash.callbackLib Namespace Reference

[ MODULE ] - Callback module. More...

Functions

Script Related Functions
def preScriptPath (projectName, developerName, developmentEnvName, stageEnvName, platformName, appPath, custom, command)
 This function is invoked before the environment is initialized. More...
 
def postScriptPath (projectName, developerName, developmentEnvName, stageEnvName, platformName, appPath, custom, command)
 This function is invoked after the environment is initialized. More...
 
Environment Related Functions
def preEnvironmentBuild (projectName, developerName, developmentEnvName, stageEnvName, platformName, appPath, custom, command)
 This function is invoked before packages are collected and environment is resolved. More...
 
def postEnvironmentBuild (projectName, developerName, developmentEnvName, stageEnvName, platformName, appPath, custom, command)
 This function is invoked after packages are collected and environment is resolved. More...
 
Package Related Functions
def shouldInitializePackage (packagePath, projectName, developerName, developmentEnvName, stageEnvName, platformName, appPath, custom, command, pythonVersion)
 This function is invoked before a package gets initialized. More...
 
App Related Functions
def getExecutableFlags (projectName, developerName, developmentEnvName, stageEnvName, platformName, appPath, custom, command)
 Return the flags that will be added to the executable. More...
 

Detailed Description

[ MODULE ] - Callback module.

Function Documentation

◆ preScriptPath()

def sStash.callbackLib.preScriptPath (   projectName,
  developerName,
  developmentEnvName,
  stageEnvName,
  platformName,
  appPath,
  custom,
  command 
)

This function is invoked before the environment is initialized.

You can return multiple scripts by separating them | in return string.

Warning
This function must return an empty str instance if it is not implemented.
Parameters
projectName[ str | None | in ] - Project name.
developerName[ str | None | in ] - Developer name.
developmentEnvName[ str | None | in ] - Development environment name.
stageEnvName[ str | None | in ] - Stage environment name.
platformName[ str | None | in ] - Platform name, either one of the following: Linux, Darwin, Windows.
appPath[ str | None | in ] - App path.
custom[ str | None | in ] - Custom values passed to executable by –custom flag.
command[ str | None | in ] - Entire command, which is executed to set the environment.
Exceptions
N/A
Returns
str - Absolute path of scripts separated by | or an empty string.

◆ postScriptPath()

def sStash.callbackLib.postScriptPath (   projectName,
  developerName,
  developmentEnvName,
  stageEnvName,
  platformName,
  appPath,
  custom,
  command 
)

This function is invoked after the environment is initialized.

You can return multiple scripts by separating them | in return string.

Warning
This function must return an empty str instance if it is not implemented.
Parameters
projectName[ str | None | in ] - Project name.
developerName[ str | None | in ] - Developer name.
developmentEnvName[ str | None | in ] - Development environment name.
stageEnvName[ str | None | in ] - Stage environment name.
platformName[ str | None | in ] - Platform name, either one of the following: Linux, Darwin, Windows.
appPath[ str | None | in ] - App path.
custom[ str | None | in ] - Custom values passed to executable by –custom flag.
command[ str | None | in ] - Entire command, which is executed to set the environment.
Exceptions
N/A
Returns
str - Absolute path of scripts separated by | or an empty string.

◆ preEnvironmentBuild()

def sStash.callbackLib.preEnvironmentBuild (   projectName,
  developerName,
  developmentEnvName,
  stageEnvName,
  platformName,
  appPath,
  custom,
  command 
)

This function is invoked before packages are collected and environment is resolved.

Return object must be a list instance that contains dict instances with the following keys:

Key Data Type Description
entryType str Either one of the following values: single, multi, command, script.
variable str Name of the environment variable.
value str Value of the environment variable.
Warning
This function must return an empty list instance if it is not implemented.
Parameters
projectName[ str | None | in ] - Project name.
developerName[ str | None | in ] - Developer name.
developmentEnvName[ str | None | in ] - Development environment name.
stageEnvName[ str | None | in ] - Stage environment name.
platformName[ str | None | in ] - Platform name, either one of the following: Linux, Darwin, Windows.
appPath[ str | None | in ] - App path.
custom[ str | None | in ] - Custom values passed to executable by –custom flag.
command[ str | None | in ] - Entire command, which is executed to set the environment.
Exceptions
N/A
Returns
list of dict - Environment.

◆ postEnvironmentBuild()

def sStash.callbackLib.postEnvironmentBuild (   projectName,
  developerName,
  developmentEnvName,
  stageEnvName,
  platformName,
  appPath,
  custom,
  command 
)

This function is invoked after packages are collected and environment is resolved.

Return object must be a list instance that contains dict instances with the following keys:

Key Data Type Description
entryType str Either one of the following values: single, multi, command, script.
variable str Name of the environment variable.
value str Value of the environment variable.
Warning
This function must return an empty list instance if it is not implemented.
Parameters
projectName[ str | None | in ] - Project name.
developerName[ str | None | in ] - Developer name.
developmentEnvName[ str | None | in ] - Development environment name.
stageEnvName[ str | None | in ] - Stage environment name.
platformName[ str | None | in ] - Platform name, either one of the following: Linux, Darwin, Windows.
appPath[ str | None | in ] - App path.
custom[ str | None | in ] - Custom values passed to executable by –custom flag.
command[ str | None | in ] - Entire command, which is executed to set the environment.
Exceptions
N/A
Returns
list of dict - Environment.

◆ shouldInitializePackage()

def sStash.callbackLib.shouldInitializePackage (   packagePath,
  projectName,
  developerName,
  developmentEnvName,
  stageEnvName,
  platformName,
  appPath,
  custom,
  command,
  pythonVersion 
)

This function is invoked before a package gets initialized.

You can implement this function to determine whether a package with given packagePath should be initialized.

Return object must be bool instance, either True or False.

Parameters
packagePath[ str | None | in ] - Absolute path of the package.
projectName[ str | None | in ] - Project name.
developerName[ str | None | in ] - Developer name.
developmentEnvName[ str | None | in ] - Development environment name.
stageEnvName[ str | None | in ] - Stage environment name.
platformName[ str | None | in ] - Platform name, either one of the following: Linux, Darwin, Windows.
appPath[ str | None | in ] - App path.
custom[ str | None | in ] - Custom values passed to executable by –custom flag.
command[ str | None | in ] - Entire command, which is executed to set the environment.
pythonVersion[ str | None | in ] - Python version used by Stash.
Exceptions
N/A
Returns
bool - Result.

◆ getExecutableFlags()

def sStash.callbackLib.getExecutableFlags (   projectName,
  developerName,
  developmentEnvName,
  stageEnvName,
  platformName,
  appPath,
  custom,
  command 
)

Return the flags that will be added to the executable.

This function gets invoked if an app is provided to the executable. Provided app information can be obtained via appPath argument that provides the absolute path of the app file.

Warning
This function must return an empty str instance if it is not implemented.
Parameters
projectName[ str | None | in ] - Project name.
developerName[ str | None | in ] - Developer name.
developmentEnvName[ str | None | in ] - Development environment name.
stageEnvName[ str | None | in ] - Stage environment name.
platformName[ str | None | in ] - Platform name, either one of the following: Linux, Darwin, Windows.
appPath[ str | None | in ] - App path.
custom[ str | None | in ] - Custom values passed to executable by –custom flag.
command[ str | None | in ] - Entire command, which is executed to set the environment.
Exceptions
N/A
Returns
str - Flags and values or an empty str.