Documentation
¶
Index ¶
- func CleanAWSLambda(functions []*common.Function)
- func CleanAzureFunctions(config *Config, functions []*common.Function)
- func CleanServerless(index int) bool
- func CleanUpDeploymentFiles(baseDir string, functions []*common.Function) error
- func CopyPythonWorkload(srcPath, dstPath string) error
- func CreateFunctionApp(config *Config, functionAppName string) error
- func CreateFunctionFolders(baseDir, sharedWorkloadDir string, functions []*common.Function) error
- func CreateResourceGroup(config *Config) error
- func CreateStorageAccount(config *Config) error
- func DeleteResourceGroup(config *Config) error
- func DeployFunctions(config *Config, baseDir string, functions []*common.Function) error
- func DeployServerless(index int) map[int]string
- func InitAzureFunctions(config *Config, functions []*common.Function)
- func SetORYXSettings(config *Config, functionAppName string) error
- func SetSCMSettings(config *Config, functionAppName string) error
- func ZipFunctionAppFiles(baseDir string, functions []*common.Function) error
- type Config
- type FunctionDeployer
- type Serverless
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanAWSLambda ¶
CleanAWSLambda cleans up the AWS Lambda deployment environment by deleting all serverless.yml files and the ECR private repository
func CleanAzureFunctions ¶
func CleanServerless ¶
CleanServerless removes the deployed service and deletes the serverless-<index>.yml file
func CleanUpDeploymentFiles ¶
Clean up temporary files and folders after deployment
func CopyPythonWorkload ¶
Copy the exec_func.py file to the destination using the CopyFile function from utilities
func CreateFunctionApp ¶
CreateFunctionApp creates an Azure Function App: {az functionapp create --name <function-app-name> --resource-group <resource-group> --storage-account <storage-account-name> --consumption-plan-location <location> --runtime python --runtime-version 3.10 --os-type linux --functions-version 4}
func CreateFunctionFolders ¶
func CreateResourceGroup ¶
CreateResourceGroup creates an Azure Resource Group: {az group create --name <resource-group> --location <location>}
func CreateStorageAccount ¶
CreateStorageAccount creates an Azure Storage Account : {az storage account create --name <storage-account-name> --resource-group <resource-group> --location <location> --sku Standard_LRS}
func DeleteResourceGroup ¶
DeleteResourceGroup deletes the Azure Resource Group
func DeployFunctions ¶
func DeployServerless ¶
DeployServerless deploys the functions defined in the serverless.com file and returns a map from function name to URL
func InitAzureFunctions ¶
func SetORYXSettings ¶
SetORYXSettings configures remote build settings for the Azure Function App
func SetSCMSettings ¶
SetSCMSettings configures remote build settings for the Azure Function App
Types ¶
type Config ¶
type Config struct {
AzureConfig struct {
ResourceGroup string `yaml:"resource_group"`
StorageAccountName string `yaml:"storage_account_name"`
FunctionAppName string `yaml:"function_app_name"`
Location string `yaml:"location"`
} `yaml:"azurefunctionsconfig"`
}
Config struct to hold Azure Function deployment configuration
func DeployAzureFunctions ¶
func LoadConfig ¶
LoadConfig reads the YAML configuration file
type FunctionDeployer ¶
type FunctionDeployer interface {
Deploy(cfg *config.Configuration)
Clean()
}
func CreateDeployer ¶
func CreateDeployer(cfg *config.Configuration) FunctionDeployer
type Serverless ¶
type Serverless struct {
Service string `yaml:"service"`
FrameworkVersion string `yaml:"frameworkVersion"`
Provider slsProvider `yaml:"provider"`
Package slsPackage `yaml:"package,omitempty"`
Functions map[string]*slsFunction `yaml:"functions"`
}
Serverless describes the serverless.yml contents.
func (*Serverless) AddFunctionConfig ¶
func (s *Serverless) AddFunctionConfig(function *common.Function, provider string, awsAccountId string)
AddFunctionConfig adds the function configuration for serverless.com deployment
func (*Serverless) AddPackagePattern ¶
func (s *Serverless) AddPackagePattern(pattern string)
AddPackagePattern adds a string pattern to Package.Pattern as long as such a pattern does not already exist in Package.Pattern
func (*Serverless) CreateHeader ¶
func (s *Serverless) CreateHeader(index int, provider string)
CreateHeader sets the fields Service, FrameworkVersion, and Provider
func (*Serverless) CreateServerlessConfigFile ¶
func (s *Serverless) CreateServerlessConfigFile(index int)
CreateServerlessConfigFile dumps the contents of the Serverless struct into a yml file (serverless-<index>.yml)