environment

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 16 Imported by: 40

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAllEnvironment

func DeleteAllEnvironment(db gorp.SqlExecutor, projectID int64) error

DeleteAllEnvironment Delete all environment attached to the given project

func DeleteAllEnvironmentKeys added in v0.53.0

func DeleteAllEnvironmentKeys(db gorp.SqlExecutor, envID int64) error

DeleteAllEnvironmentKeys Delete all environment keys for the given env

func DeleteAllVariables

func DeleteAllVariables(db gorp.SqlExecutor, environmentID int64) error

DeleteAllVariables Delete all variables from the given environment.

func DeleteEnvironment

func DeleteEnvironment(db gorp.SqlExecutor, environmentID int64) error

DeleteEnvironment Delete the given environment

func DeleteEnvironmentKey

func DeleteEnvironmentKey(db gorp.SqlExecutor, envID int64, keyName string) error

DeleteEnvironmentKey Delete the given key from the given project

func DeleteVariable

func DeleteVariable(db gorp.SqlExecutor, envID int64, variable *sdk.EnvironmentVariable, u sdk.Identifiable) error

DeleteVariable Delete a variable from the given pipeline

func Exists

func Exists(db gorp.SqlExecutor, projectKey, envName string) (bool, error)

Exists checks if an environment already exists on the project

func Export

func Export(ctx context.Context, db gorp.SqlExecutor, key string, envName string, encryptFunc sdk.EncryptFunc) (exportentities.Environment, error)

Export an environment

func ExportEnvironment

func ExportEnvironment(ctx context.Context, db gorp.SqlExecutor, env sdk.Environment, encryptFunc sdk.EncryptFunc, encryptPrefix string) (exportentities.Environment, error)

ExportEnvironment encrypt and export

func Import

func Import(db gorpmapper.SqlExecutorWithTx, proj sdk.Project, env *sdk.Environment, msgChan chan<- sdk.Message, u sdk.Identifiable) error

Import import or reuser the provided environment

func ImportInto

func ImportInto(ctx context.Context, db gorpmapper.SqlExecutorWithTx, env *sdk.Environment, into *sdk.Environment, msgChan chan<- sdk.Message, u sdk.Identifiable) error

ImportInto import variables and groups on an existing environment

func InsertEnvironment

func InsertEnvironment(db gorp.SqlExecutor, env *sdk.Environment) error

InsertEnvironment Insert new environment

func InsertKey

InsertKey a new environment key in database

func InsertVariable

InsertVariable Insert a new variable in the given environment

func LoadAllByIDs

func LoadAllByIDs(db gorp.SqlExecutor, ids []int64) ([]sdk.Environment, error)

LoadAllByIDs load all environment

func LoadAllKeys

func LoadAllKeys(db gorp.SqlExecutor, envID int64) ([]sdk.EnvironmentKey, error)

LoadAllKeys load all keys for the given environment

func LoadAllKeysForEnvsWithDecryption

func LoadAllKeysForEnvsWithDecryption(ctx context.Context, db gorp.SqlExecutor, envIDS []int64) (map[int64][]sdk.EnvironmentKey, error)

LoadAllKeysForEnvsWithDecryption load all keys for all given environments, with description

func LoadAllKeysWithPrivateContent

func LoadAllKeysWithPrivateContent(db gorp.SqlExecutor, envID int64) ([]sdk.EnvironmentKey, error)

LoadAllKeysWithPrivateContent load all keys for the given environment

func LoadAllNames

func LoadAllNames(db gorp.SqlExecutor, projID int64) (sdk.IDNames, error)

LoadAllNames returns all environment names

func LoadAllNamesByFromRepository

func LoadAllNamesByFromRepository(db gorp.SqlExecutor, projID int64, fromRepository string) (sdk.IDNames, error)

LoadAllNamesByFromRepository returns all environment names for a repository

func LoadAllVariables

func LoadAllVariables(db gorp.SqlExecutor, envID int64) ([]sdk.EnvironmentVariable, error)

LoadAllVariables Get all variable for the given environment

func LoadAllVariablesForEnvsWithDecryption

func LoadAllVariablesForEnvsWithDecryption(ctx context.Context, db gorp.SqlExecutor, envIDS []int64) (map[int64][]sdk.EnvironmentVariable, error)

LoadAllVariablesForEnvsWithDecryption load all variables for all given environments

func LoadAllVariablesWithDecrytion

func LoadAllVariablesWithDecrytion(db gorp.SqlExecutor, envID int64) ([]sdk.EnvironmentVariable, error)

LoadAllVariablesWithDecrytion Get all variable for the given environment, it also decrypt all the secure content

func LoadByWorkflowID

func LoadByWorkflowID(db gorp.SqlExecutor, workflowID int64) ([]sdk.Environment, error)

LoadByWorkflowID loads environments from database for a given workflow id

func LoadEnvironmentByID

func LoadEnvironmentByID(db gorp.SqlExecutor, ID int64) (*sdk.Environment, error)

LoadEnvironmentByID load the given environment

func LoadEnvironmentByName

func LoadEnvironmentByName(db gorp.SqlExecutor, projectKey, envName string) (*sdk.Environment, error)

LoadEnvironmentByName load the given environment

func LoadEnvironments

func LoadEnvironments(db gorp.SqlExecutor, projectKey string) ([]sdk.Environment, error)

LoadEnvironments load all environment from the given project

func LoadKey

func LoadKey(db gorp.SqlExecutor, id int64, keyName string) (*sdk.EnvironmentKey, error)

func LoadVariable

func LoadVariable(db gorp.SqlExecutor, envID int64, varName string) (*sdk.EnvironmentVariable, error)

LoadVariable retrieve a specific variable

func LoadVariableAudits

func LoadVariableAudits(db gorp.SqlExecutor, envID, varID int64) ([]sdk.EnvironmentVariableAudit, error)

LoadVariableAudits Load audits for the given variable

func LoadVariableWithDecryption

func LoadVariableWithDecryption(db gorp.SqlExecutor, envID int64, varID int64, varName string) (*sdk.EnvironmentVariable, error)

LoadVariableWithDecryption retrieve a specific variable with decrypted content

func Lock

func Lock(db gorp.SqlExecutor, projectKey, envName string) error

Lock locks an environment given its ID

func ParseAndImport

ParseAndImport parse an exportentities.Environment and insert or update the environment in database

func ResetFromRepository

func ResetFromRepository(db gorp.SqlExecutor, projID int64, fromRepository string) error

ResetFromRepository reset fromRepository for all environments using the same fromRepository in a given project

func UpdateEnvironment

func UpdateEnvironment(db gorp.SqlExecutor, env *sdk.Environment) error

UpdateEnvironment Update an environment

func UpdateVariable

func UpdateVariable(db gorpmapper.SqlExecutorWithTx, envID int64, variable *sdk.EnvironmentVariable, variableBefore *sdk.EnvironmentVariable, u sdk.Identifiable) error

UpdateVariable Update a variable in the given environment

Types

type ImportOptions

type ImportOptions struct {
	Force          bool
	FromRepository string
}

ImportOptions are options to import environment

Jump to

Keyboard shortcuts

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