Skip to content

Commit

Permalink
Merge pull request #2 from cludden/cludden/force-history
Browse files Browse the repository at this point in the history
chore: upgrades sdk to v0.3.2
  • Loading branch information
Chris Ludden authored Aug 17, 2022
2 parents ffa8054 + ef01942 commit 05505b5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/benthosdev/benthos/v4 v4.0.0
github.com/cludden/concourse-go-sdk v0.3.1
github.com/cludden/concourse-go-sdk v0.3.2
github.com/hashicorp/go-multierror v1.1.1
github.com/stretchr/testify v1.8.0
gopkg.in/yaml.v2 v2.4.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ github.com/clbanning/mxj/v2 v2.5.6 h1:Jm4VaCI/+Ug5Q57IzEoZbwx4iQFA6wkXv72juUSeK+
github.com/clbanning/mxj/v2 v2.5.6/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=
github.com/cludden/concourse-go-sdk v0.3.1 h1:jvpPp4X64PLizdP/eBCKF2f6XBBdxS0JDdeRqhO0HOc=
github.com/cludden/concourse-go-sdk v0.3.1/go.mod h1:hIIHppVM7kUGWM5qHU2tp+Ruki3vT5CDTgyA0K1fYXs=
github.com/cludden/concourse-go-sdk v0.3.2 h1:/nxgxJ5q9SmHBqaBf91+TF65F1hC7G//t4adQ0457eM=
github.com/cludden/concourse-go-sdk v0.3.2/go.mod h1:hIIHppVM7kUGWM5qHU2tp+Ruki3vT5CDTgyA0K1fYXs=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
Expand Down
14 changes: 7 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import (
"path"

"github.com/benthosdev/benthos/v4/public/bloblang"
concourse "github.com/cludden/concourse-go-sdk"
sdk "github.com/cludden/concourse-go-sdk"
"github.com/cludden/concourse-go-sdk/pkg/archive"
"github.com/hashicorp/go-multierror"
"gopkg.in/yaml.v2"
)

func main() {
concourse.Main(&Resource{})
sdk.Main(&Resource{})
}

// =============================================================================
Expand Down Expand Up @@ -84,7 +84,7 @@ func (r *Resource) Check(ctx context.Context, s *Source, v *Version) (versions [

// In writes an incoming version the filesystem, allowing downstream steams to utilize
// arbitary data from an earlier put step
func (r *Resource) In(ctx context.Context, s *Source, v *Version, dir string, p *GetParams) ([]concourse.Metadata, error) {
func (r *Resource) In(ctx context.Context, s *Source, v *Version, dir string, p *GetParams) ([]sdk.Metadata, error) {
if err := writeJSON(dir, "version.json", v); err != nil {
return nil, fmt.Errorf("error writing version.json: %v", err)
}
Expand Down Expand Up @@ -143,7 +143,7 @@ func (r *Resource) In(ctx context.Context, s *Source, v *Version, dir string, p

// Out generates a new version that contains arbitray key value pairs, where both keys
// and values are string data
func (r *Resource) Out(ctx context.Context, s *Source, dir string, p *PutParams) (*Version, []concourse.Metadata, error) {
func (r *Resource) Out(ctx context.Context, s *Source, dir string, p *PutParams) (*Version, []sdk.Metadata, error) {
m := "root = this"
if p != nil && p.Mapping != "" {
m = p.Mapping
Expand All @@ -156,7 +156,7 @@ func (r *Resource) Out(ctx context.Context, s *Source, dir string, p *PutParams)
// metadata returns build metadata as a map[string]interface{} to be used as the input
// document to bloblang mappings, in addition to a []concourse.Metadata to be returned
// by In and Out methods
func metadata() (doc map[string]interface{}, meta []concourse.Metadata) {
func metadata() (doc map[string]interface{}, meta []sdk.Metadata) {
doc = map[string]interface{}{
"build_id": os.Getenv("BUILD_ID"),
"build_name": os.Getenv("BUILD_NAME"),
Expand All @@ -172,7 +172,7 @@ func metadata() (doc map[string]interface{}, meta []concourse.Metadata) {
doc["build_instance_vars"] = entry
}
for k, v := range doc {
meta = append(meta, concourse.Metadata{
meta = append(meta, sdk.Metadata{
Name: k,
Value: v.(string),
})
Expand All @@ -181,7 +181,7 @@ func metadata() (doc map[string]interface{}, meta []concourse.Metadata) {
}

// newVersion initializes a new Version value using the specified mapping
func (r *Resource) newVersion(ctx context.Context, mapping string) (*Version, []concourse.Metadata, error) {
func (r *Resource) newVersion(ctx context.Context, mapping string) (*Version, []sdk.Metadata, error) {
e, err := bloblang.Parse(mapping)
if err != nil {
return nil, nil, fmt.Errorf("error parsing 'mapping': %v", err)
Expand Down

0 comments on commit 05505b5

Please # to comment.