deployment

package
v0.0.0-...-7c225b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanAWSLambda

func CleanAWSLambda(functions []*common.Function)

CleanAWSLambda cleans up the AWS Lambda deployment environment by deleting all serverless.yml files and the ECR private repository

func CleanAzureFunctions

func CleanAzureFunctions(config *Config, functions []*common.Function)

func CleanServerless

func CleanServerless(index int) bool

CleanServerless removes the deployed service and deletes the serverless-<index>.yml file

func CleanUpDeploymentFiles

func CleanUpDeploymentFiles(baseDir string, functions []*common.Function) error

Clean up temporary files and folders after deployment

func CopyPythonWorkload

func CopyPythonWorkload(srcPath, dstPath string) error

Copy the exec_func.py file to the destination using the CopyFile function from utilities

func CreateFunctionApp

func CreateFunctionApp(config *Config, functionAppName string) error

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 CreateFunctionFolders(baseDir, sharedWorkloadDir string, functions []*common.Function) error

func CreateResourceGroup

func CreateResourceGroup(config *Config) error

CreateResourceGroup creates an Azure Resource Group: {az group create --name <resource-group> --location <location>}

func CreateStorageAccount

func CreateStorageAccount(config *Config) error

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

func DeleteResourceGroup(config *Config) error

DeleteResourceGroup deletes the Azure Resource Group

func DeployFunctions

func DeployFunctions(config *Config, baseDir string, functions []*common.Function) error

func DeployServerless

func DeployServerless(index int) map[int]string

DeployServerless deploys the functions defined in the serverless.com file and returns a map from function name to URL

func InitAzureFunctions

func InitAzureFunctions(config *Config, functions []*common.Function)

func SetORYXSettings

func SetORYXSettings(config *Config, functionAppName string) error

SetORYXSettings configures remote build settings for the Azure Function App

func SetSCMSettings

func SetSCMSettings(config *Config, functionAppName string) error

SetSCMSettings configures remote build settings for the Azure Function App

func ZipFunctionAppFiles

func ZipFunctionAppFiles(baseDir string, functions []*common.Function) error

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 DeployAzureFunctions(functions []*common.Function) *Config

func LoadConfig

func LoadConfig(filePath string) (*Config, error)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL