Documentation
¶
Overview ¶
NOTE: cross compile safe
Index ¶
- Constants
- func FirstNonEmpty(values ...string) string
- func GenerateSampleConfig() error
- func HandleConfigSetup(cmd *cobra.Command, reader *bufio.Reader) error
- func PromptAppConfig(reader *bufio.Reader, cfg *NextDeployConfig) error
- func PromptDeploymentConfig(reader *bufio.Reader, cfg *NextDeployConfig) error
- func PromptDockerConfig(reader *bufio.Reader, cfg *NextDeployConfig) error
- func PromptRepositoryConfig(reader *bufio.Reader, cfg *NextDeployConfig) error
- func PromptYesNo(reader *bufio.Reader, question string) bool
- func ReadRequiredInput(reader *bufio.Reader) (string, error)
- func Save(cfg *NextDeployConfig, path string) error
- func SaveConfig(path string, cfg *NextDeployConfig) error
- func ShowConfigSummary(cfg *NextDeployConfig)
- func WriteConfig(filename string, cfg *NextDeployConfig) error
- type Alerts
- type AppConfig
- type Backup
- type CloudProviderStruct
- type Container
- type Database
- type Deployment
- type DockerBuild
- type DockerConfig
- type DopplerConfig
- type EnvVariable
- type HealthCheck
- type Logging
- type Monitoring
- type NextDeployConfig
- func InteractiveConfigPrompt(reader *bufio.Reader) (*NextDeployConfig, error)
- func Load() (*NextDeployConfig, error)
- func LoadConfig() (*NextDeployConfig, error)
- func PromptForConfig(reader *bufio.Reader) (*NextDeployConfig, error)
- func PromptForConfigs(reader *bufio.Reader) (*NextDeployConfig, error)
- type Repository
- type SSL
- type SSLConfig
- type SafeConfig
- type SecretFile
- type SecretsConfig
- type Server
- type ServerConfig
- type ServerlessConfig
- type Storage
- type VaultConfig
- type WebServer
- type Webhook
Constants ¶
const ( EmojiSuccess = "✅" EmojiWarning = "⚠️" EmojiInfo = "ℹ️" EmojiInput = "🖊️" EmojiQuestion = "❓" EmojiImportant = "🔑" EmojiNetwork = "🌐" EmojiContainer = "🐳" EmojiDatabase = "💾" EmojiServer = "🖥️" EmojiDeployment = "🚀" EmojiError = "❌" EmojiSummary = "📋" EmojiConfig = "📂" EmojiApp = "📱" EmojiEnvironment = "🌍" EmojiSecrets = "🔐" EmojiDomain = "🌐" EmojiPort = "🔌" EmojiVersion = "📅" EmojiBuild = "🔨" EmojiLogs = "📜" EmojiFeedback = "💬" EmojiHelp = "❗" EmojiWelcome = "👋" EmojiNextDeploy = "🚀 NextDeploy" EmojiSummaryLine = "═" EmojiSummaryHeader = "🎉 Configuration Summary" EmojiPrompt = "👉" EmojiPromptYes = "👍" EmojiPromptNo = "👎" EmojiPromptInput = "✏️" EmojiPromptSelect = "🔘" EmojiPromptMultiSelect = "📋" EmojiPromptPassword = "🔑" EmojiPromptConfirm = "✔️" )
const ( ConfigPath = "nextdeploy.yml" ConfigFile = "nextdeploy.yml" SampleConfigFile = "sample.nextdeploy.yml" )
Variables ¶
This section is empty.
Functions ¶
func FirstNonEmpty ¶
func GenerateSampleConfig ¶
func GenerateSampleConfig() error
func PromptAppConfig ¶
func PromptAppConfig(reader *bufio.Reader, cfg *NextDeployConfig) error
func PromptDeploymentConfig ¶
func PromptDeploymentConfig(reader *bufio.Reader, cfg *NextDeployConfig) error
func PromptDockerConfig ¶
func PromptDockerConfig(reader *bufio.Reader, cfg *NextDeployConfig) error
func PromptRepositoryConfig ¶
func PromptRepositoryConfig(reader *bufio.Reader, cfg *NextDeployConfig) error
func Save ¶
func Save(cfg *NextDeployConfig, path string) error
func SaveConfig ¶
func SaveConfig(path string, cfg *NextDeployConfig) error
SaveConfig writes the configuration to a file
func ShowConfigSummary ¶
func ShowConfigSummary(cfg *NextDeployConfig)
func WriteConfig ¶
func WriteConfig(filename string, cfg *NextDeployConfig) error
WriteConfig writes the configuration to a YAML file
Types ¶
type Alerts ¶
type Alerts struct {
CPUThreshold int `yaml:"cpuThreshold"`
MemoryThreshold int `yaml:"memoryThreshold"`
Email string `yaml:"email,omitempty"`
SlackWebhook string `yaml:"slackWebhook,omitempty"`
}
Alerts defines monitoring notification rules
type AppConfig ¶
type AppConfig struct {
Name string `yaml:"name"`
Port int `yaml:"port"`
Environment string `yaml:"environment"`
Domain string `yaml:"domain,omitempty"`
Secrets *SecretsConfig `yaml:"secrets,omitempty"`
}
AppConfig contains application-specific settings
type Backup ¶
type Backup struct {
Enabled bool `yaml:"enabled"`
Schedule string `yaml:"schedule"`
Retention int `yaml:"retentionDays"`
Storage Storage `yaml:"storage"`
}
Backup defines data backup policies
type CloudProviderStruct ¶
type Container ¶
type Container struct {
Name string `yaml:"name"`
Restart string `yaml:"restart"`
Ports []string `yaml:"ports"`
HealthCheck *HealthCheck `yaml:"healthCheck,omitempty"`
}
Container contains runtime configuration
type Database ¶
type Database struct {
Type string `yaml:"type"`
Host string `yaml:"host"`
Port string `yaml:"port"`
Username string `yaml:"username"`
// #nosec G117
Password string `yaml:"password"`
Name string `yaml:"name"`
}
Database contains persistence layer configuration
type Deployment ¶
Deployment contains infrastructure deployment settings
type DockerBuild ¶
type DockerBuild struct {
Context string `yaml:"context"`
Dockerfile string `yaml:"dockerfile"`
NoCache bool `yaml:"noCache"`
Args map[string]string `yaml:"args,omitempty"`
}
DockerBuild contains Docker build parameters
type DockerConfig ¶
type DockerConfig struct {
Image string `yaml:"image"`
Registry string `yaml:"registry,omitempty"`
RegistryRegion string `yaml:"registryregion,omitempty"`
Build DockerBuild `yaml:"build"`
Push bool `yaml:"push"`
Username string `yaml:"username,omitempty"`
// #nosec G117
Password string `yaml:"password,omitempty"`
AlwaysPull bool `yaml:"alwaysPull,omitempty"`
Strategy string `yaml:"strategy,omitempty"`
AutoPush bool `yaml:"autoPush,omitempty"`
Platform string `yaml:"platform,omitempty"`
NoCache bool `yaml:"noCache,omitempty"`
BuildContext string `yaml:"buildContext,omitempty"`
Target string `yaml:"target,omitempty"`
}
DockerConfig contains containerization settings
type DopplerConfig ¶
type DopplerConfig struct {
Project string `yaml:"project"`
Config string `yaml:"config"`
Token string `yaml:"token,omitempty"`
}
DopplerConfig contains Doppler-specific settings
type EnvVariable ¶
type EnvVariable struct {
Name string `yaml:"name"`
Value string `yaml:"value"`
Secret bool `yaml:"secret,omitempty"`
}
EnvVariable contains environment variables
type HealthCheck ¶
type HealthCheck struct {
Test []string `yaml:"test,omitempty"`
Interval string `yaml:"interval,omitempty"`
Timeout string `yaml:"timeout,omitempty"`
Retries int `yaml:"retries,omitempty"`
}
HealthCheck defines container health monitoring
type Logging ¶
type Logging struct {
Driver string `yaml:"driver"`
Options map[string]string `yaml:"options,omitempty"`
}
Logging contains log management configuration
type Monitoring ¶
type Monitoring struct {
Enabled bool `yaml:"enabled"`
Type string `yaml:"type"`
Endpoint string `yaml:"endpoint"`
Alerts Alerts `yaml:"alerts,omitempty"`
}
Monitoring contains observability settings
func PromptMonitoringConfig ¶
func PromptMonitoringConfig(reader *bufio.Reader) (Monitoring, error)
type NextDeployConfig ¶
type NextDeployConfig struct {
Version string `yaml:"version"`
TargetType string `yaml:"target_type"` // e.g., "vps", "serverless"
App AppConfig `yaml:"app"`
Repository Repository `yaml:"repository"`
Docker DockerConfig `yaml:"docker"`
Deployment Deployment `yaml:"deployment"`
Serverless *ServerlessConfig `yaml:"serverless,omitempty"`
Database *Database `yaml:"database,omitempty"`
Monitoring *Monitoring `yaml:"monitoring,omitempty"`
Secrets SecretsConfig `yaml:"secrets"`
Logging Logging `yaml:"logging,omitempty"`
Backup *Backup `yaml:"backup,omitempty"`
SSL *SSL `yaml:"ssl,omitempty"`
Webhooks []Webhook `yaml:"webhooks,omitempty"`
Environment []EnvVariable `yaml:"environment,omitempty"`
Servers []ServerConfig `yaml:"servers"`
SSLConfig *SSLConfig `yaml:"ssl_config,omitempty"`
CloudProvider *CloudProviderStruct `yaml:"cloud_provider,omitempty"`
}
NextDeployConfig represents the complete deployment configuration
func InteractiveConfigPrompt ¶
func InteractiveConfigPrompt(reader *bufio.Reader) (*NextDeployConfig, error)
func Load ¶
func Load() (*NextDeployConfig, error)
func LoadConfig ¶
func LoadConfig() (*NextDeployConfig, error)
func PromptForConfig ¶
func PromptForConfig(reader *bufio.Reader) (*NextDeployConfig, error)
PromptForConfig collects user input for the nextdeploy configuration
func PromptForConfigs ¶
func PromptForConfigs(reader *bufio.Reader) (*NextDeployConfig, error)
type Repository ¶
type Repository struct {
URL string `yaml:"url"`
Branch string `yaml:"branch"`
AutoDeploy bool `yaml:"autoDeploy"`
WebhookSecret string `yaml:"webhookSecret,omitempty"`
}
Repository contains source control configuration
type SSL ¶
type SSL struct {
Enabled bool `yaml:"enabled"`
Provider string `yaml:"provider"`
Domains []string `yaml:"domains"`
Email string `yaml:"email"`
Wildcard bool `yaml:"wildcard"`
DNSProvider string `yaml:"dns_provider"`
Staging bool `yaml:"staging"`
Force bool `yaml:"force"`
AutoRenew bool `yaml:"auto_renew"`
Domain string `yaml:"domain,omitempty"`
}
SSL contains certificate management
type SSLConfig ¶
type SSLConfig struct {
Domain string `yaml:"domain"`
Email string `yaml:"email"`
Staging bool `yaml:"staging"`
Wildcard bool `yaml:"wildcard"`
DNSProvider string `yaml:"dns_provider"`
Force bool `yaml:"force"`
SSL struct {
Enabled bool `yaml:"enabled"`
Provider string `yaml:"provider"`
Email string `yaml:"email"`
AutoRenew bool `yaml:"auto_renew"`
} `yaml:"ssl"`
}
type SafeConfig ¶
type SafeConfig struct {
AppName string `json:"app_name"`
Domain string `json:"domain"`
Port int `json:"port"`
Environment string `json:"environment"`
}
SafeConfig contains no credentials (only app name, domain, port, environment)
type SecretFile ¶
SecretFile defines file-based secrets
type SecretsConfig ¶
type SecretsConfig struct {
Provider string `yaml:"provider"`
Doppler *DopplerConfig `yaml:"doppler,omitempty"`
Vault *VaultConfig `yaml:"vault,omitempty"`
Files []SecretFile `yaml:"files,omitempty"`
Project string `yaml:"project,omitempty"`
Config string `yaml:"config,omitempty"`
// contains filtered or unexported fields
}
SecretsConfig defines secret management
type Server ¶
type Server struct {
Host string `yaml:"host"`
User string `yaml:"user"`
SSHKey string `yaml:"sshKey,omitempty"`
UseSudo bool `yaml:"useSudo"`
}
Server contains target server connection details
type ServerConfig ¶
type ServerConfig struct {
WebServer *WebServer `yaml:"web_server,omitempty"`
Name string `yaml:"name"`
Host string `yaml:"host"`
Port int `yaml:"port"`
Username string `yaml:"username"`
// #nosec G117
Password string `yaml:"password"`
KeyPath string `yaml:"key_path"`
SSHKey string `yaml:"ssh_key,omitempty"`
KeyPassphrase string `yaml:"key_passphrase,omitempty"`
}
type ServerlessConfig ¶
type ServerlessConfig struct {
Provider string `yaml:"provider"` // e.g., "aws"
Region string `yaml:"region"`
S3Bucket string `yaml:"s3_bucket,omitempty"`
CloudFrontId string `yaml:"cloudfront_id,omitempty"`
}
ServerlessConfig defines AWS/Serverless settings
type Storage ¶
type Storage struct {
Type string `yaml:"type"`
Endpoint string `yaml:"endpoint,omitempty"`
Bucket string `yaml:"bucket"`
// #nosec G117
AccessKey string `yaml:"accessKey,omitempty"`
SecretKey string `yaml:"secretKey,omitempty"`
}
Storage contains backup storage details
type VaultConfig ¶
type VaultConfig struct {
Address string `yaml:"address"`
Token string `yaml:"token"`
Path string `yaml:"path"`
}
VaultConfig contains HashiCorp Vault settings