9
9
"encoding/json"
10
10
"fmt"
11
11
"github.com/diggerhq/digger/dgctl/utils"
12
+ "github.com/diggerhq/digger/libs/backendapi"
12
13
orchestrator_scheduler "github.com/diggerhq/digger/libs/scheduler"
13
14
"github.com/diggerhq/digger/libs/spec"
14
15
"github.com/google/go-github/v61/github"
@@ -274,10 +275,11 @@ var execCmd = &cobra.Command{
274
275
var spec spec.Spec
275
276
err = json .Unmarshal (specBytes , & spec )
276
277
277
- // attatch zip archive to backend
278
+ // attach zip archive to backend
278
279
backendToken := spec .Job .BackendJobToken
279
280
zipLocation , err := utils .ArchiveGitRepo ("./" )
280
- statusCode , respBody , err := utils .SendZipAsJobArtefact (diggerHostname , zipLocation , backendToken )
281
+ statusCode , respBody , err := backendapi.DiggerApi {DiggerHost : diggerHostname , AuthToken : backendToken }.UploadJobArtefact (zipLocation )
282
+
281
283
if err != nil {
282
284
log .Printf ("could not attach zip artefact: %v" , err )
283
285
os .Exit (1 )
@@ -288,9 +290,6 @@ var execCmd = &cobra.Command{
288
290
os .Exit (1 )
289
291
}
290
292
291
- log .Printf ("exiting early ..." )
292
- os .Exit (0 )
293
-
294
293
token := os .Getenv ("GITHUB_PAT_TOKEN" )
295
294
if token == "" {
296
295
log .Printf ("missing variable: GITHUB_PAT_TOKEN" )
@@ -307,11 +306,6 @@ var execCmd = &cobra.Command{
307
306
os .Exit (1 )
308
307
}
309
308
}
310
- err = pushToBranch (prBranch )
311
- if err != nil {
312
- log .Printf ("could not push to branchL %v" , err )
313
- os .Exit (1 )
314
- }
315
309
316
310
inputs := orchestrator_scheduler.WorkflowInput {
317
311
Spec : string (specBytes ),
0 commit comments