Skip to content

Commit

Permalink
updated taskfile for test
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-hermann-sva committed Mar 4, 2024
1 parent 150a091 commit 4b452a3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 37 deletions.
13 changes: 13 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ tasks:
cmds:
- "go install github.com/spf13/cobra-cli@v{{ .COBRA_VERSION }}"

tests:
desc: Built cli tests
deps:
- build
cmds:
- machineShop render --source local --template tests/template.yaml --defaults tests/default.yaml

build:
desc: Build code
cmds:
- go mod tidy
- go install

install:
desc: Install
deps: [lint, test]
Expand Down
25 changes: 0 additions & 25 deletions cmd/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,10 @@ var renderCmd = &cobra.Command{
if defaultsPath != "" {
defaultsFile = sthingsCli.ReadFileContentFromGitRepo(repo, defaultsPath)

log.Error("HERE!")
log.Error("HERE!")
log.Error("HERE!")

log.Info("LOADED DEFAULTS FILE FROM: ", defaultsPath)
fmt.Println(defaultsFile)
defaultVariables = sthingsCli.ReadYamlKeyValuesFromFile([]byte(defaultsFile))

log.Error("HERE2!")
log.Error("HERE2!")
log.Error("HERE2!")

} else {
log.Info("NO DEFAULTS FILE FROM GIT DEFINED")
}
Expand Down Expand Up @@ -171,20 +163,3 @@ func init() {
renderCmd.Flags().StringSlice("values", []string{}, "templating values")
renderCmd.Flags().Bool("b64", false, "decode base64 for output")
}

// func ReadYamlKeyValuesFromFile(yamlFileContent []byte) (yamlStructure map[string]interface{}) {

// yamlStructure = make(map[string]interface{})
// data := make(map[interface{}]interface{})

// err := yamlv3.Unmarshal(yamlFileContent, &data)
// if err != nil {
// log.Fatal(err)
// }

// for k, v := range data {
// yamlStructure[fmt.Sprintf("%v", k)] = fmt.Sprintf("%v", v)
// }

// return
// }
8 changes: 0 additions & 8 deletions hello.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion internal/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ func GitCommitFile(repository string, auth *http.BasicAuth, fileContent []byte,
fmt.Println(w.Status())

// git add $filePath
w.Add(filePath)
added, _ := w.Add(filePath)
fmt.Println(added)
// w.Remove(filePath2)
// Run git status after the file has been added adding to the worktree
fmt.Println("STATUUUS")
Expand Down
4 changes: 1 addition & 3 deletions tests/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ runs:
packagePublishHelmChart:
name: package-publish-{{ .chartName }}
addRandomDateToRunName: {{ or .randomName "false" }}
namespace:

{{ .namespace }}
namespace: {{ .namespace }}

0 comments on commit 4b452a3

Please sign in to comment.