@@ -17,8 +17,6 @@ package config
17
17
import (
18
18
"encoding/json"
19
19
"fmt"
20
- "os"
21
- "path/filepath"
22
20
"strings"
23
21
24
22
"github.com/pipe-cd/pipecd/pkg/model"
@@ -303,23 +301,6 @@ func (a *AnalysisStageOptions) Validate() error {
303
301
return nil
304
302
}
305
303
306
- // ScriptRunStageOptions contains all configurable values for a SCRIPT_RUN stage.
307
- type ScriptRunStageOptions struct {
308
- Env map [string ]string `json:"env"`
309
- Run string `json:"run"`
310
- Timeout Duration `json:"timeout" default:"6h"`
311
- OnRollback string `json:"onRollback"`
312
- SkipOn SkipOptions `json:"skipOn,omitempty"`
313
- }
314
-
315
- // Validate checks the required fields of ScriptRunStageOptions.
316
- func (s * ScriptRunStageOptions ) Validate () error {
317
- if s .Run == "" {
318
- return fmt .Errorf ("SCRIPT_RUN stage requires run field" )
319
- }
320
- return nil
321
- }
322
-
323
304
type AnalysisTemplateRef struct {
324
305
Name string `json:"name"`
325
306
AppArgs map [string ]string `json:"appArgs"`
@@ -571,25 +552,3 @@ func (dd *DriftDetection) Validate() error {
571
552
}
572
553
return nil
573
554
}
574
-
575
- func LoadApplication (repoPath , configRelPath string , appKind model.ApplicationKind ) (* GenericApplicationSpec , error ) {
576
- absPath := filepath .Join (repoPath , configRelPath )
577
-
578
- cfg , err := LoadFromYAML (absPath )
579
- if err != nil {
580
- if os .IsNotExist (err ) {
581
- return nil , fmt .Errorf ("application config file %s was not found in Git" , configRelPath )
582
- }
583
- return nil , err
584
- }
585
- if kind , ok := cfg .Kind .ToApplicationKind (); ! ok || kind != appKind {
586
- return nil , fmt .Errorf ("invalid application kind in the application config file, got: %s, expected: %s" , kind , appKind )
587
- }
588
-
589
- spec , ok := cfg .GetGenericApplication ()
590
- if ! ok {
591
- return nil , fmt .Errorf ("unsupported application kind: %s" , appKind )
592
- }
593
-
594
- return & spec , nil
595
- }
0 commit comments