Skip to content
Permalink
Browse files

add Stages.Development back for overrides

we still need it haha..
  • Loading branch information...
tj committed Feb 1, 2018
1 parent 272a2a6 commit 407c684b9e7fc12619c3abf7a91e857e15a1af02
Showing with 21 additions and 2 deletions.
  1. +21 −2 config/stages.go
@@ -9,6 +9,16 @@ type Stage struct {
StageOverrides StageOverrides
} }


// IsLocal returns true if the stage represents a local environment.
func (s *Stage) IsLocal() bool {
return s.Name == "development"
}

// IsRemote returns true if the stage represents a remote environment.
func (s *Stage) IsRemote() bool {
return !s.IsLocal()
}

// StageOverrides config. // StageOverrides config.
type StageOverrides struct { type StageOverrides struct {
Hooks Hooks `json:"hooks"` Hooks Hooks `json:"hooks"`
@@ -25,12 +35,17 @@ func (s *StageOverrides) Override(c *Config) {


// Stages config. // Stages config.
type Stages struct { type Stages struct {
Staging *Stage `json:"staging"` Development *Stage `json:"development"`
Production *Stage `json:"production"` Staging *Stage `json:"staging"`
Production *Stage `json:"production"`
} }


// Default implementation. // Default implementation.
func (s *Stages) Default() error { func (s *Stages) Default() error {
if s := s.Development; s != nil {
s.Name = "development"
}

if s := s.Staging; s != nil { if s := s.Staging; s != nil {
s.Name = "staging" s.Name = "staging"
} }
@@ -49,6 +64,10 @@ func (s *Stages) Validate() error {


// List returns configured stages. // List returns configured stages.
func (s *Stages) List() (v []*Stage) { func (s *Stages) List() (v []*Stage) {
if s := s.Development; s != nil {
v = append(v, s)
}

if s := s.Staging; s != nil { if s := s.Staging; s != nil {
v = append(v, s) v = append(v, s)
} }

0 comments on commit 407c684

Please sign in to comment.
You can’t perform that action at this time.