Skip to content

Commit

Permalink
Use .bk.yaml universally for config (#216)
Browse files Browse the repository at this point in the history
* Use .bk.yaml universally for config

* Don't hide config

---------

Co-authored-by: Ben McNicholl <hello@benmcnicholl.com>
  • Loading branch information
mcncl and Ben McNicholl authored Mar 26, 2024
1 parent 6d76234 commit 104fb6b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const (
// buildkite-oss:
// api_token: <token>
type Config struct {
Organization string
APIToken string
Organization string
V ViperConfig
}

Expand Down Expand Up @@ -92,10 +92,10 @@ func LoadProjectConfig() (*ProjectConfig, error) {
currentDirName := filepath.Base(dir)

var configFile string
if _, err := os.Stat("buildkite.yaml"); err == nil {
configFile = "buildkite.yaml"
} else if _, err := os.Stat("buildkite.yml"); err == nil {
configFile = "buildkite.yml"
if _, err := os.Stat(".bk.yaml"); err == nil {
configFile = ".bk.yaml"
} else if _, err := os.Stat(".bk.yml"); err == nil {
configFile = ".bk.yml"
}

// If a configuration file is found, try to read and parse it
Expand All @@ -121,7 +121,7 @@ func LoadProjectConfig() (*ProjectConfig, error) {
}

func writePipelineToBuildkiteYAML(projectConfig *ProjectConfig) (*ProjectConfig, error) {
configFilePath := "buildkite.yaml"
configFilePath := ".bk.yaml"

configData := make(map[string]interface{})
// Attempt to read the existing buildkite.yaml file
Expand Down

0 comments on commit 104fb6b

Please sign in to comment.