Skip to content

Commit

Permalink
[feat]: [CI-11166]: Upgrade go-convert and spec (#16)
Browse files Browse the repository at this point in the history
* [feat]: [CI-11166]: Upgrade go-convert and spec

* upgrade convert

* Update go-convert
  • Loading branch information
anurag-harness authored Mar 5, 2024
1 parent 6106c29 commit e56e0ce
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 58 deletions.
9 changes: 7 additions & 2 deletions builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func (b *Builder) Build(fsys fs.FS) ([]byte, error) {
stage.Spec = stageci

pipeline := new(spec.Pipeline)
pipeline.Name = "sample pipeline"
pipeline.Stages = append(pipeline.Stages, stage)
for _, rule := range b.vendor.GetRules() {
if err := rule(fsys, pipeline); err == utils.SkipAll {
Expand All @@ -59,7 +58,13 @@ func (b *Builder) Build(fsys fs.FS) ([]byte, error) {
// never prevent yaml generation.
}

yml, err := yaml.Marshal(pipeline)
config := new(spec.Config)
config.Type = "pipeline"
config.Kind = "pipeline"
config.Version = 1
config.Spec = pipeline

yml, err := yaml.Marshal(config)
if (b.version == "v1") || (b.version == "default") {
return yml, err
} else {
Expand Down
1 change: 0 additions & 1 deletion builder/rules/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ func NewHarness() Harness {

func (h Harness) GetRules() []Rule {
return []Rule{
harness.ConfigurePipelineVersion,
harness.ConfigurePlatform,
harness.ConfigureGo,
harness.ConfigureGoGlide,
Expand Down
4 changes: 2 additions & 2 deletions builder/rules/harness/rule_platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ func ConfigurePlatform(fsys fs.FS, pipeline *spec.Pipeline) error {

// unless this is an xcode project
if isXcode(fsys) {
stage.Platform.Os = spec.OSMacos
stage.Platform.Arch = spec.ArchArm64
stage.Platform.Os = spec.OSMacos.String()
stage.Platform.Arch = spec.ArchArm64.String()
}

return nil
Expand Down
18 changes: 0 additions & 18 deletions builder/rules/harness/rule_version.go

This file was deleted.

13 changes: 3 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,15 @@ module github.com/wings-software/autogen-go
go 1.19

require (
github.com/drone/spec v0.0.0-20230328162846-c2bc4a6d62ab
github.com/drone/go-convert v0.0.0-20240305164238-a810cce167fd
github.com/drone/spec v0.0.0-20230920145636-3827abdce961
github.com/ghodss/yaml v1.0.0
)

require (
github.com/bmatcuk/doublestar v1.3.4 // indirect
github.com/buildkite/yaml v2.1.0+incompatible // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/drone/drone-go v1.7.1 // indirect
github.com/drone/go-convert v0.0.0-20230329091825-a238380a6b0e // indirect
github.com/google/subcommands v1.2.0 // indirect
github.com/gotidy/ptr v1.4.0 // indirect
github.com/kr/text v0.2.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/text v0.13.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
31 changes: 6 additions & 25 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,43 +1,24 @@
github.com/99designs/httpsignatures-go v0.0.0-20170731043157-88528bf4ca7e/go.mod h1:Xa6lInWHNQnuWoF0YPSsx+INFA9qk7/7pTjwb3PInkY=
github.com/bmatcuk/doublestar v1.3.4 h1:gPypJ5xD31uhX6Tf54sDPUOBXTqKH4c9aPY66CyQrS0=
github.com/bmatcuk/doublestar v1.3.4/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE=
github.com/buildkite/yaml v2.1.0+incompatible h1:xirI+ql5GzfikVNDmt+yeiXpf/v1Gt03qXTtT5WXdr8=
github.com/buildkite/yaml v2.1.0+incompatible/go.mod h1:UoU8vbcwu1+vjZq01+KrpSeLBgQQIjL/H7Y6KwikUrI=
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/drone/drone-go v1.7.1 h1:ZX+3Rs8YHUSUQ5mkuMLmm1zr1ttiiE2YGNxF3AnyDKw=
github.com/drone/drone-go v1.7.1/go.mod h1:fxCf9jAnXDZV1yDr0ckTuWd1intvcQwfJmTRpTZ1mXg=
github.com/drone/go-convert v0.0.0-20230329091825-a238380a6b0e h1:ybfe4Po+BUQjm2BpIZjEpng9fXBYgPvAehNe2edC0lY=
github.com/drone/go-convert v0.0.0-20230329091825-a238380a6b0e/go.mod h1:HamZvO81G2K1g9FeRVliWaN0vEV4AMSfMsINzI2ZbS4=
github.com/drone/spec v0.0.0-20230203155728-6f5b316cad3e h1:9IrlHM84CSV6ui+PnxWRTslm8VJiyvpyd8tIsUVCSKE=
github.com/drone/spec v0.0.0-20230203155728-6f5b316cad3e/go.mod h1:lhM5nV3zKzXnHD2WPLQ2KoJ/65hr3vr0KaiKod2T3W8=
github.com/drone/spec v0.0.0-20230316030012-8fb992844a55 h1:3JssRUXnMnGVSXUni4mkln4TGzvHMgcN4lpviuH35dY=
github.com/drone/spec v0.0.0-20230316030012-8fb992844a55/go.mod h1:pdaL6nOipGF/5L6jAu1DwAeLzmZdaU3+UIvQ1MUIZ9Y=
github.com/drone/spec v0.0.0-20230328162846-c2bc4a6d62ab h1:SCRvpZOFAS/kFo6q0c+oeH+ID0OBDPLpDAx4uHYQwYo=
github.com/drone/spec v0.0.0-20230328162846-c2bc4a6d62ab/go.mod h1:pdaL6nOipGF/5L6jAu1DwAeLzmZdaU3+UIvQ1MUIZ9Y=
github.com/drone/go-convert v0.0.0-20240305164238-a810cce167fd h1:RjIUkMF7oUxrIn4IKUj4DbKjCxTNkC58M/kYSbXFXh0=
github.com/drone/go-convert v0.0.0-20240305164238-a810cce167fd/go.mod h1:PyCDcuAhGF6W0VJ6qMmlM47dsSyGv/zDiMqeJxMFuGM=
github.com/drone/spec v0.0.0-20230920145636-3827abdce961 h1:aUWrLS2ghyxIpDICpZOV50V1x7JLM3U80UQDQxMKT54=
github.com/drone/spec v0.0.0-20230920145636-3827abdce961/go.mod h1:KyQZA9qwuscbbM7yTrtZg25Wammoc5GKwaRem8kDA5k=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/subcommands v1.2.0 h1:vWQspBTo2nEqTUFita5/KeEWlUL8kQObDFbub/EN9oE=
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/gotidy/ptr v1.4.0 h1:7++suUs+HNHMnyz6/AW3SE+4EnBhupPSQTSI7QNijVc=
github.com/gotidy/ptr v1.4.0/go.mod h1:MjRBG6/IETiiZGWI8LrRtISXEji+8b/jigmj2q0mEyM=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 comments on commit e56e0ce

Please sign in to comment.