Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.

Commit f0d0c39

Browse files
author
Sam McGeown
committed
Build: ghcr.io/vmware
1 parent 6a03504 commit f0d0c39

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ jobs:
2323
name: Docker Login
2424
uses: docker/login-action@v1
2525
with:
26-
username: ${{ secrets.DOCKERHUB_USERNAME }}
27-
password: ${{ secrets.DOCKERHUB_TOKEN }}
26+
registry: ghcr.io
27+
username: ${{ github.repository_owner }}
28+
password: ${{ secrets.CODE_STREAM_CLI_BUILD_TOKEN }}
2829
-
2930
name: Set up Go
3031
uses: actions/setup-go@v2

cmd/api-func-shared.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func testAccessToken() bool {
7777
log.Warnln(err)
7878
return false
7979
}
80-
log.Debugln(queryResponse.RawResponse)
80+
// log.Debugln(queryResponse.RawResponse)
8181
if queryResponse.StatusCode() == 401 {
8282
log.Debugln("Access Token Expired")
8383
return false

cmd/pipeline.go

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package cmd
66

77
import (
88
"errors"
9-
"fmt"
9+
"io/ioutil"
1010
"os"
1111
"strings"
1212

@@ -131,14 +131,30 @@ var createPipelineCmd = &cobra.Command{
131131
if err := ensureTargetConnection(); err != nil {
132132
log.Fatalln(err)
133133
}
134-
135-
if importPath != "" {
136-
err := importYaml(importPath, "create")
134+
// Read importPath
135+
stat, err := os.Stat(importPath)
136+
if err == nil && stat.IsDir() {
137+
log.Debugln("importPath is a directory")
138+
files, err := ioutil.ReadDir(importPath)
137139
if err != nil {
138-
log.Fatalln("Failed to import Pipeline", err)
140+
log.Fatal(err)
141+
}
142+
for _, f := range files {
143+
if strings.Contains(f.Name(), ".yaml") || strings.Contains(f.Name(), ".yml") {
144+
log.Println(f.Name())
145+
}
139146
}
140-
fmt.Println("Imported successfully, Pipeline created.")
147+
} else {
148+
log.Debugln("importPath is a file")
141149
}
150+
151+
// if importPath != "" {
152+
// err := importYaml(importPath, "create")
153+
// if err != nil {
154+
// log.Fatalln("Failed to import Pipeline", err)
155+
// }
156+
// fmt.Println("Imported successfully, Pipeline created.")
157+
// }
142158
},
143159
}
144160

0 commit comments

Comments
 (0)